Skip to content

Commit

Permalink
Another libspline wrapper (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Neil Wu <neilwu0626@gmail.com>
  • Loading branch information
hajdik and ewu63 authored Aug 20, 2021
1 parent a9e7233 commit 95a103e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyspline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.4.0"
__version__ = "1.5.0"

from .pyCurve import Curve
from .pySurface import Surface
Expand Down
25 changes: 25 additions & 0 deletions pyspline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,28 @@ def line_plane(ia, vc, p0, v1, v2):
"""

return libspline.line_plane(ia, vc, p0, v1, v2)


def searchQuads(pts, conn, searchPts):
"""
This routine searches for the closest point on a set of quads for each searchPt.
An ADT tree is built and used for the search and subsequently destroyed.
Parameters
----------
pts : ndarray[3, nPts]
points defining the quad elements
conn : ndarray[4, nConn]
local connectivity of the quad elements
searchPts : ndarray[3, nSearchPts]
set of points to search for
Returns
-------
faceID : ndarray[nSearchPts]
index of the quad elements, one for each search point
uv : ndarray[2, nSearchPts]
parametric ``u`` and ``v`` weights of the projected point on the closest quad
"""

return libspline.adtprojections.searchquads(pts, conn, searchPts)

0 comments on commit 95a103e

Please sign in to comment.