Skip to content

Commit 08a3001

Browse files
committed
Refactor Bézier intersection methods across modules:
- Rename `bezier_intersect_certified_full` to `bez_ccx` for brevity in `_bez_ccx3.py`. - Update all associated references and docstrings in test cases and examples. - Replace `bezier_curve_surface_intersect_certified` with `bez_csx` in `_ncsx2.py` for consistency. - Integrate `bez_csx` utility in `_ssx4.py` for surface-surface intersection refinements. - Clean up unused imports and deprecated utilities in `_ssx4.py`.
1 parent bc9f5e0 commit 08a3001

14 files changed

Lines changed: 1528 additions & 122 deletions

mmcore/geom/_nurbs_eval.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ def evaluate_nurbs_surface(surface:NURBSSurfaceTuple, u, v, d_order=2)->Evaluate
393393
nv = len(surface1.control_points[0])
394394
U = surface1.knot_u[:] # assume these are already lists/numpy arrays
395395
V = surface1.knot_v[:]
396+
396397
span_u = _find_span_linear(p, U, nu, u)
397398
span_v = _find_span_linear(q, V, nv, v)
398399
# print(p, U, span_u, u, d_order)
@@ -712,13 +713,13 @@ def _join_weights(pts,weights):
712713
def _nurbs_to_tuple(s1:nurbs.NURBSCurve | nurbs.NURBSSurface)->NURBSCurveTuple | NURBSSurfaceTuple:
713714
if isinstance(s1,nurbs.NURBSSurface):
714715

