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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
/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>
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>