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 SevenandClaude Sonnet 4.6 committed 2026-04-29 20:58:44 +03:00
1 parent 02203dba93
commit 1a19a841e6
11 files changed
+136 -113

No files matched your search

+19 -17
View File
@@ -64,27 +64,29 @@ pub fn tessellate(
if let Some(te) = convert(entity, document) {
match te.object {
// ── Text / MText: pre-tessellated glyph strokes ───────────────
TruckObject::Text(strokes_2d) => {
// Glyph strokes come from acad_to_truck in world-space f32.
// Subtract world_offset (f32 subtraction — acceptable precision
// for text rendering; the anchor was already cast to f32 there).
TruckObject::Text(stroke_groups) => {
// Each TextStroke keeps its strokes in glyph-local space and
// its world origin as f64. Subtract world_offset in f64 before
// casting to f32 so large UTM coordinates don't crush precision.
let [ox, oy, oz] = world_offset;
let elev = entity_z(entity) - oz as f32;
// Pack all strokes into one flat point list, separated by
// NaN sentinels so wire_gpu.rs skips disconnected segments.
let mut points: Vec<[f32; 3]> = Vec::new();
for (i, stroke) in strokes_2d.iter().enumerate() {
if stroke.len() < 2 {
continue;
}
if i > 0 && !points.is_empty() {
// NaN sentinel — wire_gpu skips any segment where
// either endpoint contains NaN.
points.push([f32::NAN, f32::NAN, f32::NAN]);
}
for &[x, y] in stroke {
points.push([x - ox as f32, y - oy as f32, elev]);
let mut first = true;
for group in &stroke_groups {
let lx = (group.origin[0] - ox) as f32;
let ly = (group.origin[1] - oy) as f32;
for stroke in &group.strokes {
if stroke.len() < 2 {
continue;
}
if !first && !points.is_empty() {
points.push([f32::NAN, f32::NAN, f32::NAN]);
}
first = false;
for &[x, y] in stroke {
points.push([x + lx, y + ly, elev]);
}
}
}