neu_lib.tube

A skeleton as a solid tube: one truncated cone per edge, from its radii.

Unlike lines, a tube shows calibre, and a radius too large for the body shows up as the tube breaking through the mesh surface. The tube is built in xyz and flipped back, so its triangle winding matches a precomputed mesh; built directly in zyx, the normals would face inward and the surface would render dark, with no error.

Functions

frustum_mesh(vertices_xyz, edges, radii[, sides])

One truncated cone per edge, in xyz; returns (vertices, faces).

skeleton_tube(skeleton[, sides, name]) → neu_lib.mesh.Mesh

A Skeleton as a solid tube Mesh (zyx), from its radii. Raises if

Module Contents

neu_lib.tube.frustum_mesh(vertices_xyz, edges, radii, sides: int = 8)

One truncated cone per edge, in xyz; returns (vertices, faces).

Each edge gets a ring of sides points at each end, at that vertex’s radius, joined by a triangle strip, so the tube tapers linearly between nodes. Rings are perpendicular to the edge. Zero-length edges are dropped. Cones are not stitched at junctions; they overlap, which renders correctly as a solid surface.

neu_lib.tube.skeleton_tube(skeleton: neu_lib.skeleton.Skeleton, sides: int = 8, name: str | None = None) → neu_lib.mesh.Mesh

A Skeleton as a solid tube Mesh (zyx), from its radii. Raises if the skeleton has none.