Export¶
export
¶
Exporting resolved models: STEP, STL, hidden-line SVG views, shop drawings and the cut list.
svg_view
¶
svg_view(
shape: Shape,
path: Path,
direction: tuple[float, float, float] = VIEW_DIRECTION,
hidden_lines: bool = True,
line_weight: float = 0.5,
)
Hidden-line isometric-ish projection of a shape to SVG, Z up, 1 mm to a unit.
The hidden lines are dotted, or left out without hidden_lines; the
visible ones line_weight mm wide (thicker lines for a small picture).
project_to_viewport() takes the camera position and looks at the shape's
center, so the camera is placed far away from the center along direction.
exploded
¶
exploded(
model: ResolvedModel, factor: float = 0.5
) -> Compound
The parts moved away from the center of the assembly, factor times their distance.
source_hash
¶
A fingerprint of a design's code, to tell when its exports are stale.
export_model
¶
export_model(
model: ResolvedModel,
out_dir: Path,
views: bool = True,
source: Source | None = None,
) -> list[Path]
Write the assembly (STEP, STL), each part (STL) and the cut list to out_dir.
With views, also hidden-line SVG views of the assembly, its exploded
view and each part in its own frame, and shop drawings in drawings/:
a dimensioned sheet per part (one per group of identical parts) and, for
more than one part, the assembly and its parts (see woodwright.drawing),
and the sheets collated in plans.pdf (see woodwright.pdf), with the
design's source in an appendix if given.
meta.json records what made the files: the woodwright version, the
date and, with source, its name and source_hash (e.g. for the docs
gallery to mark exports older than their code).