fix(precision): keep typed hatch boundaries exact in f64 (#311)
The HATCH/GRADIENT/BOUNDARY commands built the persisted hatch through the render-side boundary (f32 offsets from world_origin), and with a zero world_origin that meant absolute f32 - so a typed boundary vertex of 2000.8 was stored as 2000.8020, and at UTM scale the fill landed far from its boundary. HatchModel.boundary stays f32 (the GPU render contract). Added HatchModel.boundary_wcs: Option<Arc<Vec<[f64;2]>>>, an exact absolute-WCS boundary set only by the draw commands. Scene::add_hatch persists from boundary_wcs when present (exact f64 -> DxfHatch), else falls back to the f32 + world_origin reconstruction used by DXF-rebuilt hatches. manual_pts is now Vec<DVec3>; make_hatch takes the f64 boundary, stores the exact copy and derives the RTE render rep. The committed render model is rebuilt from the DXF entity, so nothing renders the command model's f32 boundary. This also fixes command hatches mis-placing at large coordinates (world_origin was [0,0]). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
57710eec2b
commit
1f89b78a7e
6 changed files with 106 additions and 43 deletions
|
|
@ -241,6 +241,7 @@ fn app_created_hatch_roundtrips_catalog_spacing() {
|
|||
let model = HatchModel {
|
||||
world_origin: [0.0, 0.0],
|
||||
boundary: Arc::new(boundary),
|
||||
boundary_wcs: None,
|
||||
pattern: entry.gpu.clone(),
|
||||
name: "ANSI31".into(),
|
||||
color: [0.75, 0.75, 0.75, 0.85],
|
||||
|
|
|
|||
Loading…
Reference in a new issue