678058c940
CI / Select checks (push) Has been cancelled
CI / Format and repository checks (push) Has been cancelled
CI / Compile RISC-V (manual) (push) Has been cancelled
Docker / image (push) Has been cancelled
Generated files / Regenerate and commit (push) Has been cancelled
Kernel rig / Select the rig areas (push) Has been cancelled
Lists / Design format changes merge cleanly (push) Has been cancelled
Lists / Lists are sorted one item per line (push) Has been cancelled
Packaging lint / lint (push) Has been cancelled
Pages / build (push) Has been cancelled
CI / Dependency advisories (push) Has been cancelled
CI / Quick compile (push) Has been cancelled
CI / Native Linux Clippy (push) Has been cancelled
CI / Build tests (push) Has been cancelled
CI / Native Linux tests (push) Has been cancelled
CI / GPU path tests (1/4) (push) Has been cancelled
CI / GPU path tests (2/4) (push) Has been cancelled
CI / GPU path tests (3/4) (push) Has been cancelled
CI / GPU path tests (4/4) (push) Has been cancelled
CI / Action matrix (1/16) (push) Has been cancelled
CI / Action matrix (10/16) (push) Has been cancelled
CI / Action matrix (11/16) (push) Has been cancelled
CI / Action matrix (12/16) (push) Has been cancelled
CI / Action matrix (13/16) (push) Has been cancelled
CI / Action matrix (14/16) (push) Has been cancelled
CI / Action matrix (15/16) (push) Has been cancelled
CI / Action matrix (16/16) (push) Has been cancelled
CI / Action matrix (2/16) (push) Has been cancelled
CI / Action matrix (3/16) (push) Has been cancelled
CI / Action matrix (4/16) (push) Has been cancelled
CI / Action matrix (5/16) (push) Has been cancelled
CI / Action matrix (6/16) (push) Has been cancelled
CI / Action matrix (7/16) (push) Has been cancelled
CI / Action matrix (8/16) (push) Has been cancelled
CI / Action matrix (9/16) (push) Has been cancelled
CI / Action matrix determinism (push) Has been cancelled
CI / Property tests (many cases) (push) Has been cancelled
CI / Doc tests (push) Has been cancelled
CI / Reference tests (push) Has been cancelled
CI / Windows D3D12 FXC shaders (push) Has been cancelled
CI / Windows app startup (push) Has been cancelled
CI / ci (push) Has been cancelled
CI / Compile WebAssembly (push) Has been cancelled
CI / Nightly alert (push) Has been cancelled
Kernel rig / Build the CLI (push) Has been cancelled
Kernel rig / Kernel rig (${{ matrix.shard }}) (push) Has been cancelled
Kernel rig / kernel-rig (push) Has been cancelled
Pages / deploy (push) Has been cancelled
25 lines
1.8 KiB
Markdown
25 lines
1.8 KiB
Markdown
# Porting a model into makeCAD
|
|
|
|
For a model that already exists as code (build123d, CadQuery, OpenSCAD) or as STEP. The port is
|
|
done when the makeCAD STEP export matches the source geometry for every parameter value you
|
|
check: `compare_step.py` reports xor at most 1e-3 mm3. Volume, area and centre of mass alone are
|
|
not enough: in one port, a hexagon left at dof 1 changed the volume by 2e-7 of the total and the
|
|
centre of mass by 3e-4 mm, while xor showed 56 mm3 in 96 pieces along the outer walls.
|
|
|
|
1. **Reference geometry in the design's frame.** The makeCAD origin is chosen by trap 1 of SKILL.md, so it
|
|
often differs from the source. Translate the source model to the same frame and export it as
|
|
STEP for each checked parameter value. Pick values that reach every branch of the layout logic.
|
|
2. **Deliberate differences.** Logic that makeCAD expressions cannot hold (conditionals,
|
|
search) gets a closed formula. Check the formula against the source over a wide range of
|
|
values in plain Python first, list where it differs, and apply the formula to the reference
|
|
too (patch the source function), so the comparison stays like for like. Tell the user each
|
|
difference.
|
|
3. **Export and compare.** Add `parameters.change` and `file.export {path, bodies: [name]}` per
|
|
value to a script, run it, then
|
|
`uv run --no-project --with build123d python $SKILL/scripts/compare_step.py actual.step reference.step`.
|
|
The pieces' boxes show where the shapes differ; a pair of pieces on the two halves of one face
|
|
means that face is turned, usually by an under-constrained sketch.
|
|
4. **Freeze the test.** Measure the reference (volume, area, centre of mass, bounding box) and
|
|
put the numbers into the copy of `templates/test_design.py` next to the design. Ask the user
|
|
before removing the source model; git history keeps it.
|