Operation

Command buffer for recording, optimizing, and executing mesh operations

An operation realizes a Command Buffer pattern. Many elementary operations, queries, and commands can be recorded in a single Operation. Using Context::Execute, Operations can be executed. Internally, the Solidean engine computes an optimized schedule to execute the whole Operation.

Defining the individual steps of an Operation has no error checking. Inputs are Operands that have been introduced using ::Input or ::Import. The return value are Operands that represent the result symbolically. This Operand is only valid in the source Operation. Any result must be exported using ::Output or ::Export and similar functions. Error handling is performed during Context::Execute and can be checked in the Operation's error log.

During Execution, an Operation will optimized all given sub-operations. In particular, Operands that are not saved via ::Output will in most cases never be explicitly created.

Signature

// Command buffer for recording, optimizing, and executing mesh operations
class Operation:
    fun input(inMesh: Mesh) -> MeshOperand
    fun output(localMesh: MeshOperand) -> Mesh
    fun union(meshA: MeshOperand, meshB: MeshOperand) -> MeshOperand
    fun selfUnion(inMesh: MeshOperand) -> MeshOperand
    fun difference(meshA: MeshOperand, meshB: MeshOperand) -> MeshOperand
    fun differenceSymmetric(meshA: MeshOperand, meshB: MeshOperand) -> MeshOperand
    fun intersection(meshA: MeshOperand, meshB: MeshOperand) -> MeshOperand
    fun resolveIntersections(inMesh: MeshOperand) -> MeshOperand
    fun importFromTrianglesF32(triangles: [triangle3], meshType: MeshType, lifetime: Lifetime) -> MeshOperand
    fun importFromTrianglesF32WithID(triangles: [triangle3], surfaceID: uint32_t, meshType: MeshType, lifetime: Lifetime) -> MeshOperand
    fun importFromIndexedTrianglesF32(positions: [pos3], triangles: [idxtri], meshType: MeshType, lifetime: Lifetime) -> MeshOperand
    fun importFromIndexedTrianglesF32WithID(positions: [pos3], triangles: [idxtri], surfaceID: uint32_t, meshType: MeshType, lifetime: Lifetime) -> MeshOperand
    fun exportToTrianglesF32(mesh: MeshOperand) -> TypedBlob
    fun exportToTrianglesF32WithID(mesh: MeshOperand) -> TypedBlob
    fun exportToIndexedTrianglesF32(mesh: MeshOperand) -> TypedBlob
    fun exportToIndexedTrianglesF32WithID(mesh: MeshOperand) -> TypedBlob
    fun exportDefectNetwork(mesh: MeshOperand) -> TypedBlob
    fun exportMesh(mesh: MeshOperand, format: ExportFormat, options: ExportOption) -> TypedBlob
    fun heal(inMesh: MeshOperand) -> MeshOperand
    fun queryArea(mesh: MeshOperand) -> TypedBlob
    fun queryVolume(mesh: MeshOperand) -> TypedBlob
    fun queryIsSupersolid(mesh: MeshOperand) -> TypedBlob
    fun queryIsSolid(mesh: MeshOperand) -> TypedBlob
    fun queryHasNestedComponents(mesh: MeshOperand) -> TypedBlob
    fun queryHasSelfIntersections(mesh: MeshOperand) -> TypedBlob
    fun queryHasSurfaceIntersections(mesh: MeshOperand) -> TypedBlob

// constructors
class Context:
    fun createOperation(arithmetic: ExactArithmetic) -> Operation

Constructors

NameDescription
createOperationCreates a new operation with a chosen arithmetic context

Methods

NameTypeDescription
inputMeshOperandIntroduces a persistent mesh as an operand into an operation
outputMeshMarks an operand to be materialized as a persistent mesh after execution
unionMeshOperandComputes the union of two mesh operands
selfUnionMeshOperandConverts a supersolid mesh into a guaranteed solid mesh by removing internal overlaps
differenceMeshOperandComputes the subtraction of one mesh operand from another
differenceSymmetricMeshOperandComputes the symmetric difference between two mesh operands
intersectionMeshOperandComputes the intersection of two mesh operands
resolveIntersectionsMeshOperandProduces a mesh where no faces intersect each other
importFromTrianglesF32MeshOperandCreates a mesh operand from a float32 triangle soup
importFromTrianglesF32WithIDMeshOperandCreates a mesh operand from a float32 triangle soup with primitive tracking IDs
importFromIndexedTrianglesF32MeshOperandCreates a mesh operand from indexed float32 triangles
importFromIndexedTrianglesF32WithIDMeshOperandCreates a mesh operand from indexed float32 triangles with primitive tracking IDs
exportToTrianglesF32TypedBlobExports a mesh operand to a flat float32 triangle blob
exportToTrianglesF32WithIDTypedBlobExports a mesh operand to float32 triangles with primitive tracking IDs
exportToIndexedTrianglesF32TypedBlobExports a mesh operand to an indexed float32 triangle blob
exportToIndexedTrianglesF32WithIDTypedBlobExports a mesh operand to indexed float32 triangles with primitive tracking IDs
exportDefectNetworkTypedBlobExports the defect network of a mesh to analyze non-supersolid edges
exportMeshTypedBlobConfigurable export of a mesh operand to a chosen format and options
healMeshOperandRepairs a non-supersolid mesh into a supersolid one with strong guarantees
queryAreaTypedBlobComputes the total surface area of a mesh
queryVolumeTypedBlobComputes the total enclosed volume of a supersolid mesh
queryIsSupersolidTypedBlobChecks if a non-supersolid mesh is actually supersolid
queryIsSolidTypedBlobChecks if a non-solid mesh is actually solid
queryHasNestedComponentsTypedBlobChecks if a supersolid mesh contains nested components
queryHasSelfIntersectionsTypedBlobChecks if a mesh has self-intersections within a surface
queryHasSurfaceIntersectionsTypedBlobChecks if a mesh has intersections between different surfaces