Commit Graph

386 Commits

Author SHA1 Message Date
NiJingzhe c0f29be377 editor: a workplane feature from picked geometry; a sketch plane can be a workplane variable; the kernel reports workplane frames
The 'workplane' spec (role datum, produces workplane) writes
wp = scad.make_workplane_*_rworkplane(...) from a face (offset, flip),
a face + an edge, two parallel faces, three vertices or an edge (angle).
Optional selection slots; recipes for vertices; extract_recipe finds each
slot's recipe in a cell with several. A sketch document's plane may be
{workplane: <variable>, frame}: the cell writes plane=<variable> and reads
it; the frame is the kernel's, for solving and drawing. The snapshot lists
GUI workplanes. After each settle the kernel prints the frames of every
SimpleWorkplane global (runtime.live.workplane_frames) and the server
sends a replayed 'workplanes' envelope when they change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:43:23 +08:00
NiJingzhe b9143ec03c docs: API pages and stubs for the workplane constructors; SimpleWorkplane and make_sketch_rsketch(plane=wp)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:27:21 +08:00
NiJingzhe c6f01eb568 sdk: workplanes are recorded values (make_workplane_*_rworkplane); sketch plane=wp; replay follows the geometry
A SimpleWorkplane is now a value: copyable, entered again (`with wp:` in later
cells), picklable for the cell cache (exact frame + metadata/runtime, so it
keeps its graph lineage), with origin/normal/x_dir/y_dir/plane.

