Expand description
Solve wiring — call the kernel’s 2D constraint solver in-process.
brep-render links the kernel crate directly (a plain Rust path dependency,
for BOTH native and the wasm canvas build), so the solver is reached by a
direct brep_kernel::solve_sketch(&SolveSketchRequest) call on every
target — there is NO wasm-bindgen JSON hop (that boundary only existed for the
previous app calling INTO the wasm module from the browser; here the solver is
compiled into the same binary/module). The solver is pure numeric Rust with no std::time,
so it is wasm-clean.
The solver returns {sketch: {points, geometries, constraints, diagnostics}}.
We split that into the solved SketchDoc (the three editable arrays) and the
read-only SketchDiagnostics the overlay coloring + DOF readout consume.
Structs§
- Sketch
Solver Settings - User-tunable 2D solver knobs (the “Solver Settings” section), all optional
—
Nonekeeps the kernel’s default. Held on thesuper::SketchSessionand read by everyresolve, so a change re-solves with the new settings without threading params through each edit path.
Functions§
- solve
- Solve
docand return the solved coordinates plus the constraint diagnostics. - solve_
with - Like
solve, but with user-tunableSketchSolverSettings(the Solver Settings panel). Default settings reproducesolvebyte-for-byte.