Skip to content

solidcore: retire face_tight_box_searches_trim (trimmed-face tight box search) - #17685

Draft
brett19 wants to merge 12 commits into
tangency-labs:mainfrom
brett19:flags/flagsB-misc
Draft

brett19 wants to merge 12 commits into
tangency-labs:mainfrom
brett19:flags/flagsB-misc

Conversation

@brett19

@brett19 brett19 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

This PR makes the trimmed-face tight box search (WR-588, WR-651, tangency-labs/smlib@95bf434) the only path of SmFace::CalculateTightBoundingBox and removes the face_tight_box_searches_trim flag. It also fixes the box of a face with no edge: one with no vertex either boxed to ±1e20.

Part of #14246

Changes a default: no
The kernel's default moves to what SolidCraft already runs. No UX default changes.

Test change: the tests' upstream halves go: tight_box_of_a_trimmed_face_without_the_fix_is_upstreams, trimmed_rational_cylinder_box_without_the_search_is_the_edges, rounded_corner_box_without_the_search_holds_the_octant, and the global-solve (waist) half of wr_588_barrel_cut_below_its_waist_is_boxed_to_its_upper_bulge. Each pinned a box that misses part of its face, or one taken from points outside it. Tests that ran both settings keep the fixed half, with the same assertions. Two new tests are added: tight_box_of_a_face_without_edges_is_its_surfaces_box and tight_box_of_a_planar_face_without_edges_is_its_planes_box. 28 golden rows move with the search (table below), and 14 blend.fillet_executive_p3 rows move in mass_properties only, because main's #17362 now integrates mass about the tight box (class M below, commit f2dbf0b).

