Commit Graph

158 Commits

Author SHA1 Message Date
auua a3fa37e50b Revert "Ci/harbor smoke (#12)"
This reverts commit d9d42a4d73.
2026-09-23 20:27:59 +08:00
auua d9d42a4d73 Ci/harbor smoke (#12)
## Summary

增加CI项:

- 时机:当push master/dev时触发
- 任务:按照仓库配置的变量,让harbor运行给定的数据集
- 动机:查看不同推送是否对具体任务有帮助

---------

Co-authored-by: auua <12321ua@gmail.com>
Reviewed-on: https://git.auuuuuua.top/PhySpace/CADIR/pulls/12
2026-09-23 20:17:39 +08:00
NiJingzhe 1f7d0cb9fa chore(release): 2.1.3
CHANGELOG added; version bumped to 2.1.3 across pyproject, skill
frontmatter, and README current-release lines; generated skill docs
refreshed via tools/auto_docs_gen.py.
2026-09-18 11:12:54 +08:00
NiJingzhe eb2f2c08d3 feat(addon): runtime state outside the payload + 'sca addon check'
- per-addon runtime dirs (~/.sca/runtimes/<name>), created at install,
  untouched by update, removed with the addon; {runtime_dir} placeholder
  in command_prefix and check_cmd alongside {addon_dir}
- 'sca addon check [name]': re-probe the installed runtime NOW and
  refresh the cached registry record (install-time probe is a cache,
  not truth); list shows cached state with its timestamp
- sca addon use exports SCA_RUNTIME_DIR for self-locating provisioning
- update replaces the payload wholesale but preserves a legacy in-payload
  .venv (pre-runtime_dir addons keep working)
- remove: records without runtime_dir delete nothing extra — never
  interpret the missing field as Path('') == CWD (regression test pins
  the exact failure that motivated this guard)
- docs: Payload vs runtime state section, check verb, updated examples
- version 2.1.3b4
2026-09-17 05:18:43 +08:00
NiJingzhe b939f44043 feat(cli): single 'sca' entry point + 'sca init' shell integration
- 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
2026-09-13 04:19:17 +08:00
NiJingzhe 3224233a62 feat(addon): top-level 'sca init'; version 2.1.3b3; local installs skip envs/caches
- '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)
2026-09-13 03:41:28 +08:00
NiJingzhe dd33c79982 Merge branch 'dev' into feat/sca-addon
# Conflicts:
#	pyproject.toml
#	uv.lock
2026-09-13 03:28:30 +08:00
NiJingzhe d73555fbe2 feat(addon): naming standard + command prefix + 'sca addon use' dispatch
- 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
2026-09-13 02:51:17 +08:00
Yulia 07255c7acb Merge pull request #59 from So3Lab/feature/solidworks-2023-compat
feat(translator): share geometry signatures and support SolidWorks 2023
2026-09-11 21:30:29 +08:00
NiJingzhe e9d5749f7c fix(windows): unblock builds — binary opens, guarded dir fsync, evidence-based stale locks
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.
2026-09-11 20:55:14 +08:00
Yulia b30c9da192 Merge latest dev into feature/solidworks-2023-compat 2026-09-11 17:00:26 +08:00
Yulia ae44cefd06 feat(translator): unify geometry signatures and support SolidWorks 2023 2026-09-11 16:54:53 +08:00
liuyu 9caa2caa3a feat(drawing): integrate PDF reconstruction and evidence validation
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.
2026-09-11 13:36:27 +08:00
NiJingzhe be93122527 chore(release): bump version to 2.1.3b1 2026-09-10 14:50:05 +08:00
NiJingzhe fc28a6298b docs(addon): scadpkg consumer format spec + reading guide; drop dead v2 package schema 2026-09-10 14:36:10 +08:00
NiJingzhe 93fad0e071 docs(addon): replace never-import contract with two integration modes 2026-09-10 14:16:49 +08:00
NiJingzhe 5cac586dfc feat(addon): sca addon manager — descriptor gates, platform enum, skill install, authoring doc 2026-09-10 03:05:09 +08:00
NiJingzhe aac0fbb29d feat(cache): script-anchored part cache, keyword-form corpus, 2.1.2
- @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
2026-09-10 00:11:28 +08:00
NiJingzhe 197bf40c6b chore(release): bump version to 2.1.1
Tooling patch: SDK API unchanged. Adds the CadQuery→FTC translator toolset
with snapshot constraint recovery (merged in #49) and its bilingual update
notes; version stamps updated in pyproject+lock, SKILL frontmatter, and
both READMEs.
2026-09-09 22:12:13 +08:00
NiJingzhe a45cbf280e chore(release): 2.1.0
- version 2.0.4b3 -> 2.1.0 (pyproject, uv.lock, skill frontmatter, READMEs)
- docs/updates/2.1.0.md + zh-CN: release notes spanning the 2.0.4b2 baseline
  (absorbs the unreleased 2.0.4b3 draft: product boundaries, incremental
  assembly, crash-safe cache) plus FTC authoring, DXF engine, external
  history import, reverse-engineering studio, unified rendering, Apache-2.0
  relicensing, harness-targeted skill builds, self-contained examples, and
  the geometry fingerprint round-trip fix
2026-09-07 09:45:57 +08:00
NiJingzhe 2fbbcc864c Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	LICENSE
#	README.zh-CN.md
#	skills/simplecadapi/SKILL.md
#	src/simplecadapi/auto_tools/skill_pack.py
2026-09-07 09:39:07 +08:00
NiJingzhe 237702c7a8 feat(examples): unnumbered self-contained layout with per-example out/
- 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.
2026-09-07 05:46:15 +08:00
NiJingzhe 7a8404f03e feat(skill): harness-specific host bindings for 7 compile targets
- skillproj.toml: targets omp,opencode + zcode,claudecode,codex,dsh,kimicode
- single-part-modeling: 5 host-binding pairs -> 10 (ask tool, TODO tool,
  REPL/script hypothesis loop, plan state machine, isolated image review)
- zcode+claudecode share one block per binding (AskUserQuestion/TodoWrite/
  Agent-Task); codex = plain-text batched questions + update_plan + user as
  fallback reviewer; dsh/kimicode = conservative fallback pending native
  tool mapping
- references README generalizes the omp-only wording
2026-09-07 02:29:24 +08:00
Ni Jingzhe 19bb3bd588 Merge pull request #43 from So3Lab/feat/ql-playbook-absorb-guide
docs(skill): absorb QL selection guide into the verified playbook
2026-09-06 20:52:25 +08:00
NiJingzhe 3f9d52d155 docs(skill): elevate in-time tagging to a playbook ground rule
State the ordering discipline positively: a tag lands in the step right
after the operation that produced its targets, because projections into
later outputs are computed at op time. Rule 2 keeps the ownership
half (resolved-list targets), rule 3 owns the timing half, and both name
the same surface error so the misleading 'not owned' message resolves to
the right defect.
2026-09-06 19:56:29 +08:00
NiJingzhe c35bddd6bd docs(skill): absorb QL selection guide into the verified playbook
The hand-written guide at references/docs/guides/ql-selection-playbook.md
sat inside the generated-docs mirror directory under a title identical to
the verified playbook, so agents entering via SKILL.md saw only the older
unpinned copy. Merge its unique content (selection loop, predicate
vocabulary, shared-boundary failure signatures, bore->rim chamfer and
face->datum recipes, lineage routes, facts printing) into
references/ql-playbook.md and retire the guide.

Recipe snippets were re-executed against dev @ 94e3e3e (11/11) before
merging; two session-path corrections came out of that run and are now
documented in Ground rule 2: apply_tag_rselection targets must be a
resolved list, and tags must land before the next operation consumes the
shape.
2026-09-06 19:49:11 +08:00
NiJingzhe c0bfabb3a3 chore: relicense to Apache-2.0
Replaces the AGPL-3.0 license text with the canonical Apache License 2.0
and updates every reference: pyproject trove classifier, both README
license sections, and the skill frontmatter. The article drafts under
docs/ are untracked and were updated separately.
2026-09-06 18:42:33 +08:00
NiJingzhe fb29140206 merge: integrate dev (PR #36 viewer re-composer) into 2.1.0-open 2026-09-06 03:58:44 +08:00
NiJingzhe 3e319e4987 feat(render): agent-facing guard + readable labels
Two agent-SDK quality rulings from the u_link misrender review:

- zero-hit guard: requesting a highlight tag that matches no geometry now
  raises with the missing tag names and likely causes (typo / wrong build
  stage) instead of silently labelling empty air — the guard immediately
  caught two real misuses (S1 blank labelled with S3-stage tags; flange
  fillet tag lost to a downstream feature rewrite)
- label typography: all font sizes move to final-image-pixel semantics
  scaled by supersample; callout lower bound 12->18, legend 10->12 with
  wider cap, panel title floor raised; margins scale with font size so
  large text does not overflow panels
- fix surfaced while verifying: candidate dataset names referenced by
  callouts did not survive the macOS worker hop (surface_group_N vs
  surface_groups_N) — re-anchoring silently no-op'd on darwin; naming
  aligned and verified end-to-end (occluded rim-fillet anchor re-anchors
  onto the visible lower half of the same ring)
2026-09-06 03:41:15 +08:00
Ni Jingzhe d8c5b4e8fe Merge pull request #36 from So3Lab/feat/viewer-re-composer
feat(viewer): re-studio composer round — BRep renderer component, flat UI, context injection
2026-09-06 03:13:00 +08:00
NiJingzhe 26da5e2170 feat(render)!: one pipeline — annotated 1-4 panel grid, studio by default
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
2026-09-06 03:06:18 +08:00
NiJingzhe 0e240e3f70 feat(render): unify SDK rendering into one API over one engine
- render_screenshot_rpath now accepts raw TopoDS_Shape entries alongside
  SDK solids: the STEP inspection family renders through the same public
  entry with the same edge ink, supersampling and (for solids) tag
  highlights/callouts — one API at SDK level, one engine below it
- edge ink + supersampling pushed DOWN into the shared multi-view grid
  engine (_render_polydata_views_in_process): the default 4-panel
  diagnostic grid and render_shape_views_rpath (inspect channel) now
  draw tubed BRep edges with LANCZOS supersampling like the single-view
  path; grid review score 9/10 (was thin 1px lines)
- render_shape_views_rpath keeps its signature as the inspect-family
  convenience entry (dpi sizing contract preserved: 3240x2160) and gains
  the 0.04mm edge deflection cap; it is no longer the only way to render
  raw shapes
- ty config: unresolved-import ignored repo-wide — OCP/VTK ship no .pyi
  stubs and examples import sibling modules, so import resolution was
  ~900 diagnostics of environmental noise (verified: zero real defects
  in the class); replaces the duck-typing workaround with natural
  isinstance(TopoDS_Shape) checks
- gates: 13/13 render tests, mixed [Solid, raw] input smoke, grid visual
  review, API docs regenerated, step-inspection domain doc notes the
  unified entry
2026-09-06 02:41:44 +08:00
NiJingzhe 94f3b1657f feat(render): three.js-grade BRep edge ink for the VTK single-view path
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.
2026-09-06 02:15:38 +08:00
NiJingzhe bdee2e16c4 feat(render): opt-in studio style, tubed BRep edges, tessellation and camera-roll controls
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
2026-09-06 02:01:27 +08:00
auua 6c74001ab3 feat(cli): Encapsulate the export function into a CLI tool. 2026-09-05 23:51:42 +08:00
NiJingzhe cdfc0ee904 docs(skill): re-studio workflow rewritten for the composer round
- reverse-engineering-studio.md: free-form composer (entity/op chips,
  [label](token) serialization, IME-safe Enter), operation tips as a
  markdown registry (viewer/server/operations/, mtime-hot, errors named),
  submission schema incl. operations + operation_context, self-contained
  artifact rule (transcription = literals, extraction harnesses beside
  the case), kernel-ordering facts (bores before blend fillets; fitter
  to_dict unique_knots contract), artifact names the UI polls
- step-reconstruction.md: route to the studio variant when a human
  operator is available
- SKILL.md: workflow count corrected to six; viewer/README.md updated
  for the composer + tips registry
2026-09-05 14:35:20 +08:00
NiJingzhe e5ed7b547e feat(viewer): reverse-engineering studio — human-annotated STEP reconstruction loop
Interactive re-mode (re.html) plus a local case server implementing the
ppt-master handshake: the human selects faces / draws regions / labels intent
on the original STEP, the browser composes a submission with server-side
entity context, and a waiting agent reconstructs per the existing
reconstruction contract and writes artifacts the UI polls back.

- viewer/server (stdlib-only): STEP -> synthesized Scene 2.0 projection
  (GLB + entity sidecars, same shape as package scenes), region resolve
  (centroid projection + front-facing filter), entity descriptors,
  atomic submissions, ndjson side recording, --daemon/--wait/--wait-only/
  --shutdown CLI with lockfile and 590s budget
- viewer/src: extract shared cad-three/entity-facts modules (main.ts now
  consumes them), new SceneView class (assembly/picking/highlight) reused
  by both studio viewports
- re-mode UI: annotation canvas (circle/lasso), intent palette, context
  preview, submit flow, rebuilt v3 package loading, comparison image,
  feature tree, evaluation tab
- governance: only the browser writes submission.json; UI never edits
  geometry — code stays the single source of truth
- tests: 6 server tests (scene contract, region math, submission context
  + named failures, wait handshake exit codes, HTTP endpoints)
2026-09-05 00:30:46 +08:00
NiJingzhe 48c77c2055 feat(histcad): pure training-data translation, tools under research/histjson
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.
2026-09-04 14:28:49 +08:00
NiJingzhe b496530363 feat(helix): handedness parameter for right/left helices
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).
2026-09-04 05:36:27 +08:00
NiJingzhe e05231312f feat(chamfer): asymmetric angled chamfers via angle + reference_direction
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.
2026-09-04 05:34:26 +08:00
NiJingzhe 23fcc6a4e1 feat(ellipse): full ellipse support at geometry tier, sketch tier, and FreeCAD translation
- 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.
2026-09-04 05:29:19 +08:00
NiJingzhe d57835232a feat(sketch): HistCAD constraint coverage — driving angle, line distance, point alignment, normal, mirror, midpoint
- 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.
2026-09-04 05:14:09 +08:00
NiJingzhe 8261a28545 feat(render): multi-view screenshots with tags, callouts, legend and axes
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).
2026-09-04 03:52:21 +08:00
NiJingzhe fe05205cae docs(skill): drop fix-history narration from the QL playbook
Skill references state current conventions and current limitations, not
repair history: the plane-axes convention moves to Pattern A (planar
profiles share the box axis convention, width along global x for a +z
normal), and the boundaries list keeps only the still-true behavior
(reference-axis branch switches the in-plane basis discontinuously near
~25° from vertical). Verification stamps updated to dev @ 13c797f.
2026-09-03 18:15:31 +08:00
NiJingzhe 09241caeff docs(skill): add QL selection playbook from verified harnesses
33/33 checks across four verification harnesses (extrude family,
primitives, sweep/loft, D-boss boolean seam + seam fillet) on dev
@ 7dcf2ef. Documents the naming-channel reach matrix (op-kwarg names
survive booleans; edge-source names survive modifiers; plain user face
tags project through nothing), the boolean seam recipe
(origin_role body/tool + incident_to distinct), and the current engine
boundaries. Boundary #5 records the plane-axes fix on this branch.
2026-09-03 17:57:55 +08:00
NiJingzhe eaa6d46458 chore(example): drop 2D drawing scripts from u_link_motor_mount
The drawing declarations were exploratory scaffolding for the dxf engine
and outlived their purpose once the engine contracts landed; example
keeps only the 3D modeling chain (u_link/shell/assembly/export/verify).
Generated artifacts (dxf/png/diag/action-log) were already removed from
out/ — only 3D exports remain. Workflow doc now points at driving the
loop directly via SheetPlan (solve/evaluate/apply/render) with the
diag_png auto-diagnostic instead of the deleted driver script.
2026-09-01 19:10:41 +08:00
NiJingzhe 6c0f9ee3a6 feat(dxf): 1-DOF annotation model, rad inner-arc variant, auto-diag loop
- 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
2026-09-01 19:10:33 +08:00
NiJingzhe 37c46ccad5 Merge branch 'dev' into feat/dxf-engine 2026-09-01 13:39:14 +08:00
NiJingzhe 48b23fbe7e docs(skill): consolidate workflows to four goal routes
The FTC convention dissolved the sketch-feature-modeling discriminator
(planar profiles are sketch tier inside every part source), and
standard-part usage belongs to the assembly route. Workflow set: 6 -> 4.

- sketch-feature-modeling merged into single-part-modeling: new standing
  discipline 'Sketch tier is the default part form' carries the sketch
  gates (solve status + remaining DOF before promotion, promotion
  preserves measured geometry, stable entity ids, intentional free DOF
  recorded); capability detail stays in domains/sketch-and-features.md
- single-part-modeling gains the hard rule: if the requirement can be
  satisfied by a standard part or based on one, scad.std.* MUST be the
  basis; single std part stays here via domains/standard-parts.md,
  mechanisms mating several route to assembly
- standard-part-assembly merged into assembly-product-build: scope now
  includes stdlib mechanisms; new step 3 selects std components first
  and computes the kinematics explicitly (center distance from tooth
  counts and module, backlash, ratios, measured bearing/gear seats);
  mesh-consistency gates added; steps renumbered 1-10
- routing table and references/README workflow table reduced to four
  goal rows; step-reconstruction's citation of the removed workflow
  replaced with the sketch/geometry tier pointer; mirrors rebuilt
2026-09-01 02:21:24 +08:00
NiJingzhe efe9751bdf docs(skill): feature tree convention discipline; mandatory read in all workflows
Codify the FTC coding standard as references/discipline/
feature-tree-convention.md:

- the block paradigm sketch -> basic body op -> bool -> modifier as
  explicit dataflow (body = op(body, tools)), one application call
  per block, no accumulator state
- mandatory boundary comments '# ---- feature: <slug> (<role>) ----'
  with closed role vocabulary (build|add|subtract|intersect|modify|
  pattern|annotate) and tier annotations profile=/path=; slugs are
  stable identities, never sequence numbers
- tier rules: closed planar profiles and planar sweep paths are sketch
  API only (tangency is a constraint, not hand-computed coordinates;
  open-chain promotion is legal, closedness is a consumer contract);
  geometry tier is restricted to non-planar 3D curves, transcribed
  geometry with unknown constraints, and tool bodies whose shape is
  completely contained in a primitive form — primitives are never a
  shortcut for a profiled feature
- modify blocks select via QL predicates + exactly(n) cardinality;
  parameter guards stay in source, geometric verification stays
  external; block ordering defers to feature-ordering.md

Wire it as required reading into every workflow on this branch (all
six): single-part (standing discipline + Role 4 reading), sketch-
feature (required_domains + build step), assembly-product (per-part
authoring step), step-reconstruction (build step, geometry-tier
honesty), standard-part-assembly (custom parts step), export-and-
translation (source edits while making a package current). SKILL.md
global rule 3 points at the convention for part-source form. Mirrors
rebuilt via tools/skillbuild.py.
2026-09-01 02:13:50 +08:00