Skip to main content

Crate ferrocad_part

Crate ferrocad_part 

Source
Expand description

§FerroCAD Part workbench (ferrocad_part)

The first module built on the document-object SPI. It registers two things with ferrocad_core:

  • Part::Feature — an object type with a Shape and a Placement, via ferrocad_core::object_registry::ObjectType;
  • Part::Fillet / Part::Chamfer — parametric dress-up features whose execute resolves their selected edge names through the base shape’s lineage first and the backend’s positional names second, expands them to tangent chains, and writes the rebuilt shape to their output Shape;
  • Part::PropertyPartShape — a property value type holding a ferrocad_geom::Shape, via [ferrocad_core::extension];
  • Part::PropertyTopoShapeList — the list counterpart, holding an ordered Vec<Shape> (upstream PropertyTopoShapeList).

Part depends only on the seam (ferrocad_geom), never on a concrete kernel: the application composes it with one — ferrocad_part::register(Arc::new(OcctBackend::new())). That is what lets the kernel be replaced (or swapped per edition) without touching Part, and keeps ferrocad_core geometry-agnostic. See docs/architecture/occt-integration.md.

§Building

The library needs no kernel. Its tests use OCCT through a dev-dependency, so they still need OCCT 7.8+; the crate is not a default member.

Re-exports§

pub use ferrocad_curves;

Structs§

ShapeListProperty
A list of kernel shapes, held as a Property::Extension (upstream Part::PropertyTopoShapeList).
ShapeProperty
A shape-valued property.

Enums§

ResolveElementError
Why a stored sub-element name could not be turned into a kernel sub-shape.

Constants§

BOX_TYPE
Part::Box: a parametric box (Length × Width × Height).
CHAMFER_TYPE
Part::Chamfer’s registered type id.
COMMON_TYPE
COMPOUND_TYPE
CONE_TYPE
Part::Cone: Radius1 at the base, Radius2 at Height, along the placement’s Z axis.
CUT_TYPE
CYLINDER_TYPE
Part::Cylinder: Radius × Height, growing along the placement’s Z axis.
FILLET_TYPE
Part::Fillet’s registered type id.
FUSE_TYPE
MULTICOMMON_TYPE
MULTIFUSE_TYPE
REGULAR_POLYGON_TYPE
Part::RegularPolygon: a closed wire of Polygon edges at Circumradius.
SHAPE_LIST_TYPE_NAME
The registered type name of the shape-list property.
SPHERE_TYPE
Part::Sphere: a sphere of Radius centred on the placement’s base.
TYPE_NAME
The registered property type name.

Functions§

backend
The injected geometry backend.
make_box
A convenience box from the injected backend (what a script’s Part.makeBox calls).
make_shape_list_property
Wrap a ShapeListProperty as a Property::Extension value.
make_shape_property
Wrap a ShapeProperty as a Property::Extension value.
register
Compose Part with a geometry backend and register its types. Idempotent; an application calls this once at startup with the kernel it wants.
resolve_element_in
Resolve name against shape, consulting lineage first.
shape_list_of
Borrow the ShapeListProperty inside property, if it is one.
shape_of
Borrow the ShapeProperty inside property, if it is one.