237702c7a8
- rename every numbered example (04/08/10/11/7ep scripts, 12/16/20/21 dirs) to clean names; each example now writes artifacts to its own out/ folder - examples/README rewritten as a category index (part / assembly / reverse engineering / FEM); stale run_examples.py reference removed - flange_plate gains the quickstart FTC part (model.py + external verify.py + README); u_link/ap242/flange demo builders read the new asset paths - ap242_gmsh_volume_mesh gains render_views.py for the demo gallery fix(artifacts): round-trip-stable geometry fingerprint bounds AddOptimal bounds wobble by one shape-tolerance quantum between a fresh shape and the same shape read back from BRep bytes, so definitions sitting on a quantization cell edge failed every package re-validation. Quantize bounds at a fixed 1e-4 mm grid, far coarser than the wobble; full suite green (1503 passed). Stored packages captured before this change must be recaptured.
26 lines
750 B
Python
26 lines
750 B
Python
"""Render the demo gallery views for ap242_gmsh_volume_mesh.
|
|
|
|
Views (demo/build.py gallery): isometric, top, and the mount-hole detail.
|
|
"""
|
|
from pathlib import Path
|
|
|
|
import simplecadapi as scad
|
|
|
|
import model
|
|
|
|
OUT = Path(__file__).resolve().parent / "out"
|
|
OUT.mkdir(parents=True, exist_ok=True)
|
|
|
|
body = model.build_bracket().part.body
|
|
|
|
views = {
|
|
"render_iso.png": dict(view=(30.0, 45.0), zoom=4.0),
|
|
"render_top.png": dict(view=(90.0, 0.0), zoom=4.0),
|
|
"render_detail.png": dict(view=(25.0, 20.0), zoom=9.0),
|
|
}
|
|
for name, kw in views.items():
|
|
path = scad.render_screenshot_rpath(
|
|
shapes=body, output_path=str(OUT / name),
|
|
image_size=(1400, 900), show_legend=False, show_callouts=False, **kw)
|
|
print(f"rendered {path}")
|