Six recorded constructors (C++ ops/geometry/workplanes.cpp, typed bindings):
make_workplane_rworkplane (origin/normal/x_dir in the current system),
_from_face_ (centre or projected origin, outward normal, x along an edge / a
direction / the face's own x, offset, flip), _from_points_ (Vertex or point),
_from_axis_ (straight edge or circle axis, turned by an angle, optional start
face), _midplane_ (two parallel faces), _normal_to_curve_ (edge or wire, at a
fraction of its length). Inputs are recorded as ordered input_refs; replay
(serializer) rebuilds the frame from the replayed geometry.

make_sketch_rsketch(plane=wp) uses the workplane's world frame, records
plane={workplane: true, frame} and the workplane node as an input; replay
takes the frame from the replayed workplane. Inside `with wp:` every recorded
node's context names the workplane node; replay orders it after that node and
uses the replayed frame. types.Plane includes SimpleWorkplane; catalog kind
"workplane".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:25:07 +08:00
NiJingzhe f4cb667eba sketch: B-splines in the sketch editor (spline tool B: click control points, Enter makes it, the first point closes it)
The document gets a bspline entity (control point ids, degree) that becomes add_bspline_rsketch; the solve returns each
B-spline as the SDK samples it (sample_curve_rcurvature), so the editor draws the SDK's curve, its control polygon (the
points are the handles: dragging one reshapes the curve) and, for a picked spline, its curvature comb. Loops and faces through
B-splines are the SDK's profiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 12:29:01 +08:00
NiJingzhe 3d62a95d82 merge feat/body-appearance: body colour, opacity and display name (set_body_appearance_rpart); a face's name is a tag
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:49:42 +08:00
NiJingzhe 9a84b1d029 Merge branch 'feat/nurbs-edit-ops' into feat/gui-modeling 2026-11-04 11:30:07 +08:00
NiJingzhe 506d980089 surface edits: inspect reports a side a converter turned into a 2D B-spline as untrimmed
is_trimmed judged a face untrimmed only when every pcurve was a Geom2d_Line; BRepBuilderAPI_NurbsConvert turns them
into 2D B-splines, so a converted cylinder side read as trimmed. It now samples each pcurve against the four sides of
the domain. Doctest: a converted cylinder side is periodic, untrimmed, and stays valid when a pole is moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:29:37 +08:00
NiJingzhe e35c573a31 editor-web: a colour input for colour slots; the viewer draws each body in its display colour and opacity
The preview's nodes carry color/opacity (a body colour, else the material's);
the viewer draws a node in properties.color (preview or package scene), else
the material tint, else the default grey, see-through below opacity 1. The
colour slot is a picker (sRGB #rrggbb) converted to the SDK's linear RGB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:23:54 +08:00
NiJingzhe a0879d7d2a docs: API pages and stubs for set_body_appearance_rpart; Body colour/opacity; a tag is how a face gets a name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:21:42 +08:00
NiJingzhe f021b33489 surface edits: sub-entity tags follow without a session; stubs, API pages, graph spec, skill page
The edits finish through finalize_tracked with the entries of the rebuild's history (modification_history, the
entries next to modification_delta), so tags on the face and its edges follow with or without a recorder, as for the
tracked solid ops. Stubs regenerated (pybind11-stubgen 2.5.5), API pages generated by tools/auto_docs_gen.py, the
graph JSON spec lists the 14 recorded ops and their params/delta, and the skill gains
references/domains/curve-surface-editing.md (read, convert, edit, check; trimming; tags), linked from
part-modeling.md and references/README.md. CHANGELOG under Unreleased.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:21:36 +08:00
NiJingzhe c18d6b9038 editor: a colour slot for display colours; naming a face is the tag op with picked faces
op_specs offer a 'color' slot for Color parameters (set_body_appearance_rpart,
make_material_rmaterial) and an opacity slider in [0, 1]. apply_tag_rselection
returns AnyShape in its signature (it was the one untyped result in the
catalog) and its targets are faces picked in the viewport, so 'name this face'
is the existing tag operation. Fix: the generic op builder dropped every picked
selection (op.fillet_rsolid wrote no edges); a test now checks every op with a
selection passes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:19:17 +08:00
NiJingzhe 9df1d77917 sdk: curve/surface edit operations exported, recorded and replayed from model JSON
The 18 operations are exported at the top level and in simplecadapi.surface, with docstrings and module entries.
The 14 recorded edits join the 2.1 canonical core op set and replay through one helper (ordered input ref, params);
inspect/sample are diagnostic. element_ref no longer asks a Face/Shell for solids (SDK_DEFECTS 36), so references
into a surface body resolve. test/test_surface_editing.py: recording + replay of whole edit chains, tags and stable
references through edits, a face picked from a solid, errors, sampling, catalog types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:15:39 +08:00
NiJingzhe 4ff66173c5 feat(product): set_body_appearance_rpart: a display colour, opacity and name per body
A Body carries an optional colour (RGB in [0, 1], typed simplecadapi.types.Color,
catalog kind 'color') and opacity. The material colour is the default; a body
colour overrides it for display only (mass never reads it). The op is recorded
(make_set_body_appearance_rpart) and replayed, pickles for the cell cache, and
reaches the live preview (node color/opacity), the legacy scene compiler
(base_color), the part definition (optional 'appearance' block in profiles 2
and 3; a definition without one keeps its bytes), the package scene (node
properties.color/opacity) and STEP (part colour, or a named and coloured XCAF
sub-shape per body). Material.color is typed Color too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:12:12 +08:00
NiJingzhe c2a456c493 surface: recorded edits of existing curves and surfaces (C++ kernel and bindings)
inspect_curve_rcurvedata / inspect_surface_rsurfacedata read the NURBS data of an Edge / Face (analytic geometry is
reported as its conversion, with the conversion op named). set/move poles, set weights, insert knot and elevate
degree for curves and surfaces, convert_to_bspline_redge/rface, rebuild_curve_redge/rface (least squares in the
shape's own parametrisation) and sample_curve_rcurvature / sample_surface_risocurves. Every edit returns a new shape
built by BRepTools_Modifier on an edited copy of the geometry: a face keeps its pcurves (its trimming in (u, v)), its
3D boundary curves and vertices are recomputed on the new surface. The rebuild's history is recorded as the node's
TopoDelta (face and edges modified/continuation). Doctests in tests/cpp/surface/test_editing.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:10:32 +08:00
NiJingzhe cd383f005d Merge branch 'fix/tag-view-cache' into feat/gui-modeling 2026-11-04 11:04:50 +08:00
NiJingzhe c8722c37cc fix(tags): a restored value counts a history-derived tag witness once
A value written out (pickle, cell cache) stores the lineage witnesses its history derived; restored with its
graph node, the tag view derives the same witnesses again, so Shape::lineage_witnesses() listed each twice and
a cache-restored body snapshotted to other bytes than a fresh one (test_multi_body_part
test_the_cell_cache_restores_a_multi_body_product: different content hashes).

lineage_witnesses() now skips a derived witness equal (same_witness: binding, derivation, source, target) to a
stored one. Regression tests: test_tagging.cpp (provider + stored witness = one witness), and the cell-cache
test in test_element_ref_history.py asserts a restored value encodes the same topology snapshot and the same
witness count as the fresh one, in a fresh process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:04:30 +08:00
NiJingzhe 2c15b2efd9 editor: the page is served no-cache so a rebuilt UI loads on the next visit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:58:22 +08:00
NiJingzhe 814871b868 merge research/stable-geometry-refs: references and tags resolve through recorded history (WIP: one multi-body cache test differs, being fixed) 2026-11-04 05:50:05 +08:00
NiJingzhe 37e6dd86fe merge research/multi-solid: a Part holds one Solid or several named bodies; a cut that splits a body gives its pieces
On top of the merge: the bindings it touched (cut_rsolid on_split, make_part_rpart body/bodies) take the typed signature
vocabulary; a kind = "part" notebook's implicit Part is made of all its open bodies (named by their variables, the pieces of a
split cut <name>_1..n) and is recorded in the definition (one result node, so its content hash is stable across cache hits);
product values are walked through their own children, not as plain dataclasses; the skill says how bodies and the implicit Part
work; the editor marks every body of the implicit Part as the product.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:39:13 +08:00
NiJingzhe 45d441ca01 feat(refs): persistence across the cell cache, bodies, naming version; design summary and plan
- A test restores a cell's lineage record in a fresh process and resolves a tag and a stable reference on the
  unpickled value through the restored deltas (tags and references survive the cell cache).