715-
surf1 = NURBSSurfaceTuple(order_u=s1.degree[0] + 1, order_v=s1.degree[1] + 1, knot_u=s1.knots_u.tolist(),
716-
knot_v=s1.knots_v.tolist(), control_points=np.array(s1.control_points),
716+
surf1 = NURBSSurfaceTuple(order_u=s1.degree[0] + 1, order_v=s1.degree[1] + 1, knot_u=np.array(s1.knots_u),
717+
knot_v=np.array(s1.knots_v), control_points=np.array(s1.control_points),
717718
weights=np.ascontiguousarray(s1.control_points_w[..., -1]))
718719
return surf1
719720
elif isinstance(s1,nurbs.NURBSCurve):
720721
cpts,weights=from_homogeneous_1d(np.array(s1.control_pointsw))
721-
curve1 = NURBSCurveTuple(order=s1.degree + 1,knot=s1.knots.tolist(),
722+
curve1 = NURBSCurveTuple(order=s1.degree + 1,knot=np.array(s1.knots),
722723
control_points=cpts,
723724
weights=weights)
724725
return curve1

mmcore/geom/_nurbs_interp.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _remove_adjacent_duplicates(points, tol=1e-5):
105105
return points[mask]
106106

107107
from typing import Literal
108-
def interpolate_curve(points, degree, use_centripetal=False, method:Literal['lstsq','lu']='lstsq',remove_duplicates:bool=False,tol=1e-6):
108+
def interpolate_curve(points, degree, use_centripetal=False, method:Literal['lstsq','lu']='lstsq',remove_duplicates:bool=False,tol=1e-6,params=None):
109109
""" Curve interpolation through the data points.
110110
111111
Please refer to Algorithm A9.1 on The NURBS Book (2nd Edition), pp.369-370 for details.
@@ -119,7 +119,12 @@ def interpolate_curve(points, degree, use_centripetal=False, method:Literal['ls
119119
num_points = len(points)
120120

121121
# Get uk
122-
uk,total_chord_length = compute_params_curve(points, use_centripetal)
122+
if params is None:
123+
124+
uk,total_chord_length = compute_params_curve(points, use_centripetal)
125+
else:
126+
uk = params
127+
123128

124129
# Compute knot vector
125130
kv = compute_knot_vector(degree, num_points, uk)

mmcore/numeric/_bern_homog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ def eval_bezier_surface_homog_with_derivs(Pw: np.ndarray, u: float, v: float, wa
308308
Shuv : (d_h,) mixed partial
309309
Shvv : (d_h,) second partial wrt v
310310
"""
311+
311312
Pw = np.asarray(Pw, dtype=float, order="C")
312313
u = float(u)
313314
v = float(v)

mmcore/numeric/cbern.pyx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ def bernstein_basis(int n, double t):
8282
# Our C logic handles all indices via the recurrence or memset, so empty is safe).
8383

8484
cdef double[:] B = np.empty(n + 1, dtype=np.float64)
85-
with nogil:
86-
# Pass the raw pointer to the nogil C function
87-
bernstein_basis_funs_c(n, t, &B[0])
85+
86+
bernstein_basis_funs_c(n, t, &B[0])
8887

8988
return B
9089

mmcore/numeric/intersection/ccx/_bez_ccx3.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ def _bez_get_tol_adapter(c, tol, rational=False, interval=None):
13871387
return nurbs_curve_param_tolerance(bern_to_nurbs_bezier(c, rational=rational, interval=interval), tol)
13881388

13891389

1390-
def bezier_intersect_certified_full(C1: NDArray, C2: NDArray, sv_thresh: float = 1e-8, atol: float = 1e-3, rational: bool = False,**kwargs) -> IntersectionResult:
1390+
def bez_ccx(C1: NDArray, C2: NDArray, sv_thresh: float = 1e-8, atol: float = 1e-3, rational: bool = False, **kwargs) -> IntersectionResult:
13911391
"""Certified intersection for (possibly rational) Bézier curve pairs.
13921392
13931393
Parameters
@@ -1434,10 +1434,10 @@ def bezier_intersect_certified_full(C1: NDArray, C2: NDArray, sv_thresh: float
14341434
Planar polynomial case::
14351435
14361436
>>> import numpy as np
1437-
>>> from mmcore.numeric.intersection.ccx._bez_ccx3 import bezier_intersect_certified_full
1437+
>>> from mmcore.numeric.intersection.ccx._bez_ccx3 import bez_ccx
14381438
>>> c1 = np.array([[0., 0., 0.], [1., 1., 0.], [2., 0., 0.]])
14391439
>>> c2 = np.array([[0., 0., 0.], [1., 0., 0.], [2., 0., 0.]])
1440-
>>> res = bezier_intersect_certified_full(c1, c2)
1440+
>>> res = bez_ccx(c1, c2)
14411441
>>> len(res['isolated'])
14421442
2
14431443
@@ -1446,7 +1446,7 @@ def bezier_intersect_certified_full(C1: NDArray, C2: NDArray, sv_thresh: float
14461446
>>> w = np.sqrt(0.5)
14471447
>>> arc = np.array([[1., 0., 1.], [w, w, w], [0., 1., 1.]])
14481448
>>> line = np.array([[0., 0., 1.], [0.5, 0.5, 1.], [1., 1., 1.]])
1449-
>>> res = bezier_intersect_certified_full(arc, line, rational=True)
1449+
>>> res = bez_ccx(arc, line, rational=True)
14501450
>>> np.allclose((res['isolated'][0]['u'], res['isolated'][0]['v']), (0.5, np.sqrt(0.5)))
14511451
True
14521452
"""
@@ -1627,7 +1627,8 @@ def cell_contains_known_isolated(u0, u1, v0, v1, margin=1e-9):
16271627
min_d = float(np.min(dnet))
16281628
if cell_contains_known_isolated(u0, u1, v0, v1) :
16291629
res = {"type": "none"}
1630-
print('bae', (u0, u1), (v0, v1))
1630+
print('bae', (u0, u1), (v0, v1), )
1631+
continue
16311632
else:
16321633
res = contact_detect_and_extract(Pseg, Qseg, seed_uv=(0.5, 0.5), sv_thresh=sv_thresh, rational=rational)
16331634

@@ -1886,7 +1887,7 @@ def get_interv(n) -> tuple[float, float]:
18861887

18871888
# case 1: One true overlap, no isolated points
18881889
s = time.perf_counter()
1889-
inter12 = bezier_intersect_certified_full(curve1, curve2)
1890+
inter12 = bez_ccx(curve1, curve2)
18901891
print(time.perf_counter() - s, "pruned:", inter12["stats"]["pruned"]) # 0.07984466700008852 (current perf)
18911892
print("\n\n case1\n", "-" * 80, "\n")
18921893
assert len(inter12["isolated"]) == 0
@@ -1924,7 +1925,7 @@ def get_interv(n) -> tuple[float, float]:
19241925
# case 2: Two isolated points, no overlaps
19251926
print("\n\n case2\n", "-" * 80, "\n")
19261927
s = time.perf_counter()
1927-
inter34 = bezier_intersect_certified_full(curve3, curve4)
1928+
inter34 = bez_ccx(curve3, curve4)
19281929
# 0.02212008300011803 (current perf)
19291930
print(time.perf_counter() - s, "pruned:", inter34["stats"]["pruned"])
19301931
#print(inter34)
@@ -1947,7 +1948,7 @@ def get_interv(n) -> tuple[float, float]:
19471948
print("\n\n case3.1\n", "-" * 80, "\n")
19481949
# case 3.1: Two isolated points, but the curves are close to each other and are almost parallel, which makes this example similar to overlap.
19491950
s = time.perf_counter()
1950-
inter36 = bezier_intersect_certified_full(curve3, curve6)
1951+
inter36 = bez_ccx(curve3, curve6)
19511952
print(time.perf_counter() - s, "pruned:", inter36["stats"]["pruned"]) # 1.4956505000000107 current perf
19521953
#print(inter36) # WRONG! Only one isolated point is returning.
19531954

@@ -1977,7 +1978,7 @@ def get_interv(n) -> tuple[float, float]:
19771978
print("\n\n case3.2\n", "-" * 80, "\n")
19781979
# case 3.2: Everything is the same, they just swapped the curves around.
19791980
s = time.perf_counter()
1980-
inter63 = bezier_intersect_certified_full(curve6, curve3)
1981+
inter63 = bez_ccx(curve6, curve3)
19811982
print(time.perf_counter() - s, "pruned:", inter63["stats"]["pruned"])
19821983
#print(
19831984
# inter63,
@@ -2015,7 +2016,7 @@ def get_interv(n) -> tuple[float, float]:
20152016
curve8 = np.array([[0, 0,0.], [1, 1,0.], [2, 0,0.]], float) # quadratic arc
20162017

20172018
s = time.perf_counter()
2018-
inter78 = bezier_intersect_certified_full(curve7, curve8)
2019+
inter78 = bez_ccx(curve7, curve8)
20192020
print(time.perf_counter() - s, "pruned:", inter78["stats"]["pruned"])
20202021
#print(
20212022
# inter78,
@@ -2044,7 +2045,7 @@ def get_interv(n) -> tuple[float, float]:
20442045
curve_line_h = np.array([[0.0, 0.0, 1.0], [1.0, 1.0, 1.0]])
20452046

20462047
s = time.perf_counter()
2047-
inter_rational = bezier_intersect_certified_full(curve_arc_h, curve_line_h, rational=True)
2048+
inter_rational = bez_ccx(curve_arc_h, curve_line_h, rational=True)
20482049
print(time.perf_counter() - s, "pruned:", inter_rational["stats"]["pruned"])
20492050
assert len(inter_rational["isolated"]) == 1
20502051
assert np.allclose(inter_rational["isolated"][0]["point"], [np.sqrt(0.5), np.sqrt(0.5)], atol=1e-9)
@@ -2080,7 +2081,7 @@ def get_interv(n) -> tuple[float, float]:
20802081
[52.914001, 42.130837, 0. , 0.707 ],
20812082
[49.76 , 45.703 , 0. , 1. ]])
20822083
s = time.perf_counter()
2083-
inter_rational2 = bezier_intersect_certified_full(elliptical_arc_pts_h, arc_pts2_h, rational=True)
2084+
inter_rational2 = bez_ccx(elliptical_arc_pts_h, arc_pts2_h, rational=True)
20842085
print(time.perf_counter() - s, "pruned:", inter_rational2["stats"]["pruned"])
20852086
assert len(inter_rational2["isolated"]) == 2
20862087

