Mesh object model

A mesh object stores copied finite double-precision XYZ vertices plus 32-bit triangle indices in immutable local geometry. Object transforms, hierarchy, visibility, opacity and style are independent mutable state. Duplicating an object shares/reuses immutable geometry semantics while keeping independent placement/presentation state.

Create and import

OperationAPIContract
In-memory trianglesgx3de_object_create_meshCopies vertices and triangle indices.
OBJ/STL importgx3de_object_import_meshUses gx3de_mesh_import_spec, source and memory budgets.
Fast preview importgx3de_object_import_mesh_previewCreates a bounded preview representation without replacing authoritative source identity.
LOD derivationgx3de_mesh_lodPublishes a new mesh at Preview/Low/Medium/High/Full level.
Asynchronous preparationgx3de_job_prepare_mesh_import / gx3de_job_prepare_mesh_lodMoves blocking preparation to the job lifecycle; result is taken on caller thread.

Topology inspection and repair

FamilyWhat it doesImportant failure boundary
Diagnosticsgx3de_mesh_diagnoseArea, volume when well-defined, boundary/nonmanifold/orientation edges, disconnected components.
Boundary loopsgx3de_mesh_boundary_edges / gx3de_mesh_loops_createExposes real topology; branched or inconsistent loops are rejected.
Append / merge / weldgx3de_mesh_append, gx3de_mesh_merge, gx3de_mesh_weldCreates a new result; tolerance is explicit where applicable.
Duplicate cleanupgx3de_mesh_clean_duplicatesProduces a cleaned object rather than editing source.
Orient normalsgx3de_mesh_orient_normalsMakes edge-manifold components consistently wound and positive-volume where closed.
Stitch / bridge / heal seamgx3de_mesh_stitch, gx3de_mesh_bridge, gx3de_mesh_heal_seamConservative: requires uniquely pairable simple compatible loops and publishes only valid connected closed orientation.
Self intersectionsgx3de_mesh_self_intersections / gx3de_mesh_intersection_pairsNon-adjacent triangle-pair diagnostics with tolerance and deterministic records/witness points.

Clipping

gx3de_mesh_clip is the uncapped VTK path. gx3de_mesh_clip_capped is deliberately conservative: it is intended for transverse cuts of closed, consistently wound meshes with safe simple section contours. It matches clipped boundaries to the section profile and validates the published result. Difficult vertex-crossing, ambiguous/nonmanifold or unsafe triangulation cases fail explicitly rather than returning a questionable solid.

Interpretation of intersection diagnostics
The pair diagnostic excludes face pairs sharing vertex indices. It is useful for detecting non-adjacent self contacts/near contacts but is not a mathematical proof of global mesh validity.

Sections, profiles and projection

A section is a scene-owned snapshot of plane/object intersection segments. gx3de_profile_create snaps section endpoints at an explicit positive tolerance and derives ordered open/closed contours with length and planar area. Profiles can survive section destruction. Projection creates a reusable world-space projected object linked to source and plane; it can be refreshed explicitly while the source exists.

Repeated components

The repeat detector discovers repeated triangle components from a selected source triangle. A gx3de_repeat_result exposes prototype, placements and remainder. The optional presentation path draws captured placements through a shared prototype mapper rather than materializing one full mesh copy per occurrence. Persistent repeat cache statistics are separate from the normal mesh cache.

Fingerprints