picogl.core.geometry ==================== .. py:module:: picogl.core.geometry .. autoapi-nested-parse:: Pure geometry helpers. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/picogl/core/geometry/sphere/index Attributes ---------- .. autoapisummary:: picogl.core.geometry.sphere_mesh Classes ------- .. autoapisummary:: picogl.core.geometry.SphereGeometrySpec picogl.core.geometry.SphereMesh Functions --------- .. autoapisummary:: picogl.core.geometry.generate_ring picogl.core.geometry.iter_longitudes picogl.core.geometry.latitude_for_stack Package Contents ---------------- .. py:class:: SphereGeometrySpec Parameters controlling sphere mesh generation. This is configuration only: it does not build geometry. Pass an instance to :class:`SphereMesh`. .. py:attribute:: radius :type: float :value: 1.0 .. py:attribute:: slices :type: int :value: 16 .. py:attribute:: stacks :type: int :value: 16 .. py:class:: SphereMesh(spec: SphereGeometrySpec) Build origin-centered sphere geometry from a :class:`SphereGeometrySpec`. Derived vertex and index counts live here so the spec stays parameters only. :meth:`build` returns colorless :class:`~picogl.renderer.mesh_arrays.MeshArrays`. .. py:attribute:: spec .. py:property:: vertices_per_item :type: int Number of vertices in one sphere instance. .. py:property:: elements_per_item :type: int Number of triangle indices in one sphere instance. .. py:method:: build() -> picogl.renderer.mesh_arrays.MeshArrays Build a sphere template centered at the origin. :return: Positions, normals, and indices with no colors .. py:function:: generate_ring(radius: float, latitude: float, slices: int) -> list[picogl.core.vec3.Vec3] Vertices on one latitude circle of a sphere centered at the origin. .. py:function:: iter_longitudes(slices: int) -> collections.abc.Iterator[float] Yield longitude angles for each slice (including closure vertex). .. py:function:: latitude_for_stack(stack: int, stacks: int) -> float Latitude in radians for stack index ``stack`` in ``[0, stacks]``. .. py:data:: sphere_mesh