@@ -2098,7 +2099,7 @@ def get_interv(n) -> tuple[float, float]:
20982099

20992100
c3d1,c3d2=np.array([[-2.5, -5.0, 0.826], [-2.5, -3.333, 0.826], [-2.5, -1.667, 0.001], [-2.5, 0.0, -0.102]]),np.array([[-5.0, -2.5, 0.052], [-3.333, -2.5, 0.052], [-1.667, -2.5, 0.75], [0.0, -2.5, 0.75]])
21002101
s = time.perf_counter()
2101-
inter_3d_1 = bezier_intersect_certified_full(c3d1,c3d2, rational=False)
2102+
inter_3d_1 = bez_ccx(c3d1, c3d2, rational=False)
21022103
print(time.perf_counter() - s, "pruned:", inter_3d_1["stats"]["pruned"])
21032104
print("pruned_by:", set(inter_3d_1["stats"]["pruned_by"]))
21042105
make_rich_table(inter_3d_1, {"isolated": [{'u':0.499982,'v':0.499986,'point':[-2.500035, -2.500044, 0.400817]}], "overlaps": [],'stats':{}}, 'case 7 (3d)',oracle_name='Expected')
@@ -2114,7 +2115,7 @@ def get_interv(n) -> tuple[float, float]:
21142115
[-0.18421653, 0.21499867, 0.],
21152116
[-0.18858128, 0.2141638, 0.]])
21162117
s = time.perf_counter()
2117-
inter910 = bezier_intersect_certified_full(crv9, crv10, rational=False)
2118+
inter910 = bez_ccx(crv9, crv10, rational=False)
21182119
print(time.perf_counter() - s, "pruned:", inter910["stats"]["pruned"])
21192120

