Skip to content

Commit 95a103e

Browse files
hajdikewu63
andauthored
Another libspline wrapper (#30)
Co-authored-by: Neil Wu <neilwu0626@gmail.com>
1 parent a9e7233 commit 95a103e

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

pyspline/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.4.0"
1+
__version__ = "1.5.0"
22

33
from .pyCurve import Curve
44
from .pySurface import Surface

pyspline/utils.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,3 +448,28 @@ def line_plane(ia, vc, p0, v1, v2):
448448
"""
449449

450450
return libspline.line_plane(ia, vc, p0, v1, v2)
451+
452+
453+
def searchQuads(pts, conn, searchPts):
454+
"""
455+
This routine searches for the closest point on a set of quads for each searchPt.
456+
An ADT tree is built and used for the search and subsequently destroyed.
457+
458+
Parameters
459+
----------
460+
pts : ndarray[3, nPts]
461+
points defining the quad elements
462+
conn : ndarray[4, nConn]
463+
local connectivity of the quad elements
464+
searchPts : ndarray[3, nSearchPts]
465+
set of points to search for
466+
467+
Returns
468+
-------
469+
faceID : ndarray[nSearchPts]
470+
index of the quad elements, one for each search point
471+
uv : ndarray[2, nSearchPts]
472+
parametric ``u`` and ``v`` weights of the projected point on the closest quad
473+
"""
474+
475+
return libspline.adtprojections.searchquads(pts, conn, searchPts)

0 commit comments

Comments
 (0)