refactor(tess): rename LegacyTess → FallbackTess

The trait isn't deprecating anything — it carries the path entities
take when they're not covered by the truck topology pipeline
(Viewport, Insert, Hatch outline, Ole2Frame). "Fallback" names the
purpose; "Legacy" implied retirement that isn't actually on the
roadmap.

Same rename for LegacyGeometry → FallbackGeometry,
legacy_geometry() → fallback_geometry().

Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.7 committed 2026-05-23 23:16:57 +03:00
1 parent aadb64860d
commit b413fe0efe
8 files changed
+35 -36

No files matched your search

+1 -1
View File
@@ -1275,7 +1275,7 @@ impl Scene {
return false;
}
// Block/BlockEnd are block-defn sentinels, not drawable geometry.
// Without this skip they fall through to legacy_geometry's `_`
// Without this skip they fall through to fallback_geometry's `_`
// arm and emit a 1-unit phantom segment at world_offset that
// poisons fit_all and shows up in selection.
if matches!(e, EntityType::Block(_) | EntityType::BlockEnd(_)) {
+5 -6
View File
@@ -10,14 +10,13 @@ use glam::Vec3;
use crate::scene::wire_model::{SnapHint, TangentGeom, WireModel};
/// Output of the legacy per-entity geometry path used by entities not
/// (yet) covered by the truck topology pipeline (Viewport, Insert,
/// Hatch outline, Ole2Frame, …). Tuple form preserved to avoid
/// touching every callsite when the dispatcher wraps these into a
/// WireModel.
/// Output of the fallback per-entity geometry path used by entities not
/// covered by the truck topology pipeline (Viewport, Insert, Hatch
/// outline, Ole2Frame). Tuple form preserved to avoid touching every
/// callsite when the dispatcher wraps these into a WireModel.
///
/// Layout: `(points, snap_pts, tangent_geoms, key_vertices)`.
pub type LegacyGeometry = (
pub type FallbackGeometry = (
Vec<[f32; 3]>,
Vec<(Vec3, SnapHint)>,
Vec<TangentGeom>,
+13 -13
View File
@@ -10,8 +10,8 @@
// TruckTessResult::Mesh → MeshModel
// TruckObject::Text → one WireModel per glyph stroke (elevation from entity Z)
//
// Entities not handled by acad_to_truck (Viewport, Hatch, …) are tessellated
// by the legacy geometry() path so nothing regresses.
// Entities not handled by acad_to_truck (Viewport, Insert, Hatch, Ole2Frame)
// are tessellated by the FallbackTess fallback_geometry() path.
use crate::entities::leader::LeaderTess;
use acadrust::types::Color as AcadColor;
@@ -428,8 +428,8 @@ pub fn tessellate(
}
}
// ── Legacy fallback for Viewport and other unhandled types ────────────
let (points, snap_pts, tangent_geoms, key_vertices) = legacy_geometry(entity, world_offset);
// ── Fallback for Viewport / Insert / Hatch / Ole2Frame ────────────────
let (points, snap_pts, tangent_geoms, key_vertices) = fallback_geometry(entity, world_offset);
vec![WireModel {
name,
points,
@@ -603,21 +603,21 @@ pub(crate) fn entity_z(entity: &EntityType) -> f32 {
}
}
// ── Legacy geometry (Viewport, Hatch outline, unrecognised) ───────────────
// ── Fallback geometry (Viewport, Insert, Hatch outline, Ole2Frame) ───────
//
// Per-entity blocks have moved to their respective `entities/*.rs` files
// (Viewport, Insert, Hatch, Ole2Frame) via the `LegacyTess` trait. This
// (Viewport, Insert, Hatch, Ole2Frame) via the `FallbackTess` trait. This
// function stays as the dispatcher used by the main `tessellate()` path.
use crate::entities::traits::LegacyTess;
use crate::scene::tess_util::LegacyGeometry as Geometry;
use crate::entities::traits::FallbackTess;
use crate::scene::tess_util::FallbackGeometry as Geometry;
fn legacy_geometry(entity: &EntityType, world_offset: [f64; 3]) -> Geometry {
fn fallback_geometry(entity: &EntityType, world_offset: [f64; 3]) -> Geometry {
match entity {
EntityType::Viewport(vp) => vp.legacy_geometry(world_offset),
EntityType::Insert(ins) => ins.legacy_geometry(world_offset),
EntityType::Hatch(h) => h.legacy_geometry(world_offset),
EntityType::Ole2Frame(ole) => ole.legacy_geometry(world_offset),
EntityType::Viewport(vp) => vp.fallback_geometry(world_offset),
EntityType::Insert(ins) => ins.fallback_geometry(world_offset),
EntityType::Hatch(h) => h.fallback_geometry(world_offset),
EntityType::Ole2Frame(ole) => ole.fallback_geometry(world_offset),
_ => {
let s = 0.5_f32;
(vec![[-s, 0.0, 0.0], [s, 0.0, 0.0]], vec![], vec![], vec![])