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.
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.
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.
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.
Triangulate
Triangulates all polygons in a naive way, though still guaranteeing that no additional degenerate triangles are introduced.
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.
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.
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.
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).
HalfedgeToEdge
Populates DataSlot::HalfedgeToEdge with the mapping from halfedge to edge index.
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.
HalfedgeToNextHalfedge
Populates DataSlot::HalfedgeToNextHalfedge with the mapping from halfedge to next halfedge index.
HalfedgeToPrevHalfedge
Populates DataSlot::HalfedgeToPrevHalfedge with the mapping from halfedge to previous halfedge index.
HalfedgeToOppositeHalfedge
Populates DataSlot::HalfedgeToOppositeHalfedge with the mapping from halfedge to opposite halfedge index.
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.
PrimitiveSize
Populates DataSlot::PrimitiveSize with the number of vertices per face.
PrimitiveToHalfedge
Populates DataSlot::PrimitiveToHalfedge with the mapping from primitive/face/polygon to an arbitrary halfedge belonging to the primitive.
VertexToHalfedge
Populates DataSlot::VertexToHalfedge with the mapping from vertex to an arbitrary halfedge pointing to the vertex.