refactor(tess): move solid sampling to kernel

Remove local face, edge, spline, sweep, loft, and silhouette
samplers. Meshes and overlays share the kernel tolerance and edge
schedule.
This commit is contained in:
Hakan Seven committed 2026-08-10 10:18:53 +03:00
1 parent 60f5bca0d4
commit dc998fe46b
15 files changed
+410 -3938

No files matched your search

+1 -35
View File
@@ -1922,7 +1922,6 @@ fn fallback_geometry(entity: &EntityType) -> Geometry {
| EntityType::Region(_)
| EntityType::Body(_)
| EntityType::Surface(_) => {
let pts = solid_wire_fallback(entity);
let mut snap = vec![];
if let Some(p) = crate::entities::solid3d::point_of_reference(entity) {
snap.push((
@@ -1930,7 +1929,7 @@ fn fallback_geometry(entity: &EntityType) -> Geometry {
SnapHint::Insertion,
));
}
(pts, snap, vec![], vec![])
(vec![], snap, vec![], vec![])
}
_ => {
let s = 0.5_f64;
@@ -1939,39 +1938,6 @@ fn fallback_geometry(entity: &EntityType) -> Geometry {
}
}
/// Extract pre-computed edge-wire points from Solid3D / Region / Body entities.
///
/// Some drawings store explicit wire geometry alongside the
/// ACIS data. We use this as a visible fallback when the SAT tessellator
/// produces no mesh (e.g. binary SAB data or unsupported geometry).
fn solid_wire_fallback(entity: &EntityType) -> Vec<[f64; 3]> {
let Some(wires) = crate::entities::solid3d::fallback_wires(entity) else {
return vec![];
};
if wires.is_empty() {
return vec![];
}
// Fully supported ACIS → mesh pipeline draws body. Parseable-but-partial
// ACIS keeps source display wires so unsupported faces never disappear.
if crate::entities::solid3d::acis_has_complete_surface_support(entity) {
return vec![];
}
let mut pts: Vec<[f64; 3]> = Vec::new();
for wire in wires {
if wire.points.len() < 2 {
continue;
}
for v in &wire.points {
let transformed = crate::entities::solid3d::wire_point(wire, v);
pts.push([transformed.x, transformed.y, transformed.z]);
}
// NaN sentinel separates distinct wire segments.
pts.push([f64::NAN, f64::NAN, f64::NAN]);
}
pts
}
pub(crate) fn push_tri(out: &mut Vec<[f32; 3]>, a: Vec3, b: Vec3, c: Vec3) {
out.push([a.x, a.y, a.z]);
out.push([b.x, b.y, b.z]);