- blend garbage-volume assertion checks the contract (kernel returned
more material than the 1000 input) rather than the macOS-specific
1036 value; Linux OCC reports ~1039 for the same r=6 fillet
- sca init shell-integration test pins SHELL=/bin/zsh; the .zshenv
target follows SHELL (or an existing .zshenv), and CI runs bash
test_render_screenshot_multiview patched _render_polydata_views, which
after the prepare/execute split is only the synchronous wrapper used by
the STEP inspection path; the SDK screenshot path now enters the grid
engine at _prepare_polydata_render.
The evidence render ran on a daemon thread that imported VTK and, on
non-macOS, executed in-process GL — a native crash there killed the whole
process mid-test-suite (observed on CI), and under load the 15s budget
turned into silently missing evidence.
The screenshot pipeline now splits into prepare (validate + tessellate,
main thread) and execute (render plan: in-process or crash-isolated
worker subprocess). The diagnostic evidence channel prepares on the
calling thread and always executes worker_isolated, so its daemon thread
only ever orchestrates a subprocess.
A render that cannot finish within its budget now reports a named
'render-unavailable' evidence entry instead of vanishing; the budget is
tunable via SCA_DIAGNOSTIC_RENDER_BUDGET (tests: 60s, default: 15s).
Also updates two addon tests to the 2.1.3 runtime-state contract:
remove deletes three recorded locations (payload, skill, runtime dir)
and effective_command takes runtime_dir.
The wheel force-includes the uncompiled docs/skill source tree and
skillproj.toml as package resources; compilation happens at install
time on the user's machine, so no repository checkout is needed.
The compiler moves to simplecadapi.skill.compiler; tools/skillbuild.py
stays as the maintainer-side wrapper over the same code.
'sca skill install' compiles into <skills-dir>/simplecadapi (location
resolved through the existing addon config/env chain, default
~/.agents/skills; no sca init required) and refuses to overwrite
without --force, which only permits replacing a directory whose
SKILL.md declares the same skill name.
- simplecad-cache/simplecad-export entry points are gone (hard cut):
the same commands live under the unified dispatcher
(simplecadapi.cli) as 'sca cache ...' and 'sca export ...', each
group registered at parser level so per-group --help works
- sca init now wires the shell by default (--no-shell skips): a
~/.sca/bin/sca shim (Windows sca.cmd) execs the installing venv's
console script — the venv bin itself never goes on PATH — and the
shim dir lands on PATH via a marked, removable block in ~/.zshenv
(read by non-interactive shells, so agents see the command),
~/.bashrc, fish conf.d, or the Windows user PATH registry value
with a change broadcast; rc files are created only for the login
shell or when they already exist; re-running init refreshes the
shim (target discovery is symlink-safe, no resolve() out of venv)
- addon/cache/export cli modules expose configure(subparsers) +
_execute(args); module run() keeps the CLI-shaped argv
- docs: sca namespace across evergreen docs, shell-integration
section, 'never writes shell profiles' contract line retired
- tests: +17 (dispatcher groups, shell integration, entry-point
absence); cache/export suites moved to group-token argv
- 'sca init' replaces 'sca addon init' (init configures the machine, it
is not an addon operation); guidance text, config comment, and docs
follow; the 2.1.3b1 changelogs keep the historical command name
- version 2.2.0 -> 2.1.3b3 (pyproject + uv.lock)
- local installs ignore virtualenvs and tool caches (.venv, venv,
.pytest_cache, .mypy_cache, .ruff_cache, .tox): a real addon checkout
carried a full .venv straight into the addon home
- validated end to end against sca-connectors-addone 0.6.0: prerelease
compat floor parses, git-origin name consistency passes, probe runs
through command_prefix in the final installed layout, use dispatch
exports SCA_ADDON_DIR, update re-probes after wiping a provisioned
.venv (loud FAILED warning, non-blocking)
- standard: repository name == [addon].name == SKILL.md frontmatter name,
enforced at add/update (GitHub repo slug, or local git-origin basename
falling back to directory name); skill dirs install as sca-<name>
without doubling a leading sca-
- [runtime].command_prefix (optional): shell prelude joined in front of
check_cmd and every use dispatch; single {addon_dir} placeholder,
unknown placeholders rejected at descriptor load
- sca addon use NAME [CMD...]: run cmd inside the addon's declared
environment (SCA_ADDON_DIR exported, exit code propagates, --capture
for programmatic output); bare 'use NAME' reports prefix + dir
- runtime probe now executes AFTER the payload is committed, in the
final installed layout, so prefixes referencing {addon_dir} resolve;
failing probe remains a loud non-blocking warning
- use argv is shell-quoted per element so quoted args survive sh -c
- docs: descriptor reference, naming standard, use; SDK 2.1.2 -> 2.2.0
- tests: 12 new (descriptor prefix validation, name consistency, use
flows, prefixed probe); addon suites 73 green
P1 family 5 (sweep/loft): open-wire profiles now report the measured gap
(endpoint pair, distance, chain count) instead of a bare closedness
complaint - extrude_rsolid and make_face_from_wire_rface raise points
rewired through diagnose_open_wire (endpoint-pairing union-find, tolerance
scaled to wire extent; a lone segment reports its own length as the gap).
Kernel loft failures (loft_rsolid + loft_rshell, which report a wordless
'build did not complete') get a section compatibility verdict: coincident
consecutive stations (the empirically dominant cause), edge-count
mismatch, open section wires, and backtracking station order, with a
per-station S1..Sn inventory (edges/closure/planarity/centroid).
Wire evidence renders through a new 2D plan schematic
(render_wire_plan_evidence): the 3D VTK pipeline cannot mesh bare wires
('no renderable triangles'), so edges are parameter-sampled to
polylines, PCA-projected onto the best-fit plane, and drawn matplotlib -
same ink/palette language as the sketch diagnostics. Open-wire evidence
highlights the two gap-end edges and pins P1/P2; loft evidence
highlights the implicated stations.
Family 6 audit conclusion recorded in the review table: knot uniqueness
and trim bounds are already guarded, offset_wires was never implemented;
the one real gap (bspline fit silent garbage exit) needs curvature
probes and stays queued as mechanism-E work.
Error-language contract regression: test_error_harness pins English-only
error text (CJK masked in technical details) - all Chinese repair lines
from this branch's earlier rounds are translated to English, figure text
stays ASCII (DejaVu has no CJK glyphs), each new family test pins a
CJK-free assertion, and the legacy extrude guidance test now asserts the
structured gap contract (gap == 1.0 for a single open segment).
Full suite 1858 passed, 5 skipped; ty clean on changed modules.
P1 family 7 (assembly solve): the solver's five strict raise sites emitted
one-line ValueErrors that discarded the residual and connectivity data
already in hand. Residual failures (forwarded + final pass) now carry
measured translation/angular errors against both tolerances, a
per-constraint inventory (exceeded/ok with numeric deltas), and a
worst-first repair that targets connector frame definitions instead of
component placements, plus the closed-loop overconstraint escape (break
the loop or solve it inside a subassembly). Structural failures
(unresolvable loop / no grounded path / unsolved components) carry the
connectivity verdict as inventory (grounded/reachable/unsolved with
constraint-reference counts). The public wrapper surfaces them unchanged
via the SimpleCADError passthrough.
P1 family 8 (render export): the zero-hit highlight_tags guard now lists
the tags actually available on the shapes (solid + face level, capped at
24 + count row), so the typo question is answerable from the error
itself; _RenderTagMismatch promotes the payload to what_happened
(mechanism-A surgical promotion).
Tests: 3 assembly cases (15 mm residual asserted, connectivity verdict,
wrapper passthrough) + 1 render guard case (missing + available tags in
the headline). Full suite 1852 passed, 5 skipped; ty unchanged.
P0 family 4 (sketch solve): Sketch.solve's two bare ValueErrors replaced
by structured diagnosis. The solver already names failing constraints;
they now surface as measurements (constraint/entity/DOF counts, failed
constraint values), inventory rows (failed / near miss = direct conflict
partners sharing target entities / ok), parameterized repair (conflict
pairs named; dimension-type constraints relaxed before geometric ones),
and a 2D matplotlib schematic following the diag_png pattern (implicated
entities orange, related purple, failing constraint ids badged at their
first target; extents include circle/arc/ellipse extremes; single view
- planes have no occlusion). New module sketch_diagnostics.py sits
beside sketch.py importing only errors (operators must never be imported
from the sketch layer). SimpleCADError subclasses ValueError so legacy
handlers keep working; raise_harness_error passes it through untouched,
so inspect/wire-promotion paths surface the payload intact.
Mechanism E (blend exit check): fillet/chamfer may only remove material
on convex edges - observed: all-edge r=6 on a 10-cube 'succeeds' with
volume 1036.35 > 1000. assert_blend_volume_monotonic names it at the
exit; BlendVolumeViolation leads what_happened (kernel refused vs kernel
lied) with probe diagnosis appended. Concave edges legitimately add
material (bolt underhead fill = quarter-circle deficit x circumference,
verified +1.28 mm^3) so the increase check requires a provably all-convex
selection via a new side-probe convexity test (n_a - n_b lands in
material iff concave; the bisector probe is 90/270-blind).
Tests: 8 sketch cases (text axiom, pixel-verified render, ValueError
compatibility, passthrough) + 3 mechanism-E cases (r=6 garbage caught,
legit fillet passes, concave-edge regression). Full suite 1848 green,
ty unchanged from baseline.
Three user-ruled corrections to the evidence renders:
- Highlighted edges are CRISP LINES, not marker cylinders: the render
core already had an unused highlighted_edge_groups line-actor channel
(4.5 px colored lines exactly on the edge); it is now exposed as the
public render_screenshot_rpath(highlight_edges=...) parameter and used
by every blend/QL diagnosis. No marker geometry covers the model.
- Evidence views are FOUR AXONOMETRIC positions (30 deg elevation,
azimuth 45/135/225/315), not one iso plus three orthographic panels
and not a single view: a highlighted feature hidden behind the model
in one iso is visible in another (the demo's back-most edge was fully
hidden in the previous single view).
- Edge ink is bolder in diagnostics (edge_width_scale 0.0035) and
highlight lines outweigh it (8 px). Boolean operand evidence drops
leader-line callouts: solid-tag anchors sit inside the solids and
occlusion re-anchoring can land on the face nearest the OTHER
operand, making the label point at the wrong body — legend colors and
the caption carry the mapping instead.
Diagnostic renders stay supersample=1 (fixed-width lines don't need
SSAA; keeps the 15 s watchdog comfortable). 1837 passed, 5 skipped.
The evidence renders were geometrically correct but visually useless:
marker tubes rendered in the same gray as the model. Evidence now drives
the render's highlight channel — tagged faces/solids get palette colors,
a legend, and callout labels:
- fillet/chamfer: the failing edge is a thick orange tagged tube
("failing edge" legend + callout). Two latent marker bugs fixed on the
way: a wrong relative-import depth and a missing TopoDS.Vertex_s cast
had silently killed every marker (and the edge_start/edge_end
measurements) behind the best-effort guard.
- boolean: the two operands render as tagged wrapper copies in
orange/purple — the user's own objects are never tagged (verified by
a pollution test).
- QL: matched faces highlight orange, up to three near-miss faces
purple, on a wrapper copy of the scope; matching is by kernel IsSame,
not Python shape ids (which differ across wrapper copies).
Highlight visibility is asserted at the pixel level (palette-color
sampled pixel counts), not by eyeballing. 1836 passed, 5 skipped.
Fillet/chamfer failures classify at raise time against the accumulated
degeneration catalog (repo history + OCC ecosystem): sliver edges in the
selection, tangent adjacent faces (dihedral probe via surface projection
— a G1 junction has no corner to blend for any size), blend size vs face
room (boundary-inclusive: r == room degenerates the strip, empirically
verified on a bore mouth where OCC accepts r=5 but fails at r=6 == the
6 mm annulus), partially selected smooth chains on periodic faces (the
boolean-seam split), crowded/mixed-convexity corner vertices, and the
2x-size tangency-critical interaction. Generic corner-blend conflict
goes last so specific explanations win; three same-convexity edges at a
box corner are routine and no longer shadow them.
QL cardinality violations now raise structured errors carrying the
selection-trust contract: an inventory (hit + near_miss with surface
parameters and axial spans, so split pieces of one surface stay
distinguishable in text), logical-surface grouping (faces on one
underlying quadric are one logical face the kernel split — pieces need
not be adjacent), parameterized repair naming the group, and one
rendered evidence view with boundary rods outlining the matched faces.
Symbol numbering follows the candidate enumeration so text and image
share one naming.
1835 passed, 5 skipped; ty clean on changed modules.
Benchmarking the failure path surfaced two defects:
1. Nearest-disjoint-PAIR reporting misattributed failures: two operands
not touching each other may still be transitively connected through
a third, so the ring case reported an internal 2.29 mm pair instead
of the real 7.8 mm hub-to-ring separation. Diagnosis now unions
touching operands into clusters (gap <= tol) and reports the nearest
inter-cluster pair; a single cluster that failed to fuse reports the
touch-without-overlap pair as non-manifold contact. Beyond the pair
probe cap it reports nothing rather than guess.
2. Evidence rendering was unbounded on the failure path: the render
worker allows 180s x 6 attempts, and identical agent retries re-paid
~5s each. Diagnostic renders are now downgraded single-view, deduped
per failure signature (same unmoved gap renders once per process),
and abandoned after a 15s watchdog — the error always goes out
immediately, measurements first (text axiom).
Failure-path costs after this: probes 4 ms (2 small solids) to 86 ms
(70-face plate) on top of the kernel's own failed attempt; evidence
render ~5 s once per distinct failure, ~15 ms on retries.
ErrorGuidance gains measurements / evidence / repair / inventory; every
measurement renders into the error text (text axiom), rendered evidence
images land next to the part-cache root and their paths appear in the
text. Legacy call sites emit byte-identical output while the new fields
are empty.
Boolean union/cut/intersect failures now classify at raise time:
disjoint operands report the exact min gap, closest points, closure
vector, and an operation-specific parameterized repair; edge/vertex/
tangent-only contact is distinguished from positive-volume overlap via
an intersection-volume probe. Evidence rendering is default-on for
failures (SCA_NO_DIAGNOSTIC_RENDER to disable); the test suite opts out
in conftest with dedicated render tests opting back in.
SimpleCADMessageError now keeps the display message separate from the
programmatic .message attribute (ArtifactValidationError str() had
drifted; 6 suite failures traced to match= assertions on it).
1825 passed, 5 skipped.
Reported by the OmniSim evaluation of the public u-link example
(2026-09-11): pip install + export.py on Windows died three times in
the build layer before any geometry was built.
- Binary-mode opens: every byte-exact os.open site now sets O_BINARY
via _internal/os_compat.with_binary_flag. autocrlf=true clones read
builder sources in text mode, stripped CR, and aborted with a false
file_input_changed (25579-byte u_link.py read back as 25092); the
same hazard expanded LF on cache writes and would corrupt CAS
hashes. Sites: build/dependencies.py, artifacts/feature_graph.py,
scene/archive.py, cache/store.py (object/record writes, lock
create), artifacts/interface.py (lock create).
- Directory fsync is POSIX-only: os.open(<dir>)+fsync raised
PermissionError on Windows in cache/store.py and
artifacts/interface.py; both now no-op off POSIX via one helper.
- Stale-lock recovery by evidence: a lock whose recorded owner pid is
provably dead is recovered immediately (unreadable owners still wait
out the age gate, live owners are never broken). Windows liveness
probing uses OpenProcess/GetExitCodeProcess — os.kill(pid, 0) maps
to TerminateProcess there and kills the process being probed.
- Console hardening at import: non-UTF strict streams are reconfigured
to backslashreplace so a cp1252 console cannot raise
UnicodeEncodeError from a diagnostic print inside an error handler
and mask the real failure.
- .gitattributes: byte-exact by default, LF pinned for text formats,
so builder-source digests stop depending on core.autocrlf.
Tests: test_os_compat.py (15) + dead-owner immediate recovery in
test_cache_store.py; full suite 1799 passed, 5 skipped. ty: zero new
diagnostics.
Add the drawing inspection namespace and its parser, calibration, section and
independent acceptance dependencies on the current dev architecture.
Protect input BREP during material fusion and sectioning. Bind dimensions,
annotations and visual reviews to source identities and measured geometry.
Connect the workflow and generated API docs to all seven skill build targets.
Make standalone verifier tests work with the pytest console entry point.
Validation: 186 drawing, documentation, skill-target and public API tests;
16 non-render BREP query tests; compileall and skillbuild --check.
- @scad.part/@scad.assemble anchor defaults to the builder script's own
directory: cache + interface state land beside the source, standalone
scripts run anywhere, and the pyproject.toml walk-up requirement is
gone (explicit project_root still relocates the anchor)
- file_input() paths resolve relative to the anchor; in-repo examples
rewritten to script-relative declarations
- HistCAD translator emits keyword-form sketch-family calls (corpus
self-documentation), pinned by tests; booleans stay positional by
*solids signature
- both translators emit project_root=Path(__file__).parent explicitly;
examples/histcad_demo regenerated (STEP volume reconciliation held)
- FTC convention documents @scad.part parameters and the cache contract
- version stamps 2.1.2 + bilingual update notes
All sketch-family calls emitted by the translator now pass every argument
by keyword — add_point/add_line/add_circle/add_arc, constrain_* (via a
per-kind parameter-name table), and the face/wire promotions — so the
parameter meaning is legible from the corpus itself. The only exception
is the boolean *solids varargs (union/cut/intersect), which have no
parameter names to take.
Also fixes an f-string trap the keyword pass exposed: a conversion
(`!r`) applies to the whole conditional expression, silently quoting the
numeric branch of value formatting (constrain_radius value='32.4' →
solver TypeError); formatting now goes through a helper.
New corpus pin: generated sources contain no positional sketch-family
calls. Full regeneration reconciles at the same precision as before
(washer 1.6e-16, wheel 4.6e-16, rarray 0.0; pulley 5/5 sketches riveted).
Capture previously lived per emission call site (plain profiles, sweep
paths) — the taper loft sections and countersink cones built their
SketchScripts directly and silently bypassed snapshots and constraint
recovery, which is why pulley's extrude-3 carried constraints while its
two taper blocks did not.
SketchScript.render is now the one capture point: it fires the replayer
sink (block-context stamping, snapshot collection, constraint recovery)
and appends the sink's constraint lines after the entities. Every
construction site — profiles, loft/taper sections, countersink cones,
sweep paths, and pattern seeds (whose loop-expression plane header is
supported via render(header=...)) — is captured by construction; no call
site remembers anything. emit_profile_sketch reverts to pure formatting
(sink forwarded, snapshot return removed).
Pulley now reports 5/5 sketches riveted (taper sections included) and
wheel 2 sketches (pattern seed captured; the 63-point outline still
degrades to timeout). New tests pin the invariant: the pulley taper
blocks carry section constraints, and a SketchScript sink fires exactly
once per render. Real pulley trace baked as a fixture.
Adds the auto-constraint discovery and extraction layer discussed for the
CadQuery pipeline, as a source-agnostic capability:
- every translation now writes <stem>.sketches.json: per-block planar
sketch snapshots (plane frame + typed entities in local coordinates +
closedness) — the schema-facing interface any front-end can emit.
- cqftc/constraints.py implements the recovery axioms: candidates are only
snapshot-entailed relations (P2); admission is the production SolveSpace
solver's DOF drop with redundancy-introducing candidates rejected — the
DOF counter alone is fooled by rank-deficient systems (P3); a riveted set
must also pass the perturbation basin test, a jittered rebuild converging
back onto the snapshot (P1); measured values emit verbatim (P4); ids
carry the inf<N>_<Kind> provenance prefix (P5).
- candidates run in an intent-typicality ladder (anchor, H/V, parallel/
perpendicular, tangency/equal/concentric, lengths/radii, orientation,
adjacent angles, half-grid distances) under per-tier and global solve
budgets; sketches above 24 entities recover in a subprocess worker with a
wall-clock escape hatch because SolveSpace's redundancy analysis can
explode combinatorially on large freeform outlines.
- cadquery_to_ftc.py --constraints on emits the recovered sets inline
between sketch entities and promotion; results graded riveted/partial/
timeout in the meta sidecar; --constraints off output is byte-identical
to before.
- fixtures: hexagon/washer/revolve-ring/slot sketches rivet with canonical
human-shaped sets (e.g. hexagon = fix + 2H + 2 parallel + 3 equal-length
+ length + signed dx + 60 deg) and constrained builds still reconcile at
machine precision; the 63-point wheel outline honestly degrades to
timeout. 22 tests, ty clean.
Sign-convention traps fixed along the way: distance_x value is signed
(b - a); emitting abs() pulled a rank-complete hexagon onto a mirrored
branch (caught by the coords-reconciliation gate).
Port the runtime-tracer half of PR #30 (feat/cadquery_converter) and rewrite
its emission layer to the current Feature Tree Convention, following the
tools/research/histjson four-stage pattern (trace / translate / validate /
profile + responsibility wall: the translator only translates).
- tracer/ (instrument, fingerprint, cq_runner, worker) ported near-verbatim:
runs under .venv-cq (Python 3.11 + cadquery 2.8); records resolved plane
frames, serialized args, selector strings, and geometric fingerprints of
actually-selected faces/edges plus ground-truth volume/bbox per program.
- emission rewritten for FTC: block headers with closed role vocabulary and
no positional slugs; transcribed planar profiles authored through the
sketch API (local coords, pooled points, three-point arcs via
circumcenter) annotated profile=geometry; booleans in list form over a
histjson-shaped bodies dataflow; fillet/chamfer/shell selections
synthesized as QL predicate bands from trace fingerprints with
take/exactly cardinality; through-cut depths derived from the trace
bbox; zero in-source verification; literal numbers only.
- unknown ops become untranslated notes, never silent drops; static-AST
path and exploratory scoring/edit-bench from the PR intentionally not
ported.
- directory named cadqueryftc so it can never shadow `import cadquery`.
- fixtures are real traces captured with cadquery 2.8; 13 tests pin format
contracts + volume reconciliation (all four reconcile at <=2.2e-12 rel
err) with no cadquery required in CI; full test/ suite 1516 passed.
- 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.
Float frames re-normalized on every Placement reconstruction, so
canonical JSON bytes and content hashes drifted across save/load cycles
(connector interface_hash mismatch, unstable PartInstance placement
identity, spurious cache/dirty misses).
Store every hashed/persisted frame as exact integer ticks at 1e-9
resolution instead:
- placement.py: placement_ticks / validate_placement_ticks (pure integer
unit-orthogonal-handedness checks) / placement_from_canonical with a
from_exact_frame constructor that keeps durable components verbatim;
tick frames short-circuit re-quantization; placement_frame_mm exports
millimetre floats for translators
- ConnectorInterface.local_frame and PartInstance.placement store ticks;
definition content hashes are byte-stable across round trips
- solved snapshots, authored placements, assembly state, solve keys and
component cache payloads compare tick-to-tick; rebuilds reuse
from_exact_frame so verification is exact instead of tolerance-based
- occurrence-graph transforms and scene product ingestion convert ticks
at the runtime boundary only
- FreeCAD runtime and Fusion360/SolidWorks translators convert recorded
tick frames back to millimetre floats when emitting target payloads
Derived z_axis is authoritative (computed once at write time) and is
never recomputed on read. BREP/zip/package integrity checks remain
strict byte hashes. Existing pre-tick packages must be recaptured;
examples/22_mecanum_wheel was rebuilt and revalidated.
Fixes 'flange shows no labels': callout anchors used face centers of mass,
which for annular/toroidal faces (both fillet tags) lands on the rotation
axis INSIDE the solid — occluded from every view, so the labels pointed at
nothing. Callouts now carry their tagged surface as re-anchor candidates
(referenced through the dataset channel so the macOS worker can serialize
it) and each panel admits them via a deterministic geometry pass:
- _view_ray_occluded: parallel-projection-safe ray test against a cell
locator built over base + highlight surfaces (surface tolerance scales
with model span so anchors resting on their own face pass)
- occluded anchors re-anchor to the nearest visible sampled point of the
SAME tagged surface (lateral screen distance + depth-weighted); a callout
whose whole region is hidden in a panel is suppressed there — a label
pointing at empty space is worse than no label
- flange review after fix: both fillet labels visible, leaders land on the
actual fillet geometry, 10/10
- tests: front/back face tags of a box — labels must appear from the side
that sees them (callouts-on differs from callouts-off per view)
- fixes caught by ty along the way: SCREENSHOT_VIEWS referenced but only
defined in operators/features (latent NameError on the internal auto
path; the constant now lives in the engine, features re-exports lazily
via module __getattr__) and callout tuple annotations extended to the
optional candidate element
- 32/32 render+integration tests
Design ruling: exactly one way to produce annotated multi-view renders.
- render_screenshot_rpath always routes through the multi-view grid
engine: view='auto' = the default four-view set, an explicit preset
name or (elevation, azimuth) pair = a single full-frame panel, views=
accepts up to four (elevation, azimuth, label) triples (more are
rejected). The separate single-view code path is deleted (engine,
worker 'sdk' mode and its dispatch), along with the studio-vs-grid
rejection contract
- style defaults to 'studio': the default output is now a black-stage
four-panel grid with camera-derived three-point lighting per panel,
tubed edge ink, supersampling and light-on-dark labels/legend;
style='standard' remains the explicit flat diagnostic look
(render_shape_views_rpath pins standard to keep its inspect semantics)
- zoom applies to single-panel renders; view_up applies to every panel
- framing parity verified at pixel level: single-panel studio through
the new path matches the deleted single-view path output (mean diff
0.59, 1.38% pixels), so render_showcase.py and existing studio assets
are stable
- tests: >4 views rejected, explicit view routes through the grid
engine as one panel, default style is studio (differs from explicit
standard), real-render assertions made behavioral instead of size
thresholds; 31/31 incl. integration suite; API doc regenerated
Closes the edge-crispness gap against the three.js viewer; the single-view
standard style now matches its 'light metal + dark ink' look (8/10 vs 9/10
in side-by-side review; remaining gap is lighting, not edges):
- tubed edge ink enabled for BOTH styles (was studio-only): dark
(0.145, 0.165, 0.196) vtkTubeFilter tubes, width as span fraction
(default lowered 0.0026 -> 0.0019 after visual iteration); tube sides
10 -> 14; edge_width_scale=0 falls back to the legacy thin lines
- edge discretization decoupled from the surface tessellation: dedicated
0.04 mm chord-error cap (was the shared 0.35 surface deflection), so
curved edges stay smooth once tubed — same philosophy as the viewer's
.lines.glb assets
- deterministic supersampling: render at integer factor (default 2,
validated 1-3) and LANCZOS-downsample; FXAA off when supersampling;
legend text scales with the factor so the final look is preserved
- coincident-topology polygon offset added (shared walls after booleans)
- tests: supersample writes the requested image size at factors 1/2/3,
out-of-range factor rejected; 13/13 pass; API doc regenerated
Default single-view output changes once, deliberately (thin light lines
-> crisp dark ink); supersample=1 + edge_width_scale=0 restores the
legacy 1:1 look.
Reviewed keep of the BLDC-GIF render pipeline changes (all opt-in; the
default inspection path is byte-identical, verified by A/B render):
- render_screenshot_rpath: + linear_deflection / angular_deflection
(tighten tessellation for high-res diagnosis), style='studio'
(product-shot look: black stage, camera-derived three-point lighting,
metal specular), edge_width_scale (tubed-edge radius as span fraction,
validated [0, 0.02]), view_up (explicit camera roll for inclined
orbits)
- BRep edges as vtkTubeFilter geometry in studio style: LineWidth is
capped ~3px on macOS, so edges must be geometry to stay readable at
high resolution / for small features
- contracts: unknown style, studio+views grid and out-of-range
edge_width_scale are rejected with guidance errors
- tests: three rejection contracts + studio/standard divergence smoke
(size-threshold assertion replaced with a behavioral one: outputs must
differ); 11/11 pass
- API doc regenerated via tools/auto_docs_gen.py (also picked up the
view_up parameter the hand edit had missed)
- examples/20 render_showcase.py: four-module axial explode (ESC /
motor / two-stage reducer / output shaft) with concentric radius-band
peeling, inclined camera orbit, exploded turntable GIF export
Per user ruling: the translator unconditionally translates what the dataset
carries (constraints included, --constraints on|off, default on). The auto
mode, in-process preflight, drift gate and sidecar conflict report are gone
from the translator — auditing now lives entirely in histcad_conflicts.py,
which renders each feature's translated prefix with the same StepEmitter
and classifies the solve itself (solved / drifted >1e-3 / conflicting /
exec_error) on top of the residual + dof + halfSpace analysis.
histcad_validate.py is build + STEP volume reconciliation only.
Generated sources are unchanged in shape (single path, constraint_id tags,
pure FTC blocks); demos regenerated with full constraint sets and still
reconcile to STEP at machine precision. Purity tests updated to pin the
sharper contract: unconditional constraint translation, pooled-coincident
elision, and that the translator module never imports the SDK.
Generated sources carry the model only: the dual-path constraint fallback,
SKETCH_CONFLICTS/SKETCH_TIER_FALLBACKS audit globals and strict=False
inspection are gone from translated code. Tier decisions and conflict
auditing moved to translation time: auto mode solves each feature's
constrained sketch prefix in-process (preflight), emits sketch tier when it
solves AND reproduces the transcribed coordinates (max point move <= 1e-3,
the drift gate), otherwise transcribed geometry; diagnostics go to the
sidecar report (<case>.ftc.py.report.json).
Root causes found by the new histcad_conflicts.py residual analyzer and
fixed in the translator:
- point-pair H/V distances are directed: sign now taken from coordinates
(the stored length is a magnitude) — was the top Fusion conflict source
- Tangent on arcs needs an endpoint selector: picked as the nearest shared
junction with the other curve
- MajorRadius/MinorRadius store full axis lengths: halved to semi-axes
(solver was stretching ellipses 2x)
- Horizontal/Vertical flat line lists map each line individually
- variadic Equal chains get per-pair constraint ids (duplicate-id crash)
- Coincident entries whose refs pooled onto the same point are elided:
degenerate point-coincident equations made the solver Jacobian singular
and showed exact-geometry sketches as conflicting
SDK: constrain_concentric_rsketch now accepts ellipse targets (backend
resolves the ellipse center point).
Validation (100-case samples, constraints=auto): Fusion360 72 pass,
sketch-tier retention 77.5% (conflicts: 19 diverged + 1 conflicting);
DeepCAD 83 pass, retention 85.0% (9 diverged, 0 solver-conflicting).
Demos regenerated, volumes reconcile to STEP. Purity pinned by
test/test_histcad_translation_output.py (9 tests). Full suite 1489 passed.
make_helix_redge/make_helix_rwire/helical_sweep_rsolid accept
handedness='Right'|'Left'. The kernel negates the u component of the
cylinder 2-D line, mirroring the winding while keeping the ascent
direction: sampled chirality asserts +5 turns CCW (right) vs -5 turns
CW (left) with identical rise, length, and sweep volume.
FreeCAD: Part::Helix stays the right-handed path; left-handed helices
materialize through Part.makeHelix(..., lefthand=True) since Part::Helix
cannot express mirrored winding via placement (rotations preserve
chirality).
chamfer_rsolid(distance, angle=, reference_direction=) drives an
asymmetric chamfer: the second leg is distance * tan(angle) and the
distance itself lands on the adjacent face whose outward normal best
matches reference_direction (resolved per edge through incident-face
tracking). Without angle the symmetric behavior is unchanged.
Kernel: tracked_chamfer gains distance2/edge_face_pairs and uses OCC's
SetDists(d1, d2, contour, face), whose first distance lands on the
passed face — verified by chamfer-face bbox placement tests.
FreeCAD: Part::Chamfer Edges tuples use distance2 when recorded.
Graph params record angle, reference_direction, and distance2.
- Geometry tier: make_ellipse_redge/rwire/rface with major_direction
orientation; exact OCC Geom_Ellipse geometry (area pi*a*b).
- Sketch tier: add_ellipse_rsketch derives the shape from three solving
points (center, major-axis end, minor-axis end) so radius constraints
solve natively; constrain_major_radius_rsketch and
constrain_minor_radius_rsketch drive point distances; fix pins all
three points; promotion builds an ellipse profile branch.
- Solved entities report center/axis points, radii, and major-axis angle.
- FreeCAD: Part.Ellipse(S1, S2, Center) three-point construction in both
Sketcher materialization and wire fallback; major radius maps to the
native Radius constraint, minor radius to a reference distance on the
solved minor-axis point (FreeCAD has no native minor-radius
constraint; noted in mapping status); geometry-tier emitter uses
_kernel_ellipse_from_params.
- QL curve_type('ELLIPSE') verified against promoted faces.
- 14 new tests; API doc pages regenerated.
- Driving angle lowering: addAngle folds directed 0-360 values to the
undirected magnitude; the solve keeps the branch nearest the initial
geometry. Angle measurement normalizes to [0, 360).
- constrain_line_distance_rsketch: minimum offset between lines via a
signed point-line distance (initial side preserved).
- constrain_points_horizontal/vertical_rsketch for two-point alignment.
- constrain_normal_rsketch (line through curve center),
constrain_mirror_rsketch (entity mirror decomposed to point symmetric
pairs with nearest-initial endpoint pairing), and
constrain_midpoint_points_rsketch (two-point midpoint via helper
segments: equal length + parallel through the shared point).
- Repair: symmetric lowering no longer uses py-slvs addSymmetricLine,
which mirrors about the workplane u-axis regardless of the axis entity;
it now decomposes to midpoint-on-line + perpendicular. Regression
tests cover vertical and diagonal axes.
- FreeCAD translator: new kinds map to Sketcher Angle/Distance (point to
line)/point-form Horizontal/Vertical/PointOnObject (center on line)/
Symmetric (line mirror and three-point midpoint); priority map,
emitter registry, capabilities, and canonical op set updated.
- 24 new tests (solve semantics, side/basin behavior, serialization
round-trip, FCStd script mapping) + regenerated API doc pages.
render_screenshot_rpath now defaults to a multi-view grid instead of a
single view: one PNG with a panel per SCREENSHOT_VIEWS entry (isometric,
top, front, side), carrying the same highlight-tag color groups, callout
labels (2-D leader-line style, projected per panel), legend and — new
for the grid engine — per-panel axis triads.
- The multi-view grid engine (_render_polydata_views[_in_process])
gains show_axes: a vtkAxesActor per panel, sized from the visible
bounds, forwarded through the macOS render worker protocol.
- _render_sdk_screenshot_rpath keeps all of its view-independent
tag-to-group / callout-anchor / legend computation and routes through
the grid engine when views is provided; image_size (pixels) maps to
inches*dpi=100 so pixel dimensions are preserved.
- Public API: new views parameter; default (view='auto') resolves to
SCREENSHOT_VIEWS; an explicit view keeps the legacy single-view path
unchanged. zoom only applies to the single-view camera.
- render_shape_views_rpath is unchanged: it remains the raw-TopoDS_Shape
entry for the STEP inspection family; both entries now share one grid
engine with identical annotation capabilities.
BEHAVIOR CHANGE: the default output of render_screenshot_rpath switches
from a single-view image to the 4-panel grid. Callers passing an
explicit view are unaffected.
ty: no new diagnostics (1043 before and after). Auto-doc pages
regenerated. Full suite: 1432 passed, 5 skipped (7 new tests: wiring,
custom views, legacy single-view routing, two real renders, constant
shape, empty-views rejection).
Removes src/simplecadapi/verifier (current-pose mesh penetration checks
via python-fcl), its test, and the planetary-reducer collision probe
example. Collision verification now lives in an external implementation
outside this SDK.
The python-fcl>=0.7.0.11 dependency is dropped with it: the verifier
module was its only consumer.
BREAKING CHANGE: scad.verifier and check_collision_rcollisionreport are
no longer exported. Workflow docs mentioning 'verifier' refer to the
Verifier Planner role, not this module, and are unchanged.
Full suite: 1425 passed, 5 skipped.
_orthonormal_plane_axes built the in-plane basis with x = cross(z, ref),
which for a +z normal yields x=(0,1,0), y=(-1,0,0): every non-square
rectangle made on the z=0 plane was silently rotated 90 degrees relative
to make_box_rsolid (width along global y instead of x).
Build the basis by projecting the reference vector onto the plane
(Gram-Schmidt) instead: for a +z normal the frame is exactly the global
(x, y, z), matching the box convention and the OCC gp_Ax2 default. The
reference-axis branch keeps ref away from z, so the projection never
degenerates. Only make_rectangle_rwire uses the helper (session and
legacy paths); other planar makers are unaffected.
BREAKING CHANGE: non-square rectangles now orient width along global x
for +z normals; both session and legacy paths rotate together. Recorded
replay graphs built with non-square rectangles reproduce rotated
geometry.
test_surface_api's partial-overlap trim test encoded the transposed
convention; its loop dims (4, 2) -> (2, 4) reproduce the exact footprint
(x in [0.5, 2.5], y in [-2, 2]) the test has always exercised.
- Direction-first placement: once at/side is fixed the text has exactly
one DOF (slide along the line); rad candidates run outer (s=3..27)
then inner-arc (s<0, line through center, arrow flips to point at the
arc from the center side, deepening ladder for tight centers)
- Linear dims gain slide; dimension line auto-extends (derived, never
hand-placed) to cover text that leaves the measured span; narrow
spans place outside with elongation directly; _lin_geometry is the
single derivation shared by solver and apply
- rad action surface reduced to at(+s); rot is line direction only (R2),
out removed; dia/rad split insert (baseline-left anchor, matches
set_placement rendering) from anchor (OBB center, collision/eval) —
fixes text rendered half-width off its registered OBB
- Leader fixes: multiline elbow moved above the text box (old elbow
crossed line 2), no-space fallback no longer crashes unpacking None,
seg-over-text check references the right loop variable
- SheetDecl.diag_png: solve()/apply() auto-refresh the annotated
conflict image and return a must-read instruction — visual feedback
is the first-class agent-in-the-loop channel
- test/test_dxf_engine.py: 18 tests covering the above contracts plus
render determinism; API pages regenerated
Plural topology getters (get_edges/get_faces/get_wires/get_vertices/
get_solids/get_inner_wires/get_edge_occurrences and the Compound
variants) now accept ONLY an index. The no-argument list form raises a
SimpleCADError with migration guidance (enumerate via
ql.<kind>().resolve(shape), pick via get_X(index)). This closes the
selection channel that escapes the graph: Python loops over bare lists
lose the predicate, capture kernel artifacts (the periodic-face seam
edges that broke FCStd translation), and leave no cardinality contract.
- each shape class keeps its enumeration logic as private _iter_<kind>();
indexed picks record geo-select nodes as before (contract test added);
Compound getters gain the same indexed recording they lacked
- _TopologySelectionList (the __getitem__ recording vehicle, which also
made get_X()[i] a silent escape hatch) is retired
- all 109 internal call sites, 165 test call sites, and 31 example call
sites migrated: SDK/tests use the private channel, user-facing
examples use ql.<kind>().resolve(...)
- QL _resolve_scope_items switches to the private channel; scene
contract profile descriptions synced; error strings recommending
bracket indexing rewritten
- skill docs: strict prohibition added to SKILL.md global rules (new
rule 6), core README contract statement rewritten, solid/wire/face/
shell/tagged_mixin pages re-exemplified with QL, geometric-validation
anti-pattern section updated; mirrors rebuilt via tools/skillbuild.py
Gates: full suite 1418 passed / 5 skipped; translator suites 133 passed;
u_link stage verifiers + render check ALL PASS; scadpkg->FCStd
retranslation verified (5 visible deliverables, 167-object editable
tree).
The FreeCAD runtime rejected any geo match scoring above an absolute
1e-2, but the score is a sum of 10x-scaled relative-error terms and a
rebuild in FreeCAD's OCC differs from the recorded OCP geometry in the
4th-6th significant digit — the CORRECT candidate lands at ~0.01-0.5
while wrong candidates score >= ~1. The absolute threshold was
calibrated for same-kernel replay and rejected correct cross-kernel
matches (observed: best 0.0516 vs runner-up 2.12, a 40x separation,
rejected).
Accept the best candidate when best <= 0.5 AND second >= 10*best + 0.5
in addition to the unchanged near-exact path. Rejection semantics are
preserved: absent targets (best >= 1) and ambiguous twins (second close
to best) still raise.
Unit tests cover all five cases: near-exact accept, kernel-drift
accept (both orderings), similar-runner-up reject, absent-target
reject, single-candidate accept.