What changes

  • query/face/p3.rs: the six face_directed_max searches always run. The copy of Surface::CalculateTightBoundingBox (one global solve per direction over the face's domain, keeping solutions not classified UNKNOWN) is gone.

  • The field, SolidCraft's preset line (crates/smlib/src/core.rs), the fixes.json and issue_2260 list entries, and every test setting are removed. The WR-588 addendum names the removed flag.

  • Face without edges (new, PROVEN by test). The search passes over a monotone cell because the face's edges hold its extreme. A face with no edge breaks that premise. Faces made over a UV domain smaller than the tolerance, or trimmed by a lone vertex, are like this. With no vertex either, the empty box's inverted bounds came back as points: ±1e20 on every axis. A plane returned that empty box early. Upstream left the box empty, which holds none of the face either. The face's points are the surface's over its domain. So, before the planar early return, each side takes the bound the search already uses for a cell it leaves unsolved (unsolved_cell_top): the subpatch's control-point hull plus its rounding, else the loose box, unioned with any vertex. unsolved_cell_top refuses a non-finite loose box. That is the only valid-to-refusal change: main returned Ok(±1e20) for that face. Its message now names both callers.

    • tight_box_of_a_face_without_edges_is_its_surfaces_box (a crowned B-spline) and tight_box_of_a_planar_face_without_edges_is_its_planes_box (a flat bilinear patch) assert that the box holds the surface's corner and middle points and is under 2e-6 across.
    • A procedural blend's base is its net, which lies within the definition's certified bound |B - S| <= bound, and its evaluation answers from the definition when the net does not. So the hull bound of an edgeless blend face is raised by that bound, on top of the hull's rounding. The by-patch search never reaches a blend, because it runs only on SurfaceKind::BSpline. a_procedural_blends_hull_is_raised_by_its_nets_bound asserts top >= hull + rounding + bound.
    • Without the change, the first gets ±1e20. The second gets an empty box under the earlier, empty-box-only version of this fix (NEGCHECK).
  • A cell past its surface's domain (new, PROVEN by test and by construction). In wr_660_planar_path_pose's line-then-arc sweep, posed and moved back, the flat cap face boxed to x 22.44, but the face ends at 22.

    • Cause: the cap is a bilinear B-spline. The planar-path sweep gives it a face domain that starts at u -2.6100000000000123, one ulp before the surface's natural domain at -2.610000000000012. A probe shows the overhang is already there on the posed sweep; undoing the pose does not add it. cell_patch compared the subpatch with the raw cell, so it refused every cell on that side. Those cells then fell back to the solver-only rule, which at the depth limit takes the solver's greatest value: 22.44, at a corner outside the face.
    • Our choice: when the surface is a B-spline whose evaluation clamps to its natural domain (any form but power basis, with out-of-bounds evaluation off: the clamp in evaluate_impl), cell_patch intersects the cell with that domain (Extent2d::intersect, min/max), and the subpatch must cover the intersection. This has no ulp window and no limit on how far the cell overhangs. Every other surface keeps the raw cell, and a patch short of it still decides nothing. That covers an extrapolating B-spline and a kind that is not evaluated through its base. A cell disjoint from the domain still gets no subpatch.
    • Why it is exact: such a surface evaluates a parameter past its domain at the clamped parameter, so it has no point beyond its image over the domain. The face's points in a cell are therefore the surface's points over cell ∩ domain. That is exactly the rectangle CopySubPatch extracts, because it takes the same intersection first, so the subpatch's control-point hull bounds every face point in the cell. The patch-short check still catches knot snapping. An earlier push of this PR (bf7d3ba) clamped sides that were at most 16 ulps out. That was an acceptance window, so it is replaced.
    • Alternative considered: fix the sweep so the face domain never overhangs. The kernel's other readers already treat face ∩ surface domain as the search range (points_in_face intersects the trim domain with the surface domain the same way), and the box is right for any producer. That makes the query-side intersection the fix that holds in general. The sweep's one-ulp domain is harmless once it is read this way. We are open to tightening the producer as well, if a maintainer prefers.
    • Tests: wr_660 fails without the change. a_cell_past_its_surfaces_domain_is_decided_on_the_part_inside_it uses a cubic patch:
      • a cell one ulp past u = -20 and 3 past v = 20 gets the subpatch over the intersection, bit for bit (the old code returns none);
      • a cell disjoint from the domain gets none;
      • with out-of-bounds evaluation on, the overhanging cell gets none, while a cell inside the domain still gets its subpatch.

Left out: linear_sweep_arc_is_cylinder (stays a flag)

The first push retired it too. With an arc swept as a cylinder by default, issue_880_half_arc_rim_chamfer fails:

  • The chamfer of rim half 0 builds 4 faces to 7. With offsets (1, 2), (2, 1) or the equal 1.4437, it fails check_brep Level 2 test Rename Fusion-derived command ids to our own dotted ids #5, "control net doubles back"; (1, 1) passes. The same chamfers on the extruded wall pass.
  • The chamfer face's 244 × 2 Hermite net reverses on its cut-face rail at rows 142 to 144 (x 15.67 / 15.60 / 15.70, z 10). That is in the run-on past the rim half's end.
  • There, the station at knot 16.709 starts a span of 0.346 whose end tangents were sized for the neighbouring spans of 0.985, so its handles overshoot. Its wall-rail station also sits at z 8.2626, between stations at 8.1848.

This is a defect of the run-on join. It is fix work for its own PR. MEASURED (probe); commit af2d80e has the numbers.

Also measured for that flag, so the follow-up does not redo it:

  • issue_1950 (+8.6e-4 against the closed form, against +4.2e-4 for the extrusion): in both bodies the shell's inner arc face is a B-spline (the certified offset net, or the B-spline extension of the offset cylinder). WR-545's exact-edge step therefore leaves the cavity's cap edges marched, about 1.5e-6 inside the r 8 circle (edge tolerance 2e-5). The cap faces lack 1.9e-5 or 3.7e-5 mm² of their half disc, and times the 23.5 depth that is the whole volume move. MEASURED.
  • 7 blend.fillet_executive_p3 rows: rerunning on the cylinder body with the old offsets gives the old volumes back to within 6.6e-7 relative. With the setbacks, the runner derives the offsets at the rim edge's parameter midpoint, and the blend edge use lies on the other face, so the offsets swap. issue-880-half-arc-rim-1-setbacks-1-1 goes from 1001 to a solid with the old offsets too. MEASURED.
  • 12 primitive.primitive_creation_p1 rows: the side face is the cylinder in its own parameters. At distance 0 the sweep makes no face, as upstream's whole-circle and plane branches already do.

Moved golden rows (28 + 14)

How the search decides a cell:

So the search is not a certified enclosure in general. It is upstream's own search, which this PR makes the only path, not something it adds. That limit is the existing §7.5 gap of edge and face tight boxes; this PR does not close it.

The evidence for each row is therefore MEASURED. The witness is the extreme of a 161 × 161 grid over the face's UV domain, keeping only points that point_classify puts inside the face (SM_PC_FACE). Those are face points, so a side that excludes one is too small. The probe was temporary, in the runners, and is not committed.

class rows old → new evidence
A. The old side missed the face face_p3: gen0072 (z min), gen0088 (x, y min), gen0104 (z min/max), gen0112, gen0226 (z max), gen0328, gen0330, gen0336, gen0367 (z max), gen0378 (z min), gen0381 (z max), gen0422, gen0484; face_p1: gen0055 (z max), gen0215 (z min); brep: gen0549 (z min), gen0571 (z min) the box grows on that side (by 2.0e-6 for gen0072 up to 81.2 for gen0367) A grid witness lies beyond the old side in every row, and the new side holds it. Gap from new side to witness: 0 (gen0088, gen0328) to 3.7 (gen0104 z min, grid spacing). MEASURED
B. Face without edges face_p3 adv_tight_bs0/bs1_[0, 0, 1e-06, 1e-06] empty box → [0, 1e-6]² × [0, 0] (bs0) and × [0, 1.2e-12] (bs1), each within 2.6e-14 Closed form: bs0 is the bilinear patch x = u, y = v, z = 0; bs1's z over [0, 1e-6]² is at most 0.3 · 4uv = 1.2e-12. The new box is the closed form to rounding. MEASURED against that closed form. The new unit tests assert the same branch on other surfaces, not these rows
C. Rounding face_p3 gen0010, gen0292, gen0447, tight_cone_f0, tight_cone_f0_rebuild; face_p1 gen0054, gen0644; the unmoved sides in A (≤ 2 ulps) (-3.3e-16, -5.000000000000001, -5) → (0, -5, -4.999999999999998) Every change is at most 8 ulps of 5. Both values are the cone face's corner (0, -5, -5) to rounding. Some sides shrink by 2 to 8 ulps, so the new box can leave out a value the old global solve evaluated on the surface by that much. That is the missing rounding term above. MEASURED
D. Tighter side brep gen0128 (z max of its tight box) 0.436712 → 0.435344 The grid's highest face point is 0.434554, below both. The surface kind of the face that decides it was not established, so the new side is not claimed as a certified bound. A suspected cause, not proven: the old global solve kept a point classified on the boundary within the zone tolerance, and 95bf434 counts only points inside the face. MEASURED
E. Sub-tolerance growth face_p3 gen0133 (z min) -2.743217e-4 → -2.747759e-4 (4.5e-7) No grid point is beyond the old side. The growth is below the face's 1e-6 classification tolerance, and the box only grows, so it still holds the face. MEASURED

Class M: mass rows that now read the tight box (14 rows, f2dbf0b)

Cause: main's #17362 (fe89576, merged 11-16) makes brep_mass_properties integrate about the middle of the body's tight box and scale its errors by that box's size (before, the loose box). This PR changes the tight box, so after merging main these rows move. Attribution (each a full blend.fillet_executive_p3 run): the same 14 rows move, bit for bit, with 6ed041e's net bound reverted, with its clamp condition reverted, and with this branch's p3.rs at bf7d3ba (the pre-merge head, whose gate passed against the pre-#17362 mass code). With main's p3.rs and kernel.rs, no row moves.

Rows: curve-sih-box_diff_cyl-all-edges-{r0.1,r0.25,r0.5,r1.0,step2}, issue920-cylinder-rim-edge2-{constant,variable-constant-law}-{r10.0,r9.99}, issue_2176_tabbed_plate_{tab_top,disc_wall}_r0_5, source-file-box_diff_cyl-all-edges, source-file-brick-all-edges, stubs4-torii_unioned-e2-r0.5.

invariant, replayed on all 14 rows label
Every field but mass_properties (statuses, counts, result_topology, result_geometry) is bit for bit unchanged, so the body is the same. The replay script asserts it per row. PROVEN (replayed)
The body's tight box is the only input of brep_mass_properties that differs: it reads the body and calculate_tight_bounding_box (its middle and size), nothing else that this PR touches. The exact mass properties do not depend on the integration point (the code's shift to the origin/centroid). ARGUED (code)
On every row the new body box lies inside main's, each side moving by at most 3.6e-11 (brick, 127 mm), 3.5e-13 on the 10 mm cubes; the moved sides go to the closed-form extents (±5 cube, the r 10 × 20 cylinder) to ≤ 3 ulps. The one side that ends 1 ulp inside a closed form (tabbed plate x min, -24.999999999999996 against -25) is class C: it equals the side's edges' tight boxes, and main's -25.0 is the global solve's surface point. MEASURED (probe in the runner, not committed)
Every moved component changes by at most 4.8e-16 of its quantity's own scale (the value for area/volume/mass, the largest inertia for inertia and products, sqrt(I_max/m) for the centroid), so at most about 2 ulps: rounding of the integrals, against the integrator's requested accuracy of 1e-4. They exceed the goldens' 1e-9 relative tolerance only on components that are near zero against their tensor (products about 1e-8 to 1e-13 of the inertia). MEASURED (replayed on every row)

