bundle.gs3d.generators.primitives ================================= .. py:module:: bundle.gs3d.generators.primitives .. autoapi-nested-parse:: Procedural primitive generators: sphere, cube, torus, random cloud. Each generator allocates a :class:`GaussianCloudArrays` of the requested size and fills the position, scale, rotation, opacity, and SH DC channels. SH degrees > 0 leave the higher-order ``f_rest_*`` coefficients zero — view- dependent appearance is opt-in for synthetic content. Colours are written into the SH DC term using the same constant the inria-graphdeco reference uses (``C0 = 0.28209479177387814``), so a DC value of ``(c - 0.5) / C0`` reproduces a constant linear colour ``c``. Attributes ---------- .. autoapisummary:: bundle.gs3d.generators.primitives.log bundle.gs3d.generators.primitives.SH_C0 Classes ------- .. autoapisummary:: bundle.gs3d.generators.primitives.SphereGenerator bundle.gs3d.generators.primitives.CubeGenerator bundle.gs3d.generators.primitives.TorusGenerator bundle.gs3d.generators.primitives.RandomCloudGenerator Module Contents --------------- .. py:data:: log .. py:data:: SH_C0 :value: 0.28209479177387814 .. 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:: 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:: 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: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.