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
| Name | Description |
|---|---|
createOperation | Creates a new operation with a chosen arithmetic context |
Methods
| Name | Type | Description |
|---|---|---|
input | MeshOperand | Introduces a persistent mesh as an operand into an operation |
output | Mesh | Marks an operand to be materialized as a persistent mesh after execution |
union | MeshOperand | Computes the union of two mesh operands |
selfUnion | MeshOperand | Converts a supersolid mesh into a guaranteed solid mesh by removing internal overlaps |
difference | MeshOperand | Computes the subtraction of one mesh operand from another |
differenceSymmetric | MeshOperand | Computes the symmetric difference between two mesh operands |
intersection | MeshOperand | Computes the intersection of two mesh operands |
resolveIntersections | MeshOperand | Produces a mesh where no faces intersect each other |
importFromTrianglesF32 | MeshOperand | Creates a mesh operand from a float32 triangle soup |
importFromTrianglesF32WithID | MeshOperand | Creates a mesh operand from a float32 triangle soup with primitive tracking IDs |
importFromIndexedTrianglesF32 | MeshOperand | Creates a mesh operand from indexed float32 triangles |
importFromIndexedTrianglesF32WithID | MeshOperand | Creates a mesh operand from indexed float32 triangles with primitive tracking IDs |
exportToTrianglesF32 | TypedBlob | Exports a mesh operand to a flat float32 triangle blob |
exportToTrianglesF32WithID | TypedBlob | Exports a mesh operand to float32 triangles with primitive tracking IDs |
exportToIndexedTrianglesF32 | TypedBlob | Exports a mesh operand to an indexed float32 triangle blob |
exportToIndexedTrianglesF32WithID | TypedBlob | Exports a mesh operand to indexed float32 triangles with primitive tracking IDs |
exportDefectNetwork | TypedBlob | Exports the defect network of a mesh to analyze non-supersolid edges |
exportMesh | TypedBlob | Configurable export of a mesh operand to a chosen format and options |
heal | MeshOperand | Repairs a non-supersolid mesh into a supersolid one with strong guarantees |
queryArea | TypedBlob | Computes the total surface area of a mesh |
queryVolume | TypedBlob | Computes the total enclosed volume of a supersolid mesh |
queryIsSupersolid | TypedBlob | Checks if a non-supersolid mesh is actually supersolid |
queryIsSolid | TypedBlob | Checks if a non-solid mesh is actually solid |
queryHasNestedComponents | TypedBlob | Checks if a supersolid mesh contains nested components |
queryHasSelfIntersections | TypedBlob | Checks if a mesh has self-intersections within a surface |
queryHasSurfaceIntersections | TypedBlob | Checks if a mesh has intersections between different surfaces |