Operation::QueryVolume

Computes the total enclosed volume of a supersolid mesh

Computes the total enclosed mesh volume. In the case of supersolid meshes, this counts each volume according to how often it is enclosed. For non-supersolid meshes, the volume is undefined and will yield Result::OperandMustBeSupersolid.

For example, two partially overlapping cubes in a single supersolid mesh will count the overlap region twice and the other cube parts once. Negatively oriented sub-meshes count negatively. I.e. two disjoint cubes where one has inverted triangle orders will create a total volume of zero. Should every region only be counted once (and positively), apply Operation::SelfUnion before querying.

The result is stored in a TypedBlob with BlobType::QueryResult and DataSlot::QueryResultF64.

Note:
the query result is only available after the Operation was executed.
Note:
all intermediates are accumulated in double precision. However, the volume computation currently favors speed over numerical accuracy. It depends on the accumulation and cancellation of signed volumes of sub-tetrahedrons. As such, strict and useful precision guarantees are hard to formulate. If a precise analysis is important to your use case, please contact support.

Signature

class Operation:
    // Computes the total enclosed volume of a supersolid mesh
    fun queryVolume(
        mesh: MeshOperand,
    ) -> TypedBlob