(guide-primitive-catalog)= # Primitive catalog ```{include} ../_guide-sidebar-compiler-membership.md ``` Every OpenVCAD design starts from **leaf nodes**: the primitives at the bottom of the tree that define geometry. This page shows each one with a render, a link to its Python API entry, and the example script it came from. Where a primitive has more than one useful form, use the arrows on its image to step through them. Leaves combine with booleans, transforms and the other operations in this section, and each one carries attributes like any other node. If those are new to you, start with [Getting Started](../introduction/getting-started.md). Every example lives in `examples/geometry/` and runs on its own. ## Basic solids ::::{container} openvcad-catalog :::{container} openvcad-catalog-card {py:class}`~pyvcad.RectPrism` A box from a center and size, or from two corners with `RectPrism.FromMinAndMax`. [rect_prism.py](../../../../examples/geometry/rect_prism.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Sphere` [sphere.py](../../../../examples/geometry/sphere.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Cylinder` Always upright along Z; wrap it in `Rotate` to tip it over. [cylinder.py](../../../../examples/geometry/cylinder.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Cone` Tip at the origin, opening along -Y. The angle is the half-angle in radians. [cone.py](../../../../examples/geometry/cone.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Torus` Lies in the XY plane, centered on the origin. [torus.py](../../../../examples/geometry/torus.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Strut` A rod between two points: a capsule, or a tapered rod with a sphere, hemisphere or flat cap at each end. [strut.py](../../../../examples/geometry/strut.py) ::: :::: ## Implicit functions ::::{container} openvcad-catalog :::{container} openvcad-catalog-card {py:class}`~pyvcad.Function` Any implicit surface from a [math expression](../fields/math-expressions.md) or a Python callable, cut to a bounding box. [function.py](../../../../examples/geometry/function.py) ::: :::: ## Profiles, curves and text These leaves build solids from 2D outlines and 3D curves. [Curves, profiles and sweeps](curves-profiles-sweeps.md) covers them in depth, including grading material along a path. ::::{container} openvcad-catalog :::{container} openvcad-catalog-card {py:class}`~pyvcad.Text` Extruded text in a system font, on one or more lines. [text.py](../../../../examples/geometry/text.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.PolygonExtrude` A prism from a list of coplanar 3D points. [polygon_extrude.py](../../../../examples/geometry/polygon_extrude.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.PolygonRevolve` A solid of revolution from 3D points, about any axis. [polygon_revolve.py](../../../../examples/geometry/polygon_revolve.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Extrude` A 2D `Profile` lifted from its sketch plane, with optional draft, twist and a wall offset law. [extrude.py](../../../../examples/geometry/extrude.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Revolve` A 2D `Profile` spun about an axis in its sketch plane (Z by default), fully or through part of a turn. [revolve.py](../../../../examples/geometry/revolve.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Sweep` A 2D `Profile` carried along a 3D curve, with optional scale and twist along the way. [sweep.py](../../../../examples/geometry/sweep.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Loft` A blend between 2D `Profile` sections at chosen heights, even between different shapes and topologies. [loft.py](../../../../examples/geometry/loft.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.Tube` A round section along a curve, with rounded or flat ends. The radius can vary along its length. [tube.py](../../../../examples/geometry/tube.py) ::: :::: ## Lattices ```{tip} **Building a lattice? Start with the [Metamaterials](../metamaterials/index.md) guides.** The `pyvcad_metamaterials` package builds TPMS, strut, plate and stochastic lattices, fills parts with them, grades them, and maps them onto curved surfaces. The [TPMS and lattice catalog](../metamaterials/catalog.md) shows every built-in cell. ``` The two leaves below are lower level. They describe a beam lattice one beam at a time, written by hand or read from a 3MF file. Reach for them when you already have explicit node and beam lists, such as a lattice designed in another tool. ::::{container} openvcad-catalog :::{container} openvcad-catalog-card {py:class}`~pyvcad.BeamLattice` Beams indexed into one shared vertex list, with optional tapering and balls at the nodes. [beam_lattice.py](../../../../examples/geometry/beam_lattice.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.ThreeMFBeamLattice` A lattice imported from a 3MF file that uses the Beam Lattice Extension. See [Importing 3MF beam lattices](../imports/3mf-beam-lattice.md). [three_mf_beam_lattice.py](../../../../examples/geometry/three_mf_beam_lattice.py) ::: :::: ## Imported and sampled geometry These leaves bring in geometry made elsewhere. The [Imported geometry](../imports/index.md) section covers them in more detail. ::::{container} openvcad-catalog :::{container} openvcad-catalog-card {py:class}`~pyvcad.Mesh` A closed triangle mesh from a file or a `SurfaceMesh`, converted to a signed distance field. [meshes/3D_benchy.py](../../../../examples/geometry/meshes/3D_benchy.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.TexturedMesh` A colored 3MF or OBJ model; this one is an OBJ with an image texture. Its colors become a `COLOR_RGBA` field. See [Importing textured solids](../imports/textured-mesh.md). [textured_mesh/02_bison_texture.py](../../../../examples/geometry/textured_mesh/02_bison_texture.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.CAD` A STEP or IGES solid. See [Authoring CAD with CadQuery](../imports/cadquery.md). [cad/bracket_import.py](../../../../examples/geometry/cad/bracket_import.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.SignedDistanceField` A distance or occupancy grid from an OpenVDB file or grid. The render compares an original part with copies rebuilt at three smoothing levels. [signed_distance_field/vdb_roundtrip_smoothing.py](../../../../examples/geometry/signed_distance_field/vdb_roundtrip_smoothing.py) ::: :::{container} openvcad-catalog-card {py:class}`~pyvcad.SurfaceReliefVolume` Raised relief on a selected patch of a mesh or CAD surface, from an image or a function. See [Physical surface relief](surface-relief.md). [surface_relief/functional_wave_relief.py](../../../../examples/geometry/surface_relief/functional_wave_relief.py) ::: ::::