- References report the body (output slot / solid) of each target; element_ref.resolve reads the slot from the
  shape, so each body of a split result resolves to its own piece. A cut that leaves several bodies is not a
  reference error.
- kNamingVersion (scad-naming/1) is stamped into stable anchors; a reference made under another version still
  resolves and says version_changed.
- graph.hpp: from_value restores the deltas (stale comment fixed, SDK_DEFECTS 22).
- Design: summary, versioning and plan updated to what is done and what is next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:34:28 +08:00
NiJingzhe facccaaef5 feat(tags): tags are a view over the recorded history
A tag assignment is a graph node (apply_tag_rselection, every op-kwarg tag); the tags an entity of a node's
output carries from upstream are now computed from that node's graph, not copied per operation:

- scad::reactive tag view (reactive/tag_view.cpp): per node, from its inputs' views and its TopoDelta,
  witness by witness, as each binding's lineage policy allows (continuation_fragment: every piece of a split
  face); identity ops pass it on; memoised per immutable node, O(delta entries) per node. Installed as the
  topo layer's history-witness provider, so has_tag / list_tags / list_tag_bindings / explain_tag and every
  ql.tag see it with no API change.
- Scopes: effective (the default) = local + inherited + lineage.
- One path per binding: a recorded assignment's continuation is the view's only; the per-op copy in
  autotag.cpp now carries only what shapes alone know (imported provenance, sketch topology names, tags
  outside a session, replayed values) and an op's naming of what it generates (fillet patch, extrude side).
- merge_topo_deltas composes the steps of an N-ary boolean, so names and references cross the chain.
- Effect (audit, every family): plain face tags survive booleans, blends, shell, copies, patterns,
  transform/scale/offset/draft; op-kwarg tags survive blends and copies; primitive role tags follow their
  face. Changed expectations: nine Python-port goldens gain exactly those carried tags (only additions,
  reviewed); test_tagging_refactor / test_semantic_tagging / test_tagging.cpp / test_finalize.cpp assert
  effective includes lineage.
- Skill: ql-playbook ground rules 3 and 5 and the boundaries, ql-recipes, geometric-validation, ql.tag
  docstring and API page; design 3.1, 3.2 (target API), 6; SDK_DEFECTS 21 fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:23:42 +08:00