21202121
for i in inter910["isolated"]:
@@ -2140,7 +2141,7 @@ def get_interv(n) -> tuple[float, float]:
21402141
crv12 = np.array([[-0.4507911, 0.11900211, 0.],
21412142
[0.32897481, 0.35801962, 0.],
21422143
[0.25497926, 0.73647834, 0.]])
2143-
inter1112 = bezier_intersect_certified_full(crv11, crv12, rational=False)
2144+
inter1112 = bez_ccx(crv11, crv12, rational=False)
21442145
print(time.perf_counter() - s, "pruned:", inter1112["stats"]["pruned"])
21452146
for i in inter1112["isolated"]:
21462147
print('uv:',[float(i['u']),float(i['v'])], 'point:',i['point'].tolist())

mmcore/numeric/intersection/ccx/_nccx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def _eq(x):
227227
return ints
228228
def _is_rational(curve:NURBSCurveTuple):
229229
return not np.allclose(curve.weights,1)
230-
from mmcore.numeric.intersection.ccx._bez_ccx3 import bezier_intersect_certified_full,map_local_to_global,IsolatedIntersection,OverlapIntersection
230+
from mmcore.numeric.intersection.ccx._bez_ccx3 import bez_ccx,map_local_to_global,IsolatedIntersection,OverlapIntersection
231231

232232

