Skip to content

mesh

mesh #

The 3D-mesh file scalar; a loaded Mesh is the file path.

It carries a mesh.kind() reader. A mesh is a non-core extension scalar (dotted reverse-DNS name), so its schema self-describes with kind + extensions and a reader without a mesh decoder can still store or skip the bytes. The canonical, cross-platform format is glTF binary (glb); USD (usdz) and Wavefront (obj) are also accepted — a loaded value is the standard mesh path, ready for any glTF/USD/OBJ tool.

Mesh #

Bases: FileScalar

A 3D mesh as a glTF/USD/OBJ file; a loaded value is its file Path.

Source code in capturegraph-lib/capturegraph/types/scalars/geometry/mesh.py
class Mesh(FileScalar, name="edu.cornell.mesh", extensions=("glb", "usdz", "obj")):
    """A 3D mesh as a glTF/USD/OBJ file; a loaded value is its file ``Path``."""

    __slots__ = ()

    def kind(self) -> str:
        """This mesh's format: 'glb', 'usdz', 'obj', or 'unknown'."""
        suffix = self.suffix.lower().lstrip(".")
        return suffix if suffix in self.extensions else "unknown"

kind() #

This mesh's format: 'glb', 'usdz', 'obj', or 'unknown'.

Source code in capturegraph-lib/capturegraph/types/scalars/geometry/mesh.py
def kind(self) -> str:
    """This mesh's format: 'glb', 'usdz', 'obj', or 'unknown'."""
    suffix = self.suffix.lower().lstrip(".")
    return suffix if suffix in self.extensions else "unknown"