fix: correct polyline arc direction, text precision, Face3D edge color, buffer chunking

- fix: polyline arc center sign was inverted (- → +) causing arcs to render on the
  wrong side in LwPolyline and Polyline2D
- fix: store glyph strokes in local space with f64 origin so world_offset subtraction
  uses f64 precision; prevents blocky text at large UTM coordinates
- fix: Face3D fill darkened to 45% so edge wires are visually distinct from fill
- fix: wire batch vertex buffer chunked to 256 MB GPU limit (was panic on large files)
- fix: gpu_face3d_edges changed from Option<WireGpu> to Vec<WireGpu> to support chunks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-29 20:58:44 +03:00
commit 1a19a841e6
11 changed files with 136 additions and 113 deletions

View file

@ -4,7 +4,7 @@ use glam::Vec3;
use crate::command::EntityTransform;
use crate::entities::common::{edit_prop as edit, ro_prop as ro, square_grip};
use crate::entities::traits::{Grippable, PropertyEditable, Transformable, TruckConvertible};
use crate::scene::acad_to_truck::{TruckEntity, TruckObject};
use crate::scene::acad_to_truck::{TextStroke, TruckEntity, TruckObject};
use crate::scene::object::{GripApply, GripDef, PropSection};
use crate::scene::wire_model::SnapHint;
use crate::scene::{cxf, transform};
@ -138,14 +138,13 @@ fn tessellate_tolerance(tol: &Tolerance) -> Vec<Vec<[f32; 2]>> {
let total_w: f32 = col_widths.iter().sum();
let total_h = cell_h * rows.len() as f32;
// ── Transform helpers (world 2-D, ignoring Z for Text path) ──────────
let ox = tol.insertion_point.x as f32;
let oy = tol.insertion_point.y as f32;
// ── Transform helpers (local space — translation applied in tessellate.rs) ──
let angle = (tol.direction.y as f32).atan2(tol.direction.x as f32);
let (sa, ca) = angle.sin_cos();
// Rotate only; origin is kept as f64 and applied later with full precision.
let rot = |x: f32, y: f32| -> [f32; 2] {
[ox + x * ca - y * sa, oy + x * sa + y * ca]
[x * ca - y * sa, x * sa + y * ca]
};
let mut out: Vec<Vec<[f32; 2]>> = Vec::new();
@ -228,12 +227,12 @@ impl TruckConvertible for Tolerance {
self.insertion_point.z as f32,
);
// Build the feature-control frame: box outline + cell text, all
// represented as 2-D CXF polylines (TruckObject::Text).
let polylines = tessellate_tolerance(self);
// Build the feature-control frame in local space; origin stored as f64.
let strokes = tessellate_tolerance(self);
let origin = [self.insertion_point.x, self.insertion_point.y];
Some(TruckEntity {
object: TruckObject::Text(polylines),
object: TruckObject::Text(vec![TextStroke { strokes, origin }]),
snap_pts: vec![(snap_pt, SnapHint::Insertion)],
tangent_geoms: vec![],
key_vertices: vec![],