Exporting is central to how you use Solidean, but it is also where you can make mistakes.
This page explains why import/export and input/output are different, what formats are available, and how to choose between them.
Input vs. Output
Operation::input/Operation::output
These deal with persistent Solidean meshes.inputmakes an existingMeshavailable inside anOperation.outputmaterializes a mesh as a persistent result for later reuse.- Meshes are always exact, even though internally they are heterogeneous and optimized for different cases.
- Inside Solidean, geometry is the ground truth (see Solids & Supersolids). Topology and attributes are reconstructed on-demand.
Think of input/output as staying within Solidean’s exact world: no conversions, no floating point, no loss of guarantees.
Import vs. Export
Operation::importXYZ/Operation::exportXYZ
These form the boundary between Solidean and the floating-point world.- On
import, floating point triangles are converted into Solidean’s exact arithmetic. - On
export, exact meshes are written back out, usually as floats. - Conversions happen here; this is where rounding or precision loss can occur.
- On
export just to immediately import again is usually an anti-pattern.Stay in Solidean’s exact representation as long as possible, and only export at the edges of your pipeline.
No Canonical Internal Representation
Solidean has no single canonical mesh representation.
Meshes are internally heterogeneous, fractured, and optimized for robustness and performance.
They typically contain many T-junctions and usually lack explicit topology.
Topology is reconstructed only when needed, using exact geometry as the source of truth.
Common Export Functions
These four functions cover the majority of real-world workflows:
-
Operation::exportToTrianglesF32- Unrolled triangles.
- Preserves T-junctions.
- Highest performance.
-
Operation::exportToTrianglesF32WithID- Same as above, but with tracking IDs.
-
Operation::exportToIndexedTrianglesF32- Resolves T-junctions, shares vertices.
- Produces a topological solid/supersolid.
- Preferred for rendering or further processing.
-
Operation::exportToIndexedTrianglesF32WithID- Same as above, but with tracking IDs.
These float-based exports (F32) are fast, compact, and sufficient for most pipelines.
The Power of exportMesh
For advanced cases, use Operation::exportMesh:
- Choose the export format (triangles, polygons, halfedges, indexed/unrolled, etc.).
- Configure export options: manifoldness, spurious vertex removal, supporting planes, IDs, etc.
- Access exact data: internal vertex positions, exact planes, and other invariants.
This makes exportMesh the most flexible export, and, if you request exact outputs, it can even behave like an exact API without precision loss.
Philosophy in Short
- Use input/output to stay exact and persistent inside Solidean.
- Use import/export only at the boundary of your pipeline.
- Default to
exportToIndexedTrianglesF32(with or without IDs) for robust downstream use. - Use
exportMeshwhen you need precise control or exact outputs. - And if you find yourself needing data that is difficult to compute in floating point, tell us.
We may be able to add new export options that save you work and avoid error-prone conversions.