b2525ed34ebdd790a091292ea4603fb00cea56bc
8 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b2525ed34e |
Tests: the six timing assertions do not depend on the wall clock (#6917) (#6925)
* claim: #6917 * Tests: the six timing assertions do not depend on the wall clock (#6917) Six tests asserted on the wall clock. Their result depended on how loaded the machine was and not only on the code under test: they passed on an idle machine and failed when the test binaries ran beside each other, which is how the suite runs (`cargo xtask test` starts every test binary at once). CONTRIBUTING.md:196 says it: "Tests run beside each other on a busy machine, so a test must not depend on wall-clock timing." The change is confined to the six test files the issue names: - geom: the tangent chain of a helix is a ratio (750 pieces against 3 000) instead of a limit of 200 ms. - io: the placement budget is spent inside the reader, so the clock is gone. - ui-egui: the classification of many faces is a ratio (900 against 3 600) instead of a limit of 10 s. - engine: the clearance measurement drops its 30 s limit; the boolean that gives up reports itself. - engine: the fillet beside a modelled thread is a ratio (a 1 mm thread against an 8 mm one) instead of a limit of 30 s. - ui-egui: the window frame budget goes from 250 ms to 20 s, the limit #6072 gave its own probe. The helper is the one #649 wrote, copied into the crates that need it, with the noise of a run as a parameter. |
||
|
|
e29a57dc3a |
inspect.interference/clearance: list mesh bodies as unchecked (#3249) (#3258)
* claim: #3249 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * inspect.interference/clearance: list mesh bodies as unchecked Mesh bodies (STL, 3MF and OBJ imports) were filtered out before any pair was formed, so two overlapping STL imports reported count 0 and an empty unchecked list, which reads as "no collision". Each mesh body is now listed in `unchecked` as {a: name, b: null, reason: "mesh body: not checked"} by both commands. inspect.clearance also stops refusing a mesh body named in `bodies` or `against` as "no solid body"; it is listed instead. The parameter docs and the assemblies guide say so. Fixes #3249 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs: separate the mesh-body note from the paragraph above Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
e661e6f809 |
inspect.clearance: pins on one cylinder with their hole are answered or reported in seconds (#3027)
* inspect.clearance: pairs whose bodies did not change are not measured again Each clearance check measured every close pair again, though between two checks usually only a few bodies change or move. Results are now kept per pair, keyed by both bodies' geometry and placement and the check's settings; a pair whose two bodies are unchanged is taken from that cache. With 40 overlapping parts, a check after moving one of them took 0.8 s instead of 23 s (741 of 780 pairs reused). Pairs that could not be worked out are tried again each time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * inspect.clearance: boxes and placed keys exactly as before the reuse The pair boxes are taken over the mesh's triangles with finite corners, as a distance shape's are, so pruning is unchanged. A placed body's identity now includes its model body's own frame, so two placements are never mistaken for one another. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * inspect.clearance: a large body is meshed once for all its pairs Each pair that touches cuts the larger body down to the pair's region with a kernel boolean, and that boolean meshed the whole body twice: once for its checks and once inside the intersection. A sheet with 600 faces paid about 2.5 s per pair for meshes that were the same every time. A body can now keep its meshes for reuse (Body::keeping_meshes); its booleans take the meshes from there, and the intersection takes its shell meshes from there too (truck-shapeops: and_with_history_meshed). Clearance uses such copies for one check. Results are unchanged to the bit. On a 3 x 2 m sheet with bends and 300 holes, the clip took 0.23 s per pair instead of 2.6 s, and 24 rivets took 5.6 s instead of 16.5 s. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * inspect.clearance: pins on one cylinder with their hole are answered or reported in seconds A pin seated line to line in its hole, on its axis, and with a blend running into its wall (a fillet under a head) sent the boolean through minutes of retries that ended unchecked; a pin a hair off its hole's axis was passed as clear. Clearance now asks first whether the pair holds such a pin (from the faces' surfaces alone). On its axis the boolean gets a few tries, which answer plain pins at once; a hair off, or when those tries fail, the shared volume is worked out apart by coaxial_overlap, which now also takes the zero-offset, equal-radius case, moves the hole's wall when a blend keeps the pin's from moving, and checks its band more tightly. What neither answers is reported as unchecked, naming the pin. The kernel gains with_attempt_budget: the booleans run inside it get a number of tries of the kernel's own intersection between them, the same on every machine. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * inspect.clearance: the pin tests sit beside the other measured pairs, not at the file's end Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * inspect.clearance: the bodies left whole meet their booleans with their meshes kept A body that meets several others at one size (a bracket with balls pressed into it) was meshed again for each pair's intersect: only the clipping used the copies that keep their meshes. The intersect, the pin work and the union check now take those copies too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Near-coaxial overlap: ten tries per intersection, enough for a flush head pulled back #1984's headed pin made before its plate needs more than eight. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aac7mP9rthK3WsPpPRvCsF --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com> |
||
|
|
62b49f9f89 |
Boolean: a pin in a bore of its size is clear at every placement (#2714) (#2715)
* Boolean: a pin in a bore of its own size is clear of it, whatever its facets
A pin whose wall is in other faces than the bore's (turned from a profile: three
faces; the bore two) is faceted at other angles. Where one body's faces end on
the shared cylinder (the pin's wall through the end face of the tube, the pin's
end inside the bore) the facets cross by the facetings' error, so the sampled
shortcut doubted its own "apart" answer, every retry failed on the coincident
walls, and the result came back unverified after seconds: inspect.clearance
left such pairs unchecked ("could not be intersected there").
The shortcut now leaves out crossings that lie on a cylinder both bodies have
faces on (axes and radii within the kernel's same-surface tolerance, where both
faces run). A pin a hair off its hole's axis, or one pushed into a narrower
bore, is still not taken for apart.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Boolean: skip only the shared cylinder's own crossings, not a flat along it
The shortcut left out every crossing near a cylinder both bodies have faces
on, from any face: a pin through a D-bore whose flat is 0.022 mm inside it
came back as contact. Mesh::crosses_except now hands the predicate the two
triangles' faces, and only crossings between the faces on the shared
cylinder, or between one of them and an end face across its axis that keeps
to its body's side of the cylinder (within the facetings' error), are left
out. The D-bore's end face reaches into the cylinder to the flat, so the
pin's wall through it counts again; a flat, key or rib along the axis always
counts.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Boolean: a pin in a bore of its size is clear at every placement
The sampled shortcut's check that no facet has material under it on the
wrong side of the other body still caught the facetings of a shared
cylinder. A facet of a pin's end inside the bore (or of the bore part's
end face round the pin) with all three corners on the rim has its middle
just inside the cylinder. Where the other body's chords reach further in
at that angle, the point under it lies inside the other mesh, though the
bodies only touch. Which facets do so depends on the face splits and the
placement, so the same pair read as clear at one placement and as "not
verified" at another.
Such points are no evidence now when they lie on the shared cylinder,
under a facet of one of its end faces: the end faces and band the
crossing check already leaves out. A pin 0.02 mm larger is no shared
cylinder, and its overlap is still found.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
|
||
|
|
f97a84c100 |
inspect.clearance: measure the 0.2 mm gap on trimmed faces (#2283) (#2337)
* claim: #2283 * inspect.clearance: a point straight past an edge's end no longer passes as on the face (#2283) A witness point on a face's surface is kept only if it lies on the face itself; near the face's boundary the nearest edge decides which side it is on. A point straight past the end of an edge (on the line through it) was meant to be left to the other edge meeting there, but "straight" was an absolute 1e-9 of the body size. With a slightly tilted axis (1.5e-6 rad, as a STEP round trip leaves it) a point 0.2 mm past the end of a knuckle's seam edge is 4.5e-6 mm off that line, so its side came down to rounding and the point on the knuckle's extended cylinder, level with the frame band's rim, was taken as contact (0.000) at some angles. Straight along is now relative to the distance from the edge (1e-3 of it), so the rim edge meeting there decides. Regression test: a hinge knuckle turned 30-80 degrees between two bands reads 0.2 mm at every angle, with both witness points on the bodies (41 degrees read 0.0 before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
02c77df5f7 |
inspect.clearance: mesh each body once per check instead of once per pair (#2867)
* inspect.clearance: pairs whose bodies did not change are not measured again Each clearance check measured every close pair again, though between two checks usually only a few bodies change or move. Results are now kept per pair, keyed by both bodies' geometry and placement and the check's settings; a pair whose two bodies are unchanged is taken from that cache. With 40 overlapping parts, a check after moving one of them took 0.8 s instead of 23 s (741 of 780 pairs reused). Pairs that could not be worked out are tried again each time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * inspect.clearance: boxes and placed keys exactly as before the reuse The pair boxes are taken over the mesh's triangles with finite corners, as a distance shape's are, so pruning is unchanged. A placed body's identity now includes its model body's own frame, so two placements are never mistaken for one another. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * inspect.clearance: a large body is meshed once for all its pairs Each pair that touches cuts the larger body down to the pair's region with a kernel boolean, and that boolean meshed the whole body twice: once for its checks and once inside the intersection. A sheet with 600 faces paid about 2.5 s per pair for meshes that were the same every time. A body can now keep its meshes for reuse (Body::keeping_meshes); its booleans take the meshes from there, and the intersection takes its shell meshes from there too (truck-shapeops: and_with_history_meshed). Clearance uses such copies for one check. Results are unchanged to the bit. On a 3 x 2 m sheet with bends and 300 holes, the clip took 0.23 s per pair instead of 2.6 s, and 24 rivets took 5.6 s instead of 16.5 s. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com> |
||
|
|
c177adfceb |
Clearance: check a shared volume against the union, allowing for the bodies' measuring error (#2090)
* Clearance: check a shared volume against the bodies and their union An intersection can come out well formed and still wrong: one of a mirrored pair of imported parts shared three times the volume of its twin. The shared volume is now compared with vol(a) + vol(b) - vol(a ∪ b), on the same (cut down) bodies; when they differ by more than 1 % (plus the bodies' own measuring error), the pair is reported unchecked with both numbers. Where the union gives no answer, the intersection stands. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Clearance: let the union cross-check allow for the bodies' measuring error vol(a) + vol(b) - vol(a ∪ b) is a difference of measured volumes and carries the error of all three, so correct small overlaps on large bodies came back unchecked (0.96 mm³ where the union implied -0.75). measure keeps a face's fine tessellation when it is within 1 % of one with a 5 times coarser chord, so a measured volume can be off by up to 0.25 %: the allowance is now 1 % of the larger of the two answers plus 0.25 % of the three volumes. Past it, a union that implies nothing (within that noise of zero, or below it) while the shared part is at most a tenth of the smaller body cannot tell, and the shared part stands. A shared part of 412 mm³ where bodies of a few thousand imply 141 is still caught. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Clearance: tighten the union check's measuring allowance to 1e-4 The old note cited measure's 1 % gate, which compares face areas, not volumes, and its 0.25 % was about 100 times the disagreement the bodies' measures actually show. The allowance is now justified from volumes: a curved face's chord shortfall cancels between a body and the union except where the chord changes, which stays near 2e-5 of the three volumes; 1e-4 leaves five times that. A 40 mm roller pressed 0.2 mm into a 2 m plate exercises it: with no allowance the pair is left unchecked (7.52 mm³ measured against 8.16 implied), with it the overlap is reported. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com> |
||
|
|
186555dbe9 |
Clearance report: overlaps, near pairs and nearest bodies (#1900)
Thanks @NOWN-DEV. |