233233
def nurbs_ccx(curve1: NURBSCurve | NURBSCurveTuple, curve2: NURBSCurve | NURBSCurveTuple, tol: float = 1e-3,
@@ -261,7 +261,7 @@ def nurbs_ccx(curve1: NURBSCurve | NURBSCurveTuple, curve2: NURBSCurve | NURBSCu
261261
pts1 = _c1.control_points
262262
pts2 = _c2.control_points
263263
#print(tol)
264-
result=bezier_intersect_certified_full(pts1, pts2, atol=tol, rational=rational)
264+
result=bez_ccx(pts1, pts2, atol=tol, rational=rational)
265265
if len(result['isolated'])==0 and len(result['overlaps'])==0:
266266
#print(set(result['stats']['pruned_by']))
267267
#print(pts1.tolist(),pts2.tolist())
@@ -359,7 +359,7 @@ def get_segm_curve_index(segment_index):
359359
pts1 = segm1.control_points
360360
pts2 = segm2.control_points
361361

362-
result = bezier_intersect_certified_full(pts1, pts2, atol=tol, rational=rational)
362+
result = bez_ccx(pts1, pts2, atol=tol, rational=rational)
363363
if len(result['isolated'])==0 and len(result['overlaps'])==0:
364364
#print(segm1)
365365
#print('$')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
from mmcore.numeric.intersection.csx._ncsx import nurbs_csx
33
from mmcore.numeric.intersection.csx._ncsx2 import nurbs_csx_v2
4-
from mmcore.numeric.intersection.csx._bez_csx3 import bezier_curve_surface_intersect_certified
4+
from mmcore.numeric.intersection.csx._bez_csx3 import bez_csx
55

66

77

88

99

1010

11-
__all__ = ['nurbs_csx','nurbs_csx_v2','bezier_curve_surface_intersect_certified']
11+
__all__ = ['nurbs_csx','nurbs_csx_v2', 'bez_csx']

mmcore/numeric/intersection/csx/_bez_csx3.py

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -837,13 +837,14 @@ def _check_interval(t_a, t_b, uu, vv):
837837
iso_bnd = sorted(iso_bnd, key=lambda it: it["t"])
838838
iso_unique = [iso_bnd[0]]
839839
for it in iso_bnd[1:]:
840+
840841
if abs(float(it["t"]) - float(iso_unique[-1]["t"])) > t_eps:
841842
iso_unique.append(it)
842843
iso_bnd = iso_unique
843844
if ovl_bnd:
844845
if len(ovl_bnd) > 1:
845846
logger.error(
846-
"Boundary overlap returned multiple segments (len=%d) for span confirm.", len(ovl_bnd)
847+
"Boundary overlap returned multiple segments (len=%d) for span confirm.", len(ovl_bnd),ovl_bnd
847848
)
848849
ovl = dict(ovl_bnd[0])
849850
ovl["partial"] = True
@@ -885,10 +886,10 @@ def _check_interval(t_a, t_b, uu, vv):
885886
"partial": True,
886887
}
887888
logger.error(
888-
"Span confirm: one endpoint on surface, boundary intersects=%d (expected 1).",
889-
len(iso_bnd),
889+
"Span confirm: one endpoint on surface, boundary intersects=%d (expected 1). %s",
890+
len(iso_bnd),repr(iso_bnd)
890891
)
891-
raise RuntimeError("curve_surface_boundary_intersect returned unexpected count for span confirm")
892+
raise RuntimeError("curve_surface_boundary_intersect returned unexpected count for span confirm {}".format(len(iso_bnd)))
892893

893894
if not on0 and not on1:
894895
if len(iso_bnd) == 2:
@@ -912,17 +913,28 @@ def _check_interval(t_a, t_b, uu, vv):
912913
"end": "boundary",
913914
"partial": True,
914915
}
916+
elif len(iso_bnd) == 1:
917+
return {
918+
"t": iso_bnd[0]["t"],
919+
"u": iso_bnd[0]["u"],
920+
"v": iso_bnd[0]["v"],
921+
"point": eval_bezier_curve(C, iso_bnd[0]["t"], rational=rational),
922+
"isolated": True,
923+
924+
}
915925
logger.error(
916-
"Span confirm: no endpoints on surface, boundary intersects=%d (expected 2).", len(iso_bnd)
926+
"Span confirm: no endpoints on surface, boundary intersects=%d (expected 2). %s", len(iso_bnd),repr(iso_bnd)
917927
)
918-
raise RuntimeError("curve_surface_boundary_intersect returned unexpected count for span confirm")
928+
raise RuntimeError("curve_surface_boundary_intersect returned unexpected count for span confirm {}".format(len(iso_bnd)))
919929

920930
logger.error(
921931
"Span confirm: unexpected boundary state (on0=%s, on1=%s, iso=%d, ovl=%d).",
922932
on0,
923933
on1,
924934
len(iso_bnd),
925935
len(ovl_bnd),
936+
iso_bnd,
937+
ovl_bnd,
926938
)
927939
raise RuntimeError("Unexpected span-confirm boundary state")
928940

@@ -1654,7 +1666,7 @@ def ch_separability(pts1,pts2, atol,rational=False):
16541666
# print(res,(pts1.tolist(), pts2.tolist()))
16551667
return int(res)
16561668

1657-
from mmcore.numeric.intersection.ccx._bez_ccx3 import bezier_intersect_certified_full
1669+
from mmcore.numeric.intersection.ccx._bez_ccx3 import bez_ccx
16581670

16591671

