Repository navigation
solidcore: a curved Setback refuses a corner whose piece of a face holds another edge or loop (#13832 step 1) - #16327
Conversation
Walkthrough
Security architecture risk:
|
65073d5 to
f98cd0e
Compare
…ch face and (d) condition 2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
…lds another edge or loop (tangency-labs#13832 step 1) Condition 2 of tangency-labs#2343 (d): the piece a Setback beside a curved face takes out of each face, bounded by its two blended edges to their setbacks, the end sections' traces and the spring curve, must hold no other edge or loop of the face. Condition 1 only checked the spring curve, so a bore wholly inside the piece was covered by the fill. - FacePlane: the face's rational parameter plane, moved out of spring.rs unchanged, with the map of a rational net into it. - CornerPiece and a three-valued Clear/Blocked/Undecided decision: the boundary is proved clear of each other edge on control-point hulls, then a winding number at one point of the edge decides inside or outside. - SetbackTooLongWhy::PieceHoldsEdge, naming the largest setback at which both conditions hold, from springs_refusal's search made generic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
f98cd0e to
5e712e0
Compare
…s too (tangency-labs#13832 step 1) winding closes each gap between one side's end and the next side's start with a straight piece. A blended edge's tolerance lets its restricted curve end that far off, so an edge of a smaller tolerance could cross the closing piece unchecked and lie partly inside. Certificate (a) now checks each closing piece with clear_of, the gap widened by its length. Also states why edges at the vertex are left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
c6adb44
This PR makes the curved Setback (a corner of three or more constant rounds beside a cylinder, cone or sphere) refuse a corner when the piece it takes out of one of its faces holds another edge or an inner loop of that face. Today the fill is built over such a loop and the body is wrong. This is step 1 of the plan in #16232 (design and inventory for #13832): item (d) condition 2 of the brief.
Labels: PROVEN = asserted in code (a test, a certificate check, a closed form a test checks). ARGUED = reasoning or code reading. MEASURED = observed by running it.
The defect (MEASURED on main 2654478)
issue_2343's D prism (R 10, flat 8, H 20) with a small bore (R 0.15) through the top at (6.7, 3.0). The chord, upright and arc at V = (8, 6, 20) are rounded 1, 1.5 and 2, asked 7.5 at V. The bore lies wholly inside the corner's piece of the top, 0.08 clear of the spring curve, so condition 1 (#14096) passes. Main builds the corner and check_brep level 2 is clean, but the bore's top circle is gone and its wall meets a fill patch at 1.57 rad: the fill covers the hole. The twin with the bore just outside the piece, at (6.3, 2.7), builds correctly.
What changes
blend_setback::FacePlane(pub(crate), newface_plane.rs): the face's rational parameter plane, moved out ofspring.rswith the same operations in the same order (frame,to_plane,partials). New:netmaps a rational 3-D net on the face to a rational net in the plane. That is degree n on a plane or sphere and 2n on a cylinder or cone (t = u2 / (rho(u3) + u1),h = u3).pointmaps a point.blend_corner::piece(pub(crate), new):CornerPiece, the piece's closed boundary as rational Bezier sides with positive weights, each held in 3-D and in the plane. The sides are: the blended edge after the face from V to its setback point, that blend's end-section trace on the face, the spring curve's two halves, the end-section trace of the blend before the face, and its edge back to V. Also new:Decision { Clear, Blocked, Undecided }, where Undecided refuses as Blocked does.section_trace): the plane square to the edge at the setback point, cut with the face. It is the conic through both ends, tangent there to the section, with its weight from the shoulder point where the chord-midpoint-to-tangent-crossing line meets the quadric. That is exact on any quadric. It falls back to a straight segment where each end lies within 1e-3 tol of the other's tangent line (a plane, or a ruling).SetbackTooLongWhy::PieceHoldsEdge: a new public variant (#[non_exhaustive]enum;solidcore-opsmapsSetbackTooLong { .. }without readingwhy, so no app change). Its size comes fromsprings_refusal's search, nowlargest_clear_scale, generic over the check. Trials check condition 1 and condition 2 together, so the named size passes both. The SpringLeaves refusal keeps its exact messages.Springs::HoldsjoinsSprings. Condition 2 also runs aftergrow_curved's growth, where a hold refuses as a spring leaving does.fillet_geom::p2::set_back_params(the walk's parameters;set_back_framenow calls it, same numbers) andon_face::bezier_spans(bezier_pieceswith knot spans;bezier_piecesreturns the same).Certificate (definitions-and-certificates §7 checklist)
For each other edge of the face (not at V, a seam once):
windinguses, and its gap is widened by its length), keeps clear of the edge by more thantol + edge tol + the side's construction rounding. Edges at the vertex are left out, as condition 1 leaves them out: at a Setback corner the face meets the vertex only between its two blended edges, which bound the piece themselves (its sides along them stop at their setbacks, and (a) checks the face's other edges against those sides); a seam ending at the vertex or a third loop edge there is not expected at a Setback corner and is not checked (ARGUED). This is decided on control-point hulls withon_face::clear_of, the test condition 1 uses. PROVEN by theclear_ofcertificate in code. The other edge is restricted to its own interval (restricton its knot spans, endpoint-checked; otherwise its whole curve, which is conservative). Using the whole curve made a split circle's other piece count as near V: measured on the sphere and cone corners and fixed.FacePlaneabout any one of its points decides. The winding number is a sum of turning angles over boundary pieces, each shown on its control points to lie in an open half-plane through the point (margins counted). The sum must be within a quarter turn of a whole number. The check is PROVEN in code. That one point suffices is ARGUED (topology given (a)). That the map is injective on the face away from a sphere's pole or a quadric's opposite line is ARGUED. An edge running through that line maps to components that reach infinity, where the winding is 0, so one point still decides (ARGUED). The edge curves lie on the face only to their tolerance, so the plane image of a curve near the face stands for its projection's image (ARGUED; the 3-D clearance exceeds the sum of the tolerances).!(x > y)or as a positive test, and a non-finite or non-positive weight failspush/net(PROVEN by the unit test with a NaN side).REFINEhalvings). The named size is always one the check cleared (PROVEN by construction: the search returns only a cleared scale). The search assumes a scale clear stays clear at every smaller one (design Q3; ARGUED, not proved); if that fails, the size named can only be smaller than need be.clear_of(explicit stack,on_face::DEPTH= 40 halvings,PAIRS= 4096 pairs per call). The winding number uses the same two bounds on its own stack. Cancel is polled in both loops. Deviation from the brief: the brief said "at mostGRAPH_DEPTH" (6). That is the fill certificate's depth and far too shallow for clearance at the tolerance scale (a 5-long side would need about 23 halvings to separate at 1e-6). We use the bounds condition 1 already uses, so the work stays bounded and the depth is fit for purpose.Edges at the vertex are left out of both (a) and (b), as condition 1 leaves them out. At a Setback corner the face meets the vertex only between its two blended edges, which bound the piece themselves; the piece's sides along them stop at their setbacks, and (a) checks the face's other edges against those sides. A seam ending at the vertex, or a third edge of the face's loop there, is not expected at a Setback corner and is not checked (ARGUED).
Tests
a_bore_inside_the_corners_piece_of_the_top_is_refused_naming_the_setback_that_leaves_it_out(issue_2343_curved_setback.rs). Asked 7.5: refusedSetbackTooLong { why: PieceHoldsEdge }at V. The named size leaves the bore outside the piece and clear, by the piece's closed form (the top is a plane, so the spring is the parabola). It lies within 1e-3 below the closed-form limit (MEASURED: named 4.56085, limit 4.56128). Asked that size, the corner builds, passesgradedandkept_definitions, and keeps the bore's top circle. The twin with the bore outside builds, graded the same way. Fails on main (PROVEN: main builds the inside case, MEASURED above).piece::tests(inside, outside, across, within gap, an edge crossing the gap between two sides when a blended edge's tolerance is 1e-4 and the edge's 1e-7 (Undecided), reversed boundary, NaN side, span restriction, a cylinder's section trace on the cylinder and in the section plane to 1e-12),face_plane::tests(net and point againstto_planeon all four kinds).Test change: refactor only, no assertion changed. d_prism_eight_case now delegates to d_prism_eight_bored, which takes the bore centre; existing callers pass (0, 0) and the same names, so they build the same body and assert the same things.
Validation
cargo test --profile goldens -p solidcore --test issue_2343_curved_setback: 15 passed, 2 ignored (the slow growth tests, run separately below). MEASURED on server2.--core-onlyre-run after the closing-piece fix,--craft-only --no-testsfrom 5e712e0, unchanged public API since), case 2 (a new public variant):sc-gate.sh --changedchose--core-only(fmt, script tests, clippy, panic sites, wasm, nextest 7978 tests, doctests, solids, rig, 25 touched blend golden units): all PASS. Then--craft-only --no-tests(fmt, assets, layers, shared, clippy, wasm): all PASS. MEASURED.d_prism_asked_too_short_names_the_setback_that_builds,countersink_corner_is_a_setback_no_more_concave_than_its_cone): last passed on head 33ba30c (server2), 560 s. MEASURED.The curved Setback stays behind
fillet_setback_beside_curved_faces(off by default; on in SolidCraft's preset). Retiring the flag is step 4, a separate PR. Results: a refusal replaces a wrong body, so this stays a draft until an independent review is done.Objections to the shape (types, the three-valued decision, the new public variant, the depth bound) are welcome here or on #16232.
Part of #13832. Design: #16232.
Changes a default: no
🤖 Generated with Claude Code
https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
Summary by CodeRabbit