Why the new values are right: same body, same integral, a new integration point within 3.6e-11 of the old; every change is at the rounding level of its tensor. #17362 accepted its own 100 moved rows on the same basis at up to 3.6e-6.

Certificate checklist (§7)

  1. Sampled or bounded: the new edgeless branch is bounded (subpatch hull plus rounding, else the loose box). The search's existing rules are upstream's, with the limits stated above (solver-settled cells off B-spline patches, edge boxes without rounding). The grid samples are evidence only, never acceptance.
  2. Rounding counted: the hull adds sub_patch_rounding. Without a finite rounding bound it falls back to the loose box, and a non-finite loose box is a typed refusal (unsolved_cell_top).
  3. NaN: is_empty_box is written so that a NaN bound counts as empty.
  4. No tolerance widened, no expectation loosened.
  5. One valid-to-refusal change: an edgeless face whose loose box is not finite now gets a typed refusal instead of Ok(±1e20).
  6. Bounded work: the edgeless branch makes six hull evaluations and no loop.
  7. Every moved golden row is explained above (classes A–E and M).
  8. Real-defect test: tight_box_finds_a_trimmed_faces_peak_when_the_surface_peaks_outside still catches a box that misses its face's peak.

Overlap

leon-vv's #16572 edits the same if k.fixes.face_tight_box_searches_trim { ... } block of query/face/p3.rs. This PR removes the condition and dedents the block, so whichever lands second has a mechanical conflict in that block and in the module table's "(opt-in, WR-588)" line.

