picogl.renderer.molecular.bond_geometry
Oriented cylinder geometry for a single bond.
Attributes
Classes
Geometry parameters for a cylindrical bond shaft. |
Functions
|
Return cached unit-circle |
|
Return zero-vertex indexed cylinder arrays. |
Module Contents
- picogl.renderer.molecular.bond_geometry._cylinder_ring(segments: int) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]
Return cached unit-circle
(cos, sin, local_indices)for segments.
- class picogl.renderer.molecular.bond_geometry.BondGeometry[source]
Geometry parameters for a cylindrical bond shaft.
Builds an open-sided cylinder between two world-space points. Color is applied by
BondsMesh.- build(start: collections.abc.Iterable[float], end: collections.abc.Iterable[float]) picogl.renderer.mesh_arrays.MeshArrays[source]
Build an oriented cylinder spanning
starttoend.- Parameters:
start – World-space cylinder origin.
end – World-space cylinder terminus.
- Returns:
Positions, radial normals, and indices. Empty when the axis length is below
1e-12.- Return type:
- build_many(starts: numpy.ndarray, ends: numpy.ndarray) tuple[picogl.renderer.mesh_arrays.MeshArrays, numpy.ndarray][source]
Build cylinders for many bonds simultaneously.
Zero-length shafts (axis shorter than
1e-12) are omitted from the returned arrays. The boolean valid mask has one entry per input row.- Parameters:
starts –
(N, 3)world-space originsends –
(N, 3)world-space termini
- Returns:
(mesh, valid)where mesh has no colors
- picogl.renderer.molecular.bond_geometry._empty_bond_arrays() picogl.renderer.mesh_arrays.MeshArrays[source]
Return zero-vertex indexed cylinder arrays.