Skip to main content

Module solve

Module solve 

Source
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§

SketchSolverSettings
User-tunable 2D solver knobs (the “Solver Settings” section), all optional — None keeps the kernel’s default. Held on the super::SketchSession and read by every resolve, so a change re-solves with the new settings without threading params through each edit path.

Functions§

solve
Solve doc and return the solved coordinates plus the constraint diagnostics.
solve_with
Like solve, but with user-tunable SketchSolverSettings (the Solver Settings panel). Default settings reproduce solve byte-for-byte.