NiJingzhe 8ffc8c0d4d bindings: one vocabulary for signature types (Renamed<T, Tag>, AnyOf<Tag> and the meanings built from them); every operation's parameters are typed
The three branches had each grown a helper header (Typed/Shown, Renamed/Named, TypedObject/Choice/...); they are one
semantic_types.hpp now, with Length, Angle, Point3, Direction3, Vector3, Count, Choice and the plain-double/Vec3 variants as
names over the two tools. test_catalog now requires that no parameter of any operation reads "object". Stubs and API pages
regenerated. Full suite: 2494 passed, 63 skipped (the 7 collection errors are the untracked stale test files that predate
this work).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:20:44 +08:00
NiJingzhe 56d887be2f merge wip/types-geometry: typed geometry and feature signatures; one union rule in the catalog 2026-11-04 05:04:50 +08:00
NiJingzhe 76fcb1a355 editor: a grid of points (a control net) is a form slot; catalog reads rows of points as grid
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:03:10 +08:00
NiJingzhe 7556a4a059 bindings: geometry and feature operations say what each parameter means (Length, Angle, Point3, Direction3, Vector3, Count, Literal choices, selections) instead of object
The selections, sections, enum strings and paths keep loading exactly what they loaded (a named object caster prints the
honest union); the bodies are unchanged. SDK_DEFECTS 21: the angle arc takes radians, the chamfer angle a plain float.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:01:45 +08:00
NiJingzhe c41d366152 catalog: a union of spellings of one value has that value's kind (Sequence[Edge] | ShapeSelector, Literal[...] | Enum, Solid | Sequence[Solid]); str | PathLike is a path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:01:45 +08:00
NiJingzhe 9d172af805 merge wip/types-product-std: typed product, assembly and standard-library signatures 2026-11-04 04:59:57 +08:00
NiJingzhe 2ca4b7bf65 editor: a direction is plain numbers in the params cell, not millimetre sliders
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:59:07 +08:00
NiJingzhe cbebe6f74a catalog: product, assembly and std operations say what every parameter is
The product operators keep taking py::object (they check the type inside the operation), now as
Typed<Name> (typed_args.hpp), which accepts anything as before and prints the type in the signature:
Part, Assembly, Part | Assembly, Placement, ConnectorRef, ScalarLimit | None, str ids, Length
radii (phase_offset is a pitch-circle arc length), Angle drive angles, Point3 / Direction3 frames,
dict[str, Direction3] explode directions. The std factories wrap their double / int arguments as
Shown<T, Name> (converted exactly as T) to read Length, Angle, Count; fastener styles are Literal.
apply_tag_rselection (ShapeSelector | Sequence[AnyShape], Literal enums), load_brep_region (str |
os.PathLike), render_screenshot_rpath and the Python make_ball_bearing_rassembly are annotated with
simplecadapi.types.

catalog.classify: split unions before matching Literal/Sequence (a Literal-first union gave garbage
choices); new kinds path, scalar_limit, <kind>_map, joined union kinds (enum|numbers, query|shape);
str-enum defaults read as their value. SDK_DEFECTS 21-24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:58:19 +08:00
NiJingzhe 56d2a54442 Merge branch 'wip/types-surface-sketch' into feat/gui-modeling 2026-11-04 04:53:11 +08:00
NiJingzhe 4744e737d8 catalog: surface and sketch operations say what each parameter means (Length, Angle, Point3, Point2, Plane, SketchProfile, Literal choices)
Surface: control-point and fit grids are Sequence[Sequence[Point3]], patch points Sequence[Point3], cylinder radius/v_range
Length with origin Point3 and axis/x_direction Direction3 (u_range stays a unitless radian pair), loft sections
Sequence[Wire | Vertex], SurfaceBoundary.continuity Literal['C0', 'G1', 'G2'], smoothing a plain float triple.
Sketch: point coordinates, radii, chamfer/fillet sizes and distance/length/radius dimensions are Length, the angle
dimension Angle (degrees), positions Point2, extend/tangent ends and the tangent mode Literal, the plane Plane, profiles
SketchProfile, the project source Sketch | AnyShape | Sequence[AnyShape]. Values load exactly as before
(semantic_names.hpp: Renamed<T, Tag>, Named<Tag>); types.py gains Point2, Plane, SketchProfile and the catalog reads
them, SurfaceBoundary / SurfaceFillingSettings, and a sequence alternative of a union.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:52:28 +08:00
NiJingzhe 38d6e90db8 sca ops: the operation catalog on the command line; skill: how to find an operation and what its parameters mean, and that every SDK operation is a GUI feature (op.<name>)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:52:00 +08:00
NiJingzhe 9778a8e0a9 feat(product): owner decisions on multi-body parts
- A cut that splits the body is no longer refused: cut_rsolid(on_split="pieces")
  (the default) returns every piece as list[Solid] ordered by centroid, recorded as
  make_cut_rsolid_list with piece_order=centroid and replayed in that order;
  on_split="error" keeps the strict contract. One-piece cuts are unchanged.
- Pieces become bodies: make_part_rpart(body=pieces) -> body_1..n,
  bodies={"bar": pieces} -> bar_1..n.
- Overlapping bodies are allowed and warned: inspect_body_overlaps_rlist and a
  BodyOverlapWarning when the definition is built.
- Multi-body definitions use profile simplecad-part-definition-3 (new schema);
  profile 2 is back to its dev bytes, so profile-2 readers refuse them.
