@@ -1792,8 +1792,8 @@ def compute_branch_curves_hermite(branch: SSXBranch, surface1:NURBSSurfaceTuple,
17921792 def _eval_curve (t ):
17931793 stuv = evaluate_nurbs_curve (branch .curve , t , d_order = 0 )["C" ]
17941794 se1 = evaluate_nurbs_surface (surface1 ,stuv [0 ],stuv [1 ],d_order = 0 )
1795- se2 = evaluate_nurbs_surface ( surface2 , stuv [ 2 ], stuv [ 3 ], d_order = 0 )
1796- return ( se2 [ 'S' ] - se1 [ 'S' ]) * 0.5 + se1 ['S' ]
1795+
1796+ return se1 ['S' ]
17971797
17981798 eval_curve_ders = fdm (_eval_curve )
17991799 _points = []
@@ -1802,16 +1802,15 @@ def _eval_curve(t):
18021802 params = _greville_abscissae (branch .curve .knot , branch .curve .degree )
18031803 # params=np.unique(branch.curve.knot)
18041804 #p_cur=0
1805-
1805+ params = branch . curve . control_points
18061806 for s in params :
18071807 #d1=eval_curve_ders(s)
18081808 #d1/=np.linalg.norm(d1)
18091809
18101810 #_ders.append(d1)
1811- _points .append (_eval_curve (s ))
18121811
1813- # p_cur+=np.dot(d1 ,d1)
18141812
1813+ _points .append (evaluate_nurbs_surface (surface1 , s [0 ], s [1 ], d_order = 0 )['S' ])
18151814
18161815
18171816 #from more_itertools import pairwise
@@ -1822,7 +1821,7 @@ def _eval_curve(t):
18221821 #
18231822 #
18241823 # crvs.append(bern_to_nurbs_bezier(np.array([ps,ps+ds*h,pe-ds*h,pe]),interval=(ts,te),rational=False))
1825- branch .curve_xyz = interpolate_nurbs_curve (np .array (_points ),branch .curve .degree )
1824+ branch .curve_xyz = interpolate_nurbs_curve (np .array (_points ),degree = branch .curve .degree , use_centripetal = True , method = 'lu' , remove_duplicates = True , tol = atol )
18261825 #branch.curve_xyz=remove_knots_after_merge(crv,interior,atol)
18271826
18281827def compute_branch_curves (branch : SSXBranch , surface1 :NURBSSurfaceTuple , surface2 :NURBSSurfaceTuple ,** kwargs ):
@@ -1840,6 +1839,7 @@ def compute_branch_curves(branch: SSXBranch, surface1:NURBSSurfaceTuple, surface
18401839
18411840def compute_point_xyz (point :SSXPoint , surface1 :NURBSSurfaceTuple , surface2 :NURBSSurfaceTuple ,** kwargs ):
18421841 point .xyz = evaluate_nurbs_surface (surface1 ,point .stuv [0 ],point .stuv [1 ],d_order = 0 )['S' ]
1842+
18431843def bez_ssx (H1 : NDArray [np .float64 ], H2 : NDArray [np .float64 ], * , atol : float = 0.001 , angle_tol : float = 0.052 ,
18441844 tol : float = 1e-8 , gjk_max_iter : int = 64 , gm_eps : float = 1e-5 , gm_tol : float = 1e-8 , max_depth : int = 24 ,
18451845 magic_start_depth : int = 6 , flat_angle : float = 0.015 , march_samples : int = 8 ,
@@ -1864,7 +1864,9 @@ def nurbs_ssx(surf1, surf2, *, atol: float = 0.001, angle_tol: float = 0.052, to
18641864 deflate_hard_case : bool = True ) -> tuple [list [SSXBranch ], list [SSXPoint ]]:
18651865 s1 = surf1
18661866 s2 = surf2
1867-
1867+ if s1 .control_points .shape == s2 .control_points .shape :
1868+ if np .allclose (s1 .control_points ,s2 .control_points ):
1869+ return
18681870 s1d = decompose_surface (s1 )
18691871 s2d = decompose_surface (s2 )
18701872
0 commit comments