bundle.gs3d.generators ====================== .. py:module:: bundle.gs3d.generators .. autoapi-nested-parse:: Synthetic Gaussian splat generators — backend registry and factory. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bundle/gs3d/generators/base/index /autoapi/bundle/gs3d/generators/mesh/index /autoapi/bundle/gs3d/generators/primitives/index Classes ------- .. autoapisummary:: bundle.gs3d.generators.Generator bundle.gs3d.generators.MeshToGaussiansGenerator bundle.gs3d.generators.CubeGenerator bundle.gs3d.generators.RandomCloudGenerator bundle.gs3d.generators.SphereGenerator bundle.gs3d.generators.TorusGenerator Functions --------- .. autoapisummary:: bundle.gs3d.generators.create_generator bundle.gs3d.generators.available_shapes Package Contents ---------------- .. py:class:: Generator(/, **data: Any) Bases: :py:obj:`bundle.core.entity.Entity` Base class for procedural Gaussian generators. Subclasses add shape-specific fields and implement :meth:`generate`. .. attribute:: count Number of Gaussians to emit. .. attribute:: sh_degree Spherical harmonics degree (0..3). .. attribute:: seed Random seed; ``None`` for non-deterministic output. .. attribute:: opacity Logit-space opacity assigned to each generated Gaussian (logit ~2.0 ≈ alpha 0.88). .. attribute:: base_scale Initial isotropic log-space scale (``exp(-3) ≈ 0.05``). .. attribute:: color Linear-space RGB colour written into the SH DC term. .. py:attribute:: name :type: str :value: 'generator' .. py:attribute:: count :type: int :value: 10000 .. py:attribute:: sh_degree :type: int :value: 3 .. py:attribute:: seed :type: int | None :value: None .. py:attribute:: opacity :type: float :value: 2.0 .. py:attribute:: base_scale :type: float :value: -3.0 .. py:attribute:: color :type: tuple[float, float, float] :value: (1.0, 1.0, 1.0) .. py:method:: generate() -> bundle.gs3d.ply.GaussianCloudArrays :abstractmethod: :async: Produce a :class:`GaussianCloudArrays` from this generator's parameters. .. 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. .. py:class:: CubeGenerator(/, **data: Any) Bases: :py:obj:`bundle.gs3d.generators.base.Generator` Gaussians inside (or on the surface of) an axis-aligned cube. .. attribute:: size Edge length. .. attribute:: center Cube centre. .. attribute:: surface When ``True`` samples lie on the six faces; otherwise inside. .. py:attribute:: name :type: str :value: 'cube' .. py:attribute:: size :type: float :value: 1.0 .. py:attribute:: center :type: tuple[float, float, float] :value: (0.0, 0.0, 0.0) .. py:attribute:: surface :type: bool :value: False .. py:method:: generate() -> bundle.gs3d.ply.GaussianCloudArrays :async: Produce a :class:`GaussianCloudArrays` from this generator's parameters. .. py:class:: RandomCloudGenerator(/, **data: Any) Bases: :py:obj:`bundle.gs3d.generators.base.Generator` Uniform random Gaussians inside an axis-aligned bounding box. .. attribute:: bounds_min Lower corner of the sampling box. .. attribute:: bounds_max Upper corner. .. py:attribute:: name :type: str :value: 'cloud' .. py:attribute:: bounds_min :type: tuple[float, float, float] .. py:attribute:: bounds_max :type: tuple[float, float, float] :value: (1.0, 1.0, 1.0) .. py:method:: generate() -> bundle.gs3d.ply.GaussianCloudArrays :async: Produce a :class:`GaussianCloudArrays` from this generator's parameters. .. py:class:: SphereGenerator(/, **data: Any) Bases: :py:obj:`bundle.gs3d.generators.base.Generator` Gaussians distributed uniformly on (or in) a sphere. .. attribute:: radius Sphere radius. .. attribute:: center Sphere centre in world space. .. attribute:: surface When ``True`` samples lie on the surface; otherwise inside. .. py:attribute:: name :type: str :value: 'sphere' .. py:attribute:: radius :type: float :value: 1.0 .. py:attribute:: center :type: tuple[float, float, float] :value: (0.0, 0.0, 0.0) .. py:attribute:: surface :type: bool :value: True .. py:method:: generate() -> bundle.gs3d.ply.GaussianCloudArrays :async: Produce a :class:`GaussianCloudArrays` from this generator's parameters. .. py:class:: TorusGenerator(/, **data: Any) Bases: :py:obj:`bundle.gs3d.generators.base.Generator` Gaussians on a torus surface in the XY plane. .. attribute:: major_radius Distance from torus centre to tube centre (R). .. attribute:: minor_radius Tube radius (r). .. attribute:: center Torus centre. .. py:attribute:: name :type: str :value: 'torus' .. py:attribute:: major_radius :type: float :value: 1.0 .. py:attribute:: minor_radius :type: float :value: 0.3 .. py:attribute:: center :type: tuple[float, float, float] :value: (0.0, 0.0, 0.0) .. py:method:: generate() -> bundle.gs3d.ply.GaussianCloudArrays :async: Produce a :class:`GaussianCloudArrays` from this generator's parameters. .. py:function:: create_generator(shape: str, **kwargs) -> base.Generator Instantiate a generator for the named shape. .. py:function:: available_shapes() -> list[str] Return the list of registered shape names.