- part_from_bodies: the implicit-Part rule (all open bodies, named by variable).
- Skill pages, API docs, stubs, design doc section 9, SDK defect 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:46:26 +08:00
NiJingzhe e33f50e403 editor-web: forms for value slots (named values of the kinds an operation takes, lists in click order) and text; SDK operations get names from what they make
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:44:47 +08:00
NiJingzhe df38241ef8 fix(tracking): an input that stays in the result is preserved even when it also generates
query_history emitted preserved only for an input with neither Modified nor Generated images, so a shell's
kept face (unchanged, and the seed of its offset face) had no successor and shell.body_face was never proven
(owner decision on the kept-face gap: option a). Changed expectations, each reviewed:

- tracking goldens shell / extrude_rect / extrude_circle / loft / loft_ruled: the kept shell faces and rim
  edges, and the profile edges that bound the start cap of a prism or loft, gain a preserved witness (they
  are IsSame in the result); shell gains five shell.body_face roles.
- test_tracking_behaviour: loft toward a point 4 -> 8 entries (the base edges stay as the cap boundary);
  shell.body_face 0 -> 5 (the old comment 'every kept face was re-created' was wrong).
- Python-port goldens ops_features_shell / tag_projection: face.shell.body_face on the kept faces;
  blend_failures.shell_role no longer fails; test_operation_output_roles now asserts body_faces_tag tags the
  five kept faces instead of raising.
