forked from 1b-agent/opencadstudio-upstream
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 <[email protected]>
This commit is contained in:
1 parent
1f642bb40a
commit
8c7ebdc9f1
58 files changed
+947
-1761
No files matched your search
+4
-9
@@ -1,5 +1,5 @@
|
||||
// Scene modules grouped by role:
|
||||
// convert — DXF/ACIS entities → truck solids & tessellated geometry
|
||||
// convert — DXF/ACIS entities → solids & tessellated geometry
|
||||
// text — LFF stroke + TrueType font engines and shaping
|
||||
// model — per-entity GPU render models (wire, hatch, mesh, image, object)
|
||||
// pick — hit-testing, selection, grips, spatial index, xclip
|
||||
@@ -147,11 +147,6 @@ use acadrust::objects::ObjectType;
|
||||
use acadrust::types::Vector2;
|
||||
use acadrust::{CadDocument, EntityType, Handle, TableEntry};
|
||||
use glam;
|
||||
use truck_modeling::{
|
||||
base::{BoundedCurve, ParameterDivision1D},
|
||||
BSplineCurve as TruckBSpline, KnotVec, NurbsCurve, Point3, Vector4,
|
||||
};
|
||||
|
||||
use iced::time::Duration;
|
||||
use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
|
||||
use std::cell::RefCell;
|
||||
@@ -1767,7 +1762,7 @@ pub struct Scene {
|
||||
pub viewcube_ucs: glam::Mat4,
|
||||
/// GPU render data for hatch fills, keyed by the DXF entity Handle.
|
||||
pub hatches: HashMap<Handle, HatchModel>,
|
||||
/// GPU render data for solid meshes (truck Shell/Solid tessellation).
|
||||
/// GPU render data for solid meshes (the kernel Shell/Solid tessellation).
|
||||
/// Top-level (layout-owned) solids only, stored in the offset-relative
|
||||
/// render frame and drawn flat.
|
||||
pub meshes: HashMap<Handle, MeshLodSet>,
|
||||
@@ -8334,11 +8329,11 @@ impl Scene {
|
||||
struct CurveTolGuard;
|
||||
impl Drop for CurveTolGuard {
|
||||
fn drop(&mut self) {
|
||||
crate::scene::convert::truck_tess::set_curve_tol_override(None);
|
||||
crate::scene::convert::curve_tol::set_curve_tol_override(None);
|
||||
}
|
||||
}
|
||||
let _tol_guard = wpp.map(|w| {
|
||||
crate::scene::convert::truck_tess::set_curve_tol_override(Some((w * 0.5) as f64));
|
||||
crate::scene::convert::curve_tol::set_curve_tol_override(Some((w * 0.5) as f64));
|
||||
CurveTolGuard
|
||||
});
|
||||
// Per-entity tessellation memo. Same classify/tessellate logic, two
|
||||
|
||||
Reference in new issue
Block a user