mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-05 03:25:58 +00:00
engine, kernel-cases: tangent joins out of the corner-pick count; 3383 and 5024 recipes to main's rules
The corner pick (#5173) counts the edges meeting at a picked point; seams already did not count, and now a tangent join between two spans of one smooth curve does not either (4332: a chamfer on a spline rim was refused as two edges). 3383: the first occurrence is grounded by default on main, so the recipe ungrounds it before moving it. 5024: a hole's position must lie on a face, so the centre is on the box's top edge; the volume is half of the drilled cut, exact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1451,7 +1451,9 @@ fn edge_points(s: &Session, p: &Value, cmd: &str) -> Result<Vec<Vec3>> {
|
||||
// The display mesh flags seams (a smooth surface meeting itself, as down the side
|
||||
// of a cylinder), which nobody means by a pick where they end.
|
||||
match b.body.mesh(&solidcraft_kernel::MeshTolerance::chord(tol)) {
|
||||
Ok(m) => Some((size, m.edges, m.seams)),
|
||||
// An edge where the faces meet tangentially (the spans of a spline wall
|
||||
// meeting) can't be blended either: nobody means it by a pick.
|
||||
Ok(m) => Some((size, m.edges, m.seams.iter().zip(&m.smooth_edges).map(|(s, t)| *s || *t).chain(m.seams.iter().skip(m.smooth_edges.len()).copied()).collect())),
|
||||
Err(_) => b.body.edges(tol).ok().map(|edges| (size, edges.into_iter().map(|e| e.points).collect(), Vec::new())),
|
||||
}
|
||||
})
|
||||
@@ -1459,7 +1461,8 @@ fn edge_points(s: &Session, p: &Value, cmd: &str) -> Result<Vec<Vec3>> {
|
||||
});
|
||||
// A point where several edges meet (a corner) is ambiguous: the kernel would round one of
|
||||
// them, picked silently (#5173). Edges that carry straight on through the point (the two
|
||||
// halves of a circle) are one edge to whoever picked it, and seams don't count. Directions
|
||||
// halves of a circle) are one edge to whoever picked it, and seams and tangent joins don't
|
||||
// count. Directions
|
||||
// come from the polylines' end chords, which lean off a curve's tangent: within about 45°
|
||||
// of opposite counts as carrying on (edges at a real corner are far from opposite).
|
||||
let mut nearest = f64::INFINITY;
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
"component": "root"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Part:1",
|
||||
"grounded": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.move",
|
||||
"params": {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
"sources": [
|
||||
"tangency-labs/solidcraft#5024"
|
||||
],
|
||||
"what": "a drilled O8 hole, 10 deep with a 118 deg point, placed 1 mm off a 40x30x20 box's top face, across its edge: 17-54 s in truck",
|
||||
"what": "a drilled O8 hole, 10 deep with a 118 deg point, centred on the top edge of a 40x30x20 box (x = 0): half of it in the box, across the edge: 17-54 s in truck",
|
||||
"source": "analytic",
|
||||
"method": "the hole's axis is at x = -1, y = 15, so only its part at x >= 0 removes material: the circular segment of the O8 section beyond x = 0 (r^2 acos(d/r) - d sqrt(r^2-d^2), d = 1) over the 10 mm to the shoulder, plus the same segment of the point cone's section (radius 4 - s tan59 at s below the shoulder, down to radius 1), integrated (python quadrature). V = 24000 - 172.16874 - 11.10370",
|
||||
"method": "the hole's axis lies in the box's side plane x = 0, so the box keeps half of the drilled cut: V = 40*30*20 - (pi r^2 d + pi r^2 h/3)/2, r = 4, d = 10, the point's height h = r / tan 59 deg (main refuses a position off the face, so the centre is on the edge, not 1 mm past it)",
|
||||
"body_count": 1,
|
||||
"volume_mm3": 23816.7276
|
||||
"volume_mm3": 23728.5376
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"command": "solid.hole",
|
||||
"params": {
|
||||
"position": [
|
||||
-1,
|
||||
0,
|
||||
15,
|
||||
20
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user