From 8eb93ff0639a57b2ca035542493b590f3f10db3c Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Fri, 23 Oct 2026 23:38:38 -0400 Subject: [PATCH] step_in tests: the cube fixture's edges lie on their lines Every edge of the hand-written cube was a LINE along one filler direction, trimmed by vertices up to 1 mm off it; the reader refuses such an edge (a degenerate edge on a line). Each edge now has the line through its two vertices, so the assembly, instancing and unit tests read a valid cube. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BnQawySUFx57iaJZq7z1Fm --- crates/kernel/src/step_in/tests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/kernel/src/step_in/tests.rs b/crates/kernel/src/step_in/tests.rs index ed6e0f1b4..e9d3c173c 100644 --- a/crates/kernel/src/step_in/tests.rs +++ b/crates/kernel/src/step_in/tests.rs @@ -465,11 +465,13 @@ fn cube_entities() -> String { for (i, (x, y, z)) in pts.iter().enumerate() { s += &format!("#{}=CARTESIAN_POINT('',({x}.,{y}.,{z}.));\n#{}=VERTEX_POINT('',#{});\n", 200 + i, 210 + i, 200 + i); } - // 12 edges as lines (direction vector filler; trimmed by vertices). + // 12 edges, each on the line through its two vertices (trimmed by them). let edges = [(0, 1), (1, 2), (2, 3), (3, 0), (4, 5), (5, 6), (6, 7), (7, 4), (0, 4), (1, 5), (2, 6), (3, 7)]; - s += "#290=DIRECTION('',(1.,0.,0.));\n#291=VECTOR('',#290,1.);\n"; for (k, (a, b)) in edges.iter().enumerate() { - s += &format!("#{}=LINE('',#{},#291);\n#{}=EDGE_CURVE('',#{},#{},#{},.T.);\n", 300 + k, 200 + a, 320 + k, 210 + a, 210 + b, 300 + k); + let (p, q) = (pts[*a], pts[*b]); + let d = (q.0 - p.0, q.1 - p.1, q.2 - p.2); + s += &format!("#{}=DIRECTION('',({}.,{}.,{}.));\n#{}=VECTOR('',#{},1.);\n", 600 + 2 * k, d.0, d.1, d.2, 601 + 2 * k, 600 + 2 * k); + s += &format!("#{}=LINE('',#{},#{});\n#{}=EDGE_CURVE('',#{},#{},#{},.T.);\n", 300 + k, 200 + a, 601 + 2 * k, 320 + k, 210 + a, 210 + b, 300 + k); } // Faces: (edge, forward?) loops counter-clockwise seen from outside, and plane frames. let faces: [(&[(usize, bool)], (i32, i32, i32), (i32, i32, i32)); 6] = [