refactor: drop truck, and evaluate every curve through the kernel

The last four truck crates are gone from the manifest. What they were doing
falls into three parts, and each now has one answer instead of two.

NURBS evaluation. truck was carrying B-spline curves and surfaces for the
SPLINE entity, hatch boundaries, BLEND's endpoint frames, the spline preview
and ACIS spline-surface faces. The kernel now has both, over one de Boor
written across however many coordinates a control point holds — so a plane
curve and a space curve cannot drift apart, and a surface is the same
algorithm applied twice. The rational and the polynomial cases stop being
separate types: weights absent means polynomial.

The entity conversion. Every LINE, ARC, ELLIPSE, SPLINE and polyline was
built into truck topology purely so it could be sampled back into points.
They are sampled through `entities::curve` now, which is where each one's
geometry is already defined once and what EXTRUDE and REVOLVE read — so a
circle drawn on screen and a circle handed to the Model tab come from the
same definition. That retires four of TruckObject's variants and the module
is renamed for what it does.

SWEEP and LOFT. Both only ever produced a mesh, so both are built from point
lists: a band of quads per span, and a lid where a profile closes. Lofting
profiles of different densities resamples them by distance rather than by
index, so a circle lofted to a square no longer twists.

Two things worth noting for anyone reading the old comments. The tolerance
globals that lived in the tessellation module were never about truck at all —
they are the per-frame chord height, and they move to `curve_tol`. And the
rule that a profile handed over as `Lines` silently broke EXTRUDE and REVOLVE
no longer holds: those read the curve directly and never look at this channel.

The two `automation` test failures are unchanged from before this and are not
caused by it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5 committed 2026-08-10 01:08:50 +03:00
1 parent 1f642bb40a
commit 8c7ebdc9f1
58 files changed
+947 -1761

No files matched your search

+4 -4
View File
@@ -32,7 +32,7 @@ impl super::OpenCADStudio {
/// selected solids whose B-reps are in the session cache.
pub(super) fn solid_boolean(&mut self, op: BoolOp) -> Task<Message> {
let i = self.active_tab;
// Selected entities that have a cached truck B-rep.
// Selected entities that have a cached B-rep.
let handles: Vec<Handle> = self.tabs[i]
.scene
.selected
@@ -63,7 +63,7 @@ impl super::OpenCADStudio {
self.tabs[i].scene.erase_entities(&handles);
// The result is freshly combined geometry with no ACIS parametrisation,
// so it lives as a Solid3D whose render/boolean data is the injected
// truck mesh + cached B-rep; its edge wires make it pickable.
// mesh + cached B-rep; its edge wires make it pickable.
let mut s3d = Solid3D::new();
s3d.wires = solid_model::edge_wires(&result);
let handle = self.add_solid_model(EntityType::Solid3D(s3d), result);
@@ -79,7 +79,7 @@ impl super::OpenCADStudio {
/// Slice the one selected solid with an axis-aligned plane (axis 0/1/2 =
/// X/Y/Z at `value`), keeping the lower side when `keep_low` is true. The
/// kept half is the intersection of the solid with a half-space box, reusing
/// the same truck-shapeops path as the boolean tools.
/// the same boolean path the Design-group tools use.
pub(super) fn solid_slice(&mut self, axis: usize, value: f64, keep_low: bool) -> Task<Message> {
let i = self.active_tab;
let handles: Vec<Handle> = self.tabs[i]
@@ -191,7 +191,7 @@ impl super::OpenCADStudio {
/// 3DROTATE — rotate the one selected solid about the X/Y/Z axis (0/1/2)
/// through its centre by `angle_deg` degrees. Rotation preserves the solid's
/// orientation, so it reuses the cached truck B-rep directly.
/// orientation, so it reuses the cached B-rep directly.
pub(super) fn solid_rotate3d(&mut self, axis: usize, angle_deg: f64) -> Task<Message> {
let i = self.active_tab;
let handles: Vec<Handle> = self.tabs[i]