forked from 1b-agent/opencadstudio-upstream
fix(solid3d): keep loaded-solid mesh verts f64 until the RTE split
Loaded 3DSOLID faces rendered on a ~0.06 m grid and crawled against their own wireframe at UTM scale. Both ACIS tessellation paths cast each vertex f64→f32 in the samplers, and only split the double-single low half (verts_low) when the body carried a `transform` record. But many files — budweiser among them — store solid geometry in absolute coordinates with no body transform, so verts_low stayed empty: the GPU got position_low = 0 and reconstructed an already f32-quantized absolute position, while the feature edges (split unconditionally from f64) stayed exact. Both paths now accumulate vertices in f64 and hand them to one finalize step: finalize_mesh(name, verts_f64, normals, indices, color, xform) the only place a solid vertex becomes f32 — it computes the world coordinate in f64 (body placement applied, or identity), then splits into (verts, verts_low) unconditionally, exactly as attach_feature_edges already does for the wireframe. push_quad / tess_plane_face / tess_cone_face / tess_sphere_face / tess_torus_face / tess_spline_face and the truck append_group / bespoke_face / append_spline_faces all carry f64; apply_body_transform is gone. Verified on budweiser (all solids, body_transform = NONE): verts_low is now populated with the captured residual, max |low| ≈ 0.0624 m. The Model-tab (truck_tess::polygon_to_result) and edge paths were already correct and are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
608cf8c74b
commit
340a358c26
3 files changed
+115
-91
No files matched your search
@@ -56,7 +56,7 @@ pub fn tess_spline_face(
|
||||
sat: &SatDocument,
|
||||
face: &SatFace,
|
||||
lod: LodConfig,
|
||||
verts: &mut Vec<[f32; 3]>,
|
||||
verts: &mut Vec<[f64; 3]>,
|
||||
normals: &mut Vec<[f32; 3]>,
|
||||
indices: &mut Vec<u32>,
|
||||
) {
|
||||
@@ -90,7 +90,7 @@ pub fn tess_spline_face(
|
||||
let u = u0 + (u1 - u0) * (i as f64 / su as f64);
|
||||
let p = surface.subs(u, v);
|
||||
let n = surface.normal(u, v);
|
||||
verts.push([p.x as f32, p.y as f32, p.z as f32]);
|
||||
verts.push([p.x, p.y, p.z]);
|
||||
normals.push([n.x as f32, n.y as f32, n.z as f32]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user