16601672
# ---------------------------------------------------------------------------
@@ -1737,7 +1749,7 @@ def curve_surface_boundary_intersect(
17371749

17381750
for bnd_curve, fixed_axis, fixed_val in boundaries:
17391751
# Intersect curve C with boundary curve
1740-
ccx_result = bezier_intersect_certified_full(
1752+
ccx_result = bez_ccx(
17411753
C, bnd_curve,
17421754
sv_thresh=sv_thresh,
17431755
atol=atol,
@@ -1808,7 +1820,7 @@ def curve_surface_boundary_intersect(
18081820
check_boundaries_inter = curve_surface_boundary_intersect
18091821

18101822

1811-
def bezier_curve_surface_intersect_certified(
1823+
def bez_csx(
18121824
C: NDArray,
18131825
S: NDArray,
18141826
sv_thresh: float = 1e-8,
@@ -1876,6 +1888,7 @@ def _bbox_diag_len(Cc, Ss):
18761888
rel_thresh=1e-6,
18771889
)
18781890
pre_overlaps: list["OverlapIntersection"] = []
1891+
pre_isolated: list["IsolatedIntersection"] = []
18791892
stats = IntersectionStats(cells=0, pruned=0, overlap_traces=0, pruned_by=[])
18801893
if span_overlap is not None:
18811894
if span_overlap.get("partial"):
@@ -1884,13 +1897,19 @@ def _bbox_diag_len(Cc, Ss):
18841897
stats = IntersectionStats(
18851898
cells=0, pruned=0, overlap_traces=1, pruned_by=["span_confirm_partial"]
18861899
)
1900+
elif span_overlap.get('isolated'):
1901+
stats = IntersectionStats(cells=1, pruned=0, overlap_traces=0, pruned_by=["span_isolated_confirm"])
1902+
del span_overlap['isolated']
1903+
pre_isolated.append(span_overlap)
1904+
return IntersectionResult(isolated=pre_isolated, overlaps=[], stats=stats)
1905+
18871906
else:
18881907
stats = IntersectionStats(cells=1, pruned=0, overlap_traces=1, pruned_by=["span_confirm"])
18891908
return IntersectionResult(isolated=[], overlaps=[span_overlap], stats=stats)
1890-
#isolated,overlaps=curve_surface_boundary_intersect(C,S,rational=rational,atol=atol,sv_thresh=sv_thresh)
1891-
#print(isolated)
1892-
#print(overlaps)
1893-
isolated: list["IsolatedIntersection"] = []
1909+
# isolated,overlaps=curve_surface_boundary_intersect(C,S,rational=rational,atol=atol,sv_thresh=sv_thresh)
1910+
# print(isolated)
1911+
# print(overlaps)
1912+
isolated: list["IsolatedIntersection"] = pre_isolated
18941913
overlaps: list["OverlapIntersection"] = pre_overlaps
18951914

18961915
atol_sq = atol * atol
@@ -2376,7 +2395,7 @@ def make_rich_table(inter1, inter2, *args, **kwargs):
23762395
[ -6.52097953, 26.04573929, 0. ],
23772396
[ 5.81667121, -9.0084582 , 17.47802526]])
23782397
s=time.perf_counter()
2379-
res=bezier_curve_surface_intersect_certified(crv1, surf1,rational=False)
2398+
res=bez_csx(crv1, surf1, rational=False)
23802399

23812400
gt={'isolated':[{
23822401
"t":0.223246,
@@ -2391,7 +2410,7 @@ def make_rich_table(inter1, inter2, *args, **kwargs):
23912410

23922411
crv2 = np.array([[-8.089928672303788, -9.35078823406258, 15.194922104381954, 1.0], [-5.720443423501492, -2.6029262297235642, 10.744432459609845, 0.7071067811865476], [-13.75962333043464, -3.6810935759317296, 15.194922104381954, 1.0]])
23932412
s=time.perf_counter()
2394-
res=bezier_curve_surface_intersect_certified(crv2, surf2,rational=True)
2413+
res=bez_csx(crv2, surf2, rational=True)
23952414
print("case2", time.perf_counter() - s)
23962415
gt={
23972416
"isolated": [],
@@ -2411,7 +2430,7 @@ def make_rich_table(inter1, inter2, *args, **kwargs):
24112430
crv3 = np.array([[-13.704782222797013, 20.157097244338125, 4.980117410327855, 1.0], [-13.780432085162484, 14.253220150508163, 3.521474791948015, 0.7071067811865476], [-19.48847395019814, 14.373405516937003, 4.980117410327855, 1.0]]
24122431
)
24132432
s=time.perf_counter()
2414-
res=bezier_curve_surface_intersect_certified(crv3, surf3,rational=True)
2433+
res=bez_csx(crv3, surf3, rational=True)
24152434
print("case3", time.perf_counter() - s)
24162435
gt={
24172436
"isolated": [],
@@ -2448,7 +2467,7 @@ def make_rich_table(inter1, inter2, *args, **kwargs):
24482467
)
24492468

24502469
s=time.perf_counter()
2451-
res = bezier_curve_surface_intersect_certified(crv4, surf3, rational=True)
2470+
res = bez_csx(crv4, surf3, rational=True)
24522471
print("case4", time.perf_counter() - s)
24532472
gt={
24542473
"isolated": [

0 commit comments

Comments
 (0)