ExportOption

Configurable flags controlling attributes, topology, and guarantees during export

These flags extensively configurable the behavior and guarantees of Operation::Export.

Determines if the result is indexed or unrolled, if they are triangles or polys, if we create a half-edge topology, etc.

Note:
not all combinations of options are valid with each other or all formats. Notable exceptions are

Signature

// Configurable flags controlling attributes, topology, and guarantees during export
enum ExportOption:
    None = 0
    VertexPositionF32 = 1
    VertexPositionF64 = 2
    VertexPositionExact = 4
    VertexPositionPlanes = 8
    SupportingPlane = 16
    PrimitiveID = 32
    Manifold = 64
    PreferLargerManifolds = 128
    Triangulate = 256
    OptimizeTriangulationInteriorAngle = 512
    OptimizeTriangulationEdgeRatio = 1024
    RemoveSpuriousEdges = 2048
    RemoveSpuriousVertices = 4096
    HalfedgeToVertex = 8192
    HalfedgeToEdge = 16384
    HalfedgeToFace = 32768
    HalfedgeToNextHalfedge = 65536
    HalfedgeToPrevHalfedge = 131072
    HalfedgeToOppositeHalfedge = 262144
    HalfedgePlane = 524288
    PrimitiveSize = 1048576
    PrimitiveToHalfedge = 2097152
    VertexToHalfedge = 4194304

None

No additional processing. Use the bare minimum to produce the chosen ExportFormat and its base guarantees.

Note:
this means that vertex positions are not exported. Most use cases want to choose one of the VertexPositionXYZ options.

VertexPositionF32

Export vertex positions as floats (f32).

Populates DataSlot::PositionsF32 or DataSlot::TrianglesF32.

VertexPositionF64

Export vertex positions as floats (f64).

Populates DataSlot::PositionsF64 or DataSlot::TrianglesF64.

VertexPositionExact

Export exact vertex positions. The concrete format depends on the created ExactArithmetic (and is documented there).

For example, ArithmeticKernel::Fixed256Pos26 populates DataSlot::PositionsXYZ192_W192 or DataSlot::TrianglesXYZ192_W192.

VertexPositionPlanes

Export vertex positions as intersection of 3 exact planes. The concrete format depends on the created ExactArithmetic (and is documented there).

For example, ArithmeticKernel::Fixed256Pos26 populates DataSlot::PositionsPlanesABC64_D128 or DataSlot::TrianglesPlanesABC64_D128.

SupportingPlane

Exports exact supporting planes for each exported primitive. The concrete format depends on the created ExactArithmetic (and is documented there).

For example, ArithmeticKernel::Fixed256Pos26 populates DataSlot::PrimitiveSupportingPlaneABC64_D128.

PrimitiveID

Exports tracking IDs for each exported primitive.

Note:
any primitives that were not created or imported using the WithID versions will have the special "untracked" ID.

Populates DataSlot::PrimitiveIDs.

Manifold

Guarantees manifoldness for any type of mesh. Will generate topologically open results (aka meshes with boundary) exactly if the input is not supersolid, i.e. has geometrically open boundaries. This operation has almost no overhead and introduces no additional primitives. Manifoldness is achieved purely by duplicating a few select vertices.

Per default, this will yield the smallest possible surfaces given a solid input. This behavior can be overridden by using PreferLargerManifolds.

PreferLargerManifolds

Prefers to create topologically larger manifold surfaces instead of the smaller default. This only applies to meshes that don't uniquely decompose into manifolds, e.g. those where some edges have 4 or more adjacent faces. For solid meshes, this guarantees a decomposition into the topologically largest possible manifolds.

Note:
this flag requires the Manifold flag.

Triangulate

Triangulates all polygons in a naive way, though still guaranteeing that no additional degenerate triangles are introduced.

Note:
this does NOT change the format. It simply means that all exported faces will have exactly 3 vertices.

OptimizeTriangulationInteriorAngle

There is a lot of freedom in placing edges in planar regions during triangulation. This flag tries to maximize the minimum interior angle of each triangle, i.e. make triangles Delaunay in planar regions.

Note:
this flag requires a triangular output format or the ExportOption::Triangulate flag.

OptimizeTriangulationEdgeRatio

There is a lot of freedom in placing edges in planar regions during triangulation. This flag tries to minimize the maximum ratio between smallest and largest edge length of each triangle, thus favoring more equilateral triangles.

Note:
this flag requires a triangular output format or the ExportOption::Triangulate flag.

RemoveSpuriousEdges

For various reasons, we might have adjacent polygons with the same supporting plane and tracking ID. The edge between them is, in a way, "spurious". This option removes such edges, usually making the polygons non-convex in the process.

Note:
edges that connect the same polygon on both sides are kept. These "ghost edges" connect the polygon border to any "holes".
Note:
this is only supported when the output can actually support polygons (i.e. a polygonal ExportFormat and non-triangulating ExportOptions)

RemoveSpuriousVertices

For various reasons, we might have manifold vertices that lie on the edge between two "real" adjacent faces (in the same-supporting-plane-and-tracking-id-sense). These vertices are, in a way, "spurious". This option removes such vertices.

HalfedgeToVertex

Populates DataSlot::HalfedgeToVertex with the mapping from halfedge to vertex index (the "to vertex" is the vertex that the halfedge points to).

Note:
this is only valid with a halfedge ExportFormat.

HalfedgeToEdge

Populates DataSlot::HalfedgeToEdge with the mapping from halfedge to edge index.

Note:
this is only valid with a halfedge ExportFormat.
⚠ Warning

This feature is in-progress and not implemented yet. Please contact us with your use case and we might be able to fast-track it.

HalfedgeToFace

Populates DataSlot::HalfedgeToFace with the mapping from halfedge to face index.

Note:
this is only valid with a halfedge ExportFormat.

HalfedgeToNextHalfedge

Populates DataSlot::HalfedgeToNextHalfedge with the mapping from halfedge to next halfedge index.

Note:
this is only valid with a halfedge ExportFormat.

HalfedgeToPrevHalfedge

Populates DataSlot::HalfedgeToPrevHalfedge with the mapping from halfedge to previous halfedge index.

Note:
this is only valid with a halfedge ExportFormat.

HalfedgeToOppositeHalfedge

Populates DataSlot::HalfedgeToOppositeHalfedge with the mapping from halfedge to opposite halfedge index.

Note:
this is only valid with a halfedge ExportFormat.

HalfedgePlane

Populates a data slot with the mapping from halfedge to exact outward pointing integer plane. The concrete format depends on the created ExactArithmetic (and is documented there).

For example, ArithmeticKernel::Fixed256Pos26 populates DataSlot::HalfedgePlaneABC64_D128.

Note:
this is only valid with a halfedge ExportFormat.
Note:
non-representable planes introduces by triangulation are stored as (0,0,0,0).

PrimitiveSize

Populates DataSlot::PrimitiveSize with the number of vertices per face.

Note:
this works for consistently any format, even triangles (where it is constant 3).

PrimitiveToHalfedge

Populates DataSlot::PrimitiveToHalfedge with the mapping from primitive/face/polygon to an arbitrary halfedge belonging to the primitive.

Note:
this is only valid with a halfedge ExportFormat.

VertexToHalfedge

Populates DataSlot::VertexToHalfedge with the mapping from vertex to an arbitrary halfedge pointing to the vertex.

Note:
this is only valid with a halfedge ExportFormat.