refactor(tess): move per-entity tessellation into entities/
Each entity's tessellation now lives alongside its definition in
entities/*.rs, attached to the entity type via a local trait:
LegacyTess — Viewport / Insert / Hatch / Ole2Frame
(fallback path for entities not on the truck pipeline)
LeaderTess — Leader
MultiLeaderTess — MultiLeader
DimensionTess — Dimension (carries its dim-only helpers too:
~1700 lines of dim_geometry, dim_text_*, format_*,
tolerance, suppression, etc.)
scene/tessellate.rs keeps only the cross-entity dispatcher plus the
shared dim machinery reused by leader/multileader/dimension
(ArrowKind, DimGeom, append_arrow, arrow_from_block, add_segment,
add_polyline, normalized_or, push_tri, color_or_inherit, entity_z,
offset_snap_pts). Cross-entity arc helpers + aci_to_rgba moved to
scene/tess_util.rs.
scene/tessellate.rs shrinks from ~3300 to 809 lines. Compile clean,
all 9 tests pass.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
163725ca22
commit
aadb64860d
12 changed files with 3046 additions and 2862 deletions
|
|
@ -3,11 +3,20 @@ use acadrust::{CadDocument, EntityType};
|
|||
use crate::command::EntityTransform;
|
||||
use crate::scene::acad_to_truck::TruckEntity;
|
||||
use crate::scene::object::{GripApply, GripDef, PropSection};
|
||||
use crate::scene::tess_util::LegacyGeometry;
|
||||
|
||||
pub trait TruckConvertible {
|
||||
fn to_truck(&self, document: &CadDocument) -> Option<TruckEntity>;
|
||||
}
|
||||
|
||||
/// Legacy fallback geometry for entities not covered by the truck
|
||||
/// topology pipeline (Viewport, Insert, Hatch outline, Ole2Frame, …).
|
||||
/// Returns world-offset-relative `f32` points + snap/key vertices the
|
||||
/// dispatcher wraps into a `WireModel`.
|
||||
pub trait LegacyTess {
|
||||
fn legacy_geometry(&self, world_offset: [f64; 3]) -> LegacyGeometry;
|
||||
}
|
||||
|
||||
pub trait Grippable {
|
||||
fn grips(&self) -> Vec<GripDef>;
|
||||
fn apply_grip(&mut self, grip_id: usize, apply: GripApply);
|
||||
|
|
|
|||
Loading…
Reference in a new issue