- shell_rsolid docstring and API page name the four roles; design 7.2; SDK_DEFECTS 23 fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:40:38 +08:00
NiJingzhe 2b3d5900ba editor: every SDK operation the forms can offer is a feature made from the catalog (op.<name>), not a hand-written template
op_specs.py turns each catalog entry into slots by kind (numbers into scad.var sliders, vectors into points, values by name, picked
faces and edges as selection recipes, Literal choices as enums); a solid made from nothing says how it meets the body. Tag parameters
stay code. Operations with a parameter the forms cannot offer are left out until their signature says what it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:40:35 +08:00
NiJingzhe c6149f483d style: keep the NOLINT on the conversion line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:26:23 +08:00
NiJingzhe 99d34d9522 catalog: the meaning of a parameter is its type in the binding (Length, Angle, Point3, Direction3, Vector3); simplecadapi.catalog reads every operation from the signatures
Bindings declare scad::pybind::Length etc. (thin wrappers that convert to the Scalar the kernel takes, so binding bodies do not change);
pybind writes simplecadapi.types.Length into the signature, the stubs and the API pages show it, and simplecadapi.catalog parses the
signatures of every *_r<kind> operation (and the standard library's Python ones) into typed parameters. Box and cylinder are the
pilot; test_catalog.py keeps the list of operations that still take untyped parameters, which only shrinks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:26:12 +08:00
NiJingzhe 035586906b feat(refs): history through transform/scale/offset/draft, stable anchors, split candidates
- modification_delta (semantic/tracking_modify.cpp) turns the retained OCCT history of the builders that
  finish through finish_solid into face and edge witnesses; transform_rsolid (rigid and affine: Copy +
  GTransform merged), scale_rsolid (uniform and per axis), offset_rsolid and draft_rsolid record it, so
  references follow faces through them (an offset or drafted face, generated in OCCT terms, continues its
  source face). The helical sweep was already covered by its tracked sweep node.
- Stable anchors: (feature, op, occurrence-among-ancestors) + params digest tie-break + kernel role;
  trace_to_birth anchors a picked entity where it was born. An operation inserted earlier in the cell no
  longer shifts the anchor; two indistinguishable candidates are lost(anchor_ambiguous), never a guess.
- Splits are an error with candidates (element_ref.require / ElementRefError / describe), lost references
  offer guard-ranked look-alikes.
- Docstrings and API pages of the four ops say they now carry history; SDK_DEFECTS 24 fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 04:21:26 +08:00
NiJingzhe b607c85248 feat(product): multi-body parts: a Part holds one Solid or several named bodies
Spike of design-docs/multi-solid-design.md. make_part_rpart(bodies={id: solid})
keeps several solids apart in one Part (not an assembly): Body values with
stable ids, Part.bodies / get_body / body_ids; Part.body raises on a multi-body
part instead of returning one body. Recorded and replayed, pickled for the cell
cache, previewed as one node per body (node/<part>/body:<id>), packaged with a
BRep and topology snapshot per body (solid_cache.bodies; one-body manifests are
byte-identical), drawn as solid child nodes in the package scene, exported to
STEP as one product holding every solid, flattened into assemblies, and weighed
per body by the new measure_part_mass_rmassreport.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:57:27 +08:00
NiJingzhe a607d3932d sketch: where curves cross is the SDK's answer (inspect_sketch_rsketchcrossings); the editor draws it instead of computing its own
The crossings are the ones trim_rsketch cuts at (the same solved geometry and intersection code), returned by the sketch solve the
editor already calls. The frontend's own intersection module is gone; its end-to-end coincidence tests moved to sketch-chain.test.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:50:24 +08:00
NiJingzhe da66680a08 feat(refs): resolve element references through recorded topology history (spike)
scad::reactive::resolve_by_history follows an anchor (node, slot, kind,
recorded topo id) through the TopoDelta every later node recorded from
OCCT history and answers ok / split / merged / lost, with the target
entities, the hops, and for a lost reference the node and reason
(deleted, replaced, no_history, not_downstream). Identity ops (tag
assignments, selections) are aliased by topo id; an op without history
loses the reference instead of guessing. anchors_for_role and
subshapes_by_recorded_id complete the loop.

Private bindings _resolve_by_history / _anchors_for_role /
_subshapes_by_recorded_id and the private wrapper
simplecadapi.topology.element_ref. Doctests over hand-built graphs;
pytest on the kernel: plain face tag after a boolean and a fillet,
extrude cap after a fillet of its edges, a face split by a cut, merged,
lost, edge -> fillet patch, a parameter sweep, creator caps, and a
per-family audit of tag channels versus history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:49:38 +08:00
NiJingzhe 073879fcff runtime: a kind = "part" notebook needs no product cell; its one open body is the Part
The header records the kind when the notebook is made. find_product (the one runtime function the headless run and the editor
kernel share) falls back to the open body: a public top-level solid no cell reads and no other candidate was built from (the
operation graph says so). Several open bodies are an error naming them. An explicit make_part_rpart cell still wins (connectors,
a body other than the tip). The editor no longer writes a product cell for such notebooks and shows the implicit product.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:43:29 +08:00
NiJingzhe 16b845f0c9 editor: pull or push a picked flat face along its normal (extrude_face), no sketch in between
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:24:16 +08:00
NiJingzhe 60fa2a8cfa editor: a hole drills along an axis, the picked face's normal or a free vector
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 02:06:33 +08:00
NiJingzhe fccd75e5e6 sketch: one source of truth for profiles (inspect_sketch_rsketchprofiles); the editor draws the SDK's loops instead of finding its own
The canvas found bounded faces of the line/arc graph itself and matched them to the solver's profiles by area and
centroid; the SDK offers only simple loops and chains, so a branched or tangent-trimmed sketch showed loops the SDK
did not have and 'the profile is still being matched' never cleared. The solve now returns the SDK's own list (indices
are the ones make_face_from_sketch_rface takes) plus why an edge set is none, and the canvas draws exactly those.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 18:50:34 +08:00
NiJingzhe b19b54f32a editor: a new solid says at once how it meets the body (join, cut, intersect)
A part holds one solid, so the operations that make a new solid (primitives, extrusions, revolutions, lofts, sweeps, and the
sketch extrude/revolve) get an Operation slot and a Combine-with slot instead of leaving a second body beside the first: the
solid is built as a private tool and joined to, cut from or intersected with the body so far in the same cell, the feature's
role follows the operation, and the product follows. 'New body' starts the first body. Slots can be shown only for some values
of another slot (show_when), and the feature state defaults the operation to join when a body exists.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 15:33:33 +08:00
NiJingzhe c0908d2ab9 editor: name clashes are a message, and a cell reported late is found by its code
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 03:54:04 +08:00
NiJingzhe f2aa06e122 editor: the new SDK operations through the sketch document and the assembly document
/api/sketch/op reaches fillet_corner, chamfer_corner and project (the source is another sketch feature of the notebook, named by
from_sketch); the assembly document can carry an exploded view: the product becomes scad.explode_rassembly of the solved assembly
and the factor is a slider variable.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 03:19:55 +08:00
NiJingzhe a4ddd705aa SDK: fillet_corner_rsketch, chamfer_corner_rsketch, project_rsketch and explode_rassembly
fillet_corner/chamfer_corner round or bevel the corner of two lines that share a point (tangent and radius/length constraints keep
it defined); project_rsketch brings geometry from another sketch or from the edges of a shape into a sketch as fixed construction
geometry, which is how sketches in different planes are related; explode_rassembly returns an assembly with the component
placements displaced for an exploded view (factor, centre or axis, per-component directions and weights). C++, bound,
recorded, replayable, stubbed, documented and tested like trim/extend.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 03:18:38 +08:00