mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-04 19:15:57 +00:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BnQawySUFx57iaJZq7z1Fm
This commit is contained in:
@@ -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] = [
|
||||
|
||||
Reference in New Issue
Block a user