Repository navigation
Reduce NURBS SSX candidates before Bezier tracing - #50
Merged
Merged
Conversation
sth-v
marked this pull request as ready for review
September 26, 2026 02:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NURBS SSX was sending thousands of overlapping AABB pairs into full Bézier intersection, including pairs that cheap control-hull bounds can exclude. On
nurbs_nurbs_intersection_2.py, calls fall from 2,485 to 446 and the measured runtime from 140.4 s to 53.8 s. On case19, calls fall from 7,426 to 290 and runtime from 714.8 s to 127.9 s. These paired runs use the same compiled narrow phase, with only the candidate filters toggled. Returned geometry is byte-identical to the corresponding baseline, with unchanged completion/reason status.The existing BVH already uses top-down median splitting. This keeps that tree and adds cached control-point support intervals on OBB directions, independently verified native GJK direction proposals, and up to two levels of lazy rational child-hull refinement. A parent is excluded only when its complete hull coverage is separated by more than the padded model-space tolerance plus arithmetic allowance. Uncertain arithmetic and exhausted filter limits retain the original pair. The backend receives original patches, domains, pair order, and
atol; aggregate allowances remain based on the original AABB candidates.The legacy Boolean GJK API is unchanged. The new optional axis API supplies proposals rather than final rejection decisions; seven case19 near pairs that a raw Boolean would discard are retained. Projection temporaries, native control products, split work, and child comparisons have bounds. An older native extension can still use the projection/refinement stages.
Independent tests cover analytic separation/contact, rational weights, changed parameterizations and coordinate units, degenerate patches, invalid axes, interrupted refinement, and exclusion before the full solver. Existing geometry tests were not loosened. A reproducible benchmark reports stage counts, wall/CPU times, geometry digests, and baseline/filtered comparisons.
The branch includes the existing local
tinyfixture commit3d1b04a(case18/19), preserving it unchanged.Focused validation: 151 geometry/native tests passed on macOS and freshly built Linux Python 3.12; adapter/case16/spherical integration checks passed. Import and layering checks pass. Full macOS Python 3.14 and Linux Python 3.12 suites each passed 1,517 tests (one existing slow test deselected), in 17m51s and 18m31s respectively. All 14 GitHub build/test jobs passed; Ubuntu Python 3.12 reported 1,517 passed, one slow test deselected (52m51s): https://github.com/contextmachine/mmcore/actions/runs/36209139491.
Details and commands: broad-phase measurements.