Checks

  • cargo fmt; clippy (-p solidcore -p solidcore-ops --all-targets -D warnings) clean.
  • All goldens: 283/283 passed after the first bless (28 rows). After merging main (Mass properties: a solid with a nearly flat, very large-radius face gets its centre of mass right #17362), the core-only gate on 6ed041e failed only on the 14 class-M rows; they are blessed in f2dbf0b and a full core-only gate runs on that head.
  • Independent review (one adversarial round, fresh agent) found 2 containment gaps, both fixed in 6ed041e: the domain intersection applies only where evaluation clamps, and a blend hull is raised by its net bound.
  • Touched solidcore tests pass: query::face::p3 (27), wr_660_planar_path_pose, issue_1799, fork_95bf434, wr650, issue_2020, issue_2260, issue_1950, issue_880, issue_1477.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV

…tight_box_searches_trim

Empty claim commit for the group-B misc flag batch (part of tangency-labs#14246).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
Pre-merge checks: Passed 1

Check name Status Explanation
Existing Defaults Unchanged Passed The check passes. No UX default changes. What the PR changes: - It removes the kernel fix flag face_tight_box_searches_trim. The six face_directed_max searches now always run. The change is in `so…
Full details: Existing Defaults Unchanged

Explanation

The check passes. No UX default changes. What the PR changes: - It removes the kernel fix flag face_tight_box_searches_trim. The six face_directed_max searches now always run. The change is in solidcore/ (crates/solidcore/src/query/face/p3.rs). - It removes the flag's entry from SolidCraft's kernel fix preset (crates/smlib/src/core.rs). This preset holds kernel fix switches, not user settings. The working tree's core.rs diff also shows many other fix flags removed. Those removals come from other merged PRs in this branch, not from the tight-box commits. - The PR's own tight-box commits (for example 1c7dbc601e, b08fff639c, ba56c74832, 6ed041e863, f2dbf0b661) touch only solidcore/, crates/smlib/src/core.rs, and golden test data. Why this is not a UX default change: - The changed flag is a kernel behaviour switch. The check states that kernel or geometry results under solidcore/ are not changed defaults and pass. - The PR changes the box of trimmed or edgeless faces and some mass-property rows. Those are geometry and kernel results. They are not default settings, preferences, command usage, UI layout, or shortcuts. - The PR's own commits do not touch crates/ui-egui, preference files, or locale defaults. The non-solidcore files in the wider branch diff come from other merged PRs (for example the Escape/analyses, toolbar, and glTF import changes). Those PRs are outside this PR's scope. Consistency with the description: - The description says Changes a default: no. The code changes no UX default, so the "fail if the description contradicts the code" condition does not apply. Caveat: - The check's stated policy is applied as written. The kernel default moves to the search path the fork already runs. This may change the geometry that a user sees. The check explicitly excludes such results, so they do not cause a FAIL here.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

brett19 and others added 2 commits November 16, 2026 05:04
…rches_trim

The fixed paths become the only ones:
- linear_sweep_arc_is_cylinder (WR-565): CreateLinearSweep makes a circular
  arc short of a whole turn that is swept square to its plane an SmCylinder
  (arc_sweep_cylinder), not an SmSurfOfExtrusion;
- face_tight_box_searches_trim (WR-588, WR-651): SmFace's tight box searches
  the trimmed face's own extremes inside its trim (face_directed_max); the
  copy of the surface's global solve over the face's domain goes.

Removed: the two fields, SolidCraft's preset lines, the fixes.json and
issue_2260 list entries, and every test setting of them. Tests that ran both
settings keep the fixed half; the upstream halves (an extrusion for a partial
arc, the global-solve box of a trimmed face) go. issue_1950's pin of the
extrusion operand loses its flag line; its pinned volumes move in the
expectations commit.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
…hamfer is fixed

linear_sweep_arc_is_cylinder goes back to an opt-in flag; this PR now retires
face_tight_box_searches_trim alone.

With the arc swept as a cylinder by default, issue_880_half_arc_rim_chamfer
fails: the chamfer of the first rim half (offsets (1, 2), (2, 1) or the equal
1.4437 of setbacks 1 and 1; (1, 1) passes) builds 4 faces to 7 but fails
check_brep Level 2 test tangency-labs#5 ("control net doubles back"). The chamfer face's
244 x 2 Hermite net reverses on its cut-face rail at net rows 142 to 144
(x 15.67 / 15.60 / 15.70, z 10), in the run-on past the rim half's end: the
station at knot 16.709 lies on a span of 0.346 whose end tangents fit the
neighbouring spans of 0.985, so its handles overshoot, and its wall-rail
station sits at z 8.2626 between stations at 8.1848. On the extruded wall the
same chamfers pass. That is a defect of the run-on join, to be fixed before
the flag retires.

The issue_1950 volume move is understood and is not a blocker: both the
extruded and the cylinder wall shell into a B-spline inner arc face (the
certified offset net, or the B-spline extension of the offset cylinder), so
the WR-545 exact-edge step leaves the cavity's cap edges marched, about
1.5e-6 inside the r 8 circle (edge tolerance 2e-5); the cap faces then lack
1.9e-5 or 3.7e-5 mm^2 of their half disc, times the 23.5 depth, which is the
whole +4.2e-4 or +8.6e-4 against the closed form.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
@brett19 brett19 changed the title solidcore: retire linear_sweep_arc_is_cylinder and face_tight_box_searches_trim solidcore: retire face_tight_box_searches_trim (trimmed-face tight box search) Nov 16, 2026
brett19 and others added 9 commits November 16, 2026 05:47
With the trimmed-face search the only path, a face that has no vertex and no
edge (made over a UV domain smaller than the tolerance, as the goldens'
adv_tight_bs0/bs1_[0, 0, 1e-06, 1e-06] faces are) started the six searches
from the empty box of its edges. A plane patch is monotone everywhere, so
every cell was passed over as "the edges hold the extreme", and the empty
box's inverted bounds came back as points: the face boxed to +-1e20 on every
axis. Upstream's global solve left the box empty, which holds none of the
face either.

Such a face's points are the surface's over its domain, so each side is now
that domain's bound as the search bounds a cell it leaves unsolved
(unsolved_cell_top): the control-point hull of the subpatch over the domain
plus its rounding, else the loose box. Regression test
tight_box_of_a_face_without_edges_is_its_surfaces_box (fails without the
change: +-1e20).

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
28 rows move: query.face_p3 (21), query.face_p1 (4), query.brep (3). Each
is a face's tight box, or a union of them, and the move comes from the
trimmed-face search replacing the global solve over the face's domain:
- 17 boxes grow on a side, and a face point classified inside the face lies
  beyond the old side (a 161 x 161 grid over the face's domain, classified
  by point_classify); the new side holds it;
- 2 faces with no edges (adv_tight_bs0/bs1 over [0, 1e-6]^2) get their
  subpatch's hull ([0, 1e-6]^2 x [0, 1.2e-12] to 3e-14), not an empty box;
- 1 side (query.brep gen0128, z max) shrinks by 1.37e-3 to the search's
  bound, still above every grid point of the face;
- the rest are within 8 ulps (the cone face's 0 / -5 / -5 corner) or a
  4.5e-7 growth on query.face_p3 gen0133.
The PR body has the row-by-row table. Adds the WR-588 addendum.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
Clippy's unused-qualifications lint: loopuse is already imported.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
…ex or a plane

Review of tangency-labs#17685: the edgeless branch keyed on an empty box, so a face
trimmed by a lone vertex kept a one-point box (the search's monotone rule
assumes edges hold the extreme), and a plane returned its empty box early.
The branch now keys on the face having no edges, unions the vertices in,
and runs before the planar return. New test
tight_box_of_a_planar_face_without_edges_is_its_planes_box fails under the
previous gating (empty box) and passes now. The cell refusal's message
names both callers. The WR-588 addendum says so.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
… its subpatch

wr_660_planar_path_pose's line-then-arc sweep, posed and moved back, boxed
its flat cap face to x 22.44 where the face ends at 22. The cap is a
bilinear B-spline whose face domain starts at u -2.6100000000000123 and
whose natural domain starts at -2.610000000000012, one ulp in. cell_patch
refused every cell on that side (its subpatch is short of the cell), so
those cells took the solver-only rule, and at the depth limit that rule
takes the solver's greatest value: 22.44, at a corner outside the face.
With the patch, the cell is monotone and passed over, as on the other side.

cell_patch now clamps a side that lies past the surface's domain by no
more than 16 ulps (of the larger of the bound and the domain's width) onto
it; a side further out is kept and still refused. Tests: wr_660 (fails
without the change), a_cell_past_its_surfaces_domain_by_rounding_is_clamped_to_it.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
…urface's domain

bf7d3ba clamped a cell side lying up to 16 ulps past the surface's domain
onto it. That is an acceptance threshold, not a bound. It is replaced by
the exact set operation it stood in for.

The surface is the image of its natural domain and has no point past it.
The face's points in a cell are therefore the surface's over the cell
intersected with that domain. CopySubPatch already extracts exactly that
rectangle (it takes the same intersection), so cell_patch now compares the
subpatch with the intersection rather than with the raw cell. The
operation is min/max, with no tolerance and no size limit on the overhang.
A cell disjoint from the domain has no subpatch, as before.

Root cause of the overhang (probe, not committed): the planar-path sweep
builds the cap face with a domain that starts one ulp past its bilinear
surface's (-2.6100000000000123 against -2.610000000000012). The overhang
is already present before the pose is undone, and the transform does not
add it.

Tests: wr_660_planar_path_pose passes (it fails without the bf7d3ba
change). a_cell_past_its_surfaces_domain_is_decided_on_the_part_inside_it
replaces the clamp's test. It covers a one-ulp overhang and a 3-unit
overhang, both decided on the subpatch over the intersection, and a
disjoint cell that gets none. The old code returns None for the first
case.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
…lamps; blend hull raised by its net's bound

Two fixes from review:

- cell_patch intersects a cell with the natural domain only on a B-spline
  surface whose evaluation clamps to that domain: any form but power
  basis, with out-of-bounds evaluation off (evaluate_impl's clamp). An
  extrapolating B-spline, or a kind that is not evaluated through its
  base (a plane, a revolution, a blend), has points past the domain that
  the subpatch's hull does not hold. Those keep the raw cell, which a
  patch short of it does not decide, as before.
- unsolved_cell_top raises a procedural blend's hull by its definition's
  certified bound. The base is the net, and the blend evaluates from the
  definition, within |B - S| <= bound, wherever the net does not answer.
  The edgeless-face branch reaches this. The by-patch search runs only
  on B-spline kinds.

Tests: the domain test now also checks that an out-of-bounds-enabled
surface's overhanging cell gets no subpatch.
a_procedural_blends_hull_is_raised_by_its_nets_bound is new.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
…ight box

Main's tangency-labs#17362 (fe89576) makes brep_mass_properties integrate about the
middle of the body's tight box and scale its errors by that box's size.
This branch changes that box (the trim search is the only path), so after
merging main 14 blend.fillet_executive_p3 rows move, in mass_properties
only:

- every other field of each row (statuses, counts, topology, geometry)
  is bit for bit the same, so the body is the same;
- on each row the new body box lies inside main's, each side moved by at
  most 3.6e-11 (rounding of the search against the global solve);
- each moved component changes by at most 4.8e-16 of its quantity's own
  scale (the value for area/volume/mass, the largest inertia for inertia
  and products, sqrt(I_max/m) for the centroid): rounding, against the
  integrator's requested accuracy of 1e-4.

Attribution: the same 14 rows move with 6ed041e's two changes reverted
one at a time, with ba56c74 reverted, and with bf7d3ba's p3.rs; with
main's p3.rs and kernel.rs no row moves.

Part of tangency-labs#14246.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant