Skip to main content

Module primitive

Module primitive 

Source
Expand description

Primitive solids.

Built from numbers rather than from existing topology, so their history has nothing to report, but their provenance very much does. Each face gets a role naming which face of the primitive it is (roles), so a reference to “the top of that box” survives the box being rebuilt at a different size. Without it the reference would be to a handle that no longer exists.

Modules§

roles
Roles naming which part of a primitive an entity is.

Functions§

make_box
Build an axis-aligned box in frame, spanning size along each of its axes from the frame’s origin.
make_cone
Build a cone or a truncated cone in frame.
make_cylinder
Build a cylinder in frame: radius about its z, height along it.
make_faceted_solid
A solid from planar rings over shared points, each ring already wound counter-clockwise seen from outside, and its faces in the rings’ order.
make_faceted_solid_with_holes
make_faceted_solid with faces holding holes: each face its outer ring, wound counter-clockwise seen from outside, then a ring per hole, wound clockwise seen from outside, every ring of a face on its one plane. A face’s plane in planes and the errors are as there, every ring of the face counted; a hole names at least three distinct points too.
make_half_space
Build the unbounded solid on one side of a face.
make_hexahedron
A hexahedron: the solid on eight corners laid out like a box’s, whose six faces are planar. The corners come in a box’s order: the four of the bottom face counter-clockwise from the origin corner ((0,0,0), (1,0,0), (1,1,0), (0,1,0)), then the four above them in the same order.
make_parallelepiped
A parallelepiped: the solid spanned at origin by three edge vectors.
make_polyhedron
A convex solid from planar rings over shared points.
make_sphere
Build a sphere of radius centred at frame’s origin.
make_torus
Build a torus in frame: major from the axis to the tube’s centre, minor the tube’s own radius.
make_wedge
Build a wedge: a box whose top face is inset.
torus_face_seamed_at
A whole torus’s face whose seam round the axis is the parallel at tube angle v0 rather than the outer equator: its chart spans [0, 2pi] by [v0, v0 + 2pi], and its seam round the tube is the tube’s circle at longitude zero. The face alone, on frame made right-handed as make_torus makes it.