bundle.gs3d.generators.mesh =========================== .. py:module:: bundle.gs3d.generators.mesh .. autoapi-nested-parse:: Mesh-to-Gaussians: surface-sample any trimesh-readable mesh. The generated splats are *surface-aligned*: each sample becomes a flat, disc-like Gaussian whose local +Z axis points along the face normal. ``scale_2`` (the normal axis) is small, ``scale_0``/``scale_1`` (the tangent plane) are larger — the on-disk size of each disc tracks the average per-sample area ``sqrt(mesh.area / N)`` so coverage stays roughly uniform regardless of mesh resolution. If the mesh exposes per-face colours and ``use_mesh_color`` is set, the SH DC term is sampled from the mesh; otherwise the uniform ``color`` field on the base generator is used. ``trimesh`` is an optional guarded dependency — install via the ``thebundle[gs3d]`` extra. Attributes ---------- .. autoapisummary:: bundle.gs3d.generators.mesh.log Classes ------- .. autoapisummary:: bundle.gs3d.generators.mesh.MeshToGaussiansGenerator Module Contents --------------- .. py:data:: log .. py:class:: MeshToGaussiansGenerator(/, **data: Any) Bases: :py:obj:`bundle.gs3d.generators.base.Generator` Sample a triangle mesh and convert each sample into a surface-aligned Gaussian. .. attribute:: source Path to a trimesh-readable mesh file (obj, ply, stl, glb, ...). .. attribute:: method ``"uniform"`` for fast area-weighted sampling, ``"even"`` for Poisson-disc-like even sampling (slower). .. attribute:: disc_thickness_ratio Ratio of normal-axis scale to tangent-axis scale. Smaller values produce thinner, more disc-like splats. .. attribute:: use_mesh_color When ``True`` and the mesh exposes per-face colours, sample the SH DC term from the mesh instead of using ``color``. .. py:attribute:: name :type: str :value: 'mesh' .. py:attribute:: source :type: pathlib.Path .. py:attribute:: method :type: Literal['uniform', 'even'] :value: 'uniform' .. py:attribute:: disc_thickness_ratio :type: float :value: 0.1 .. py:attribute:: use_mesh_color :type: bool :value: True .. py:method:: generate() -> bundle.gs3d.ply.GaussianCloudArrays :async: Produce a :class:`GaussianCloudArrays` from this generator's parameters.