MCPcopy
hub / github.com/CadQuery/cadquery / paramAt

Method paramAt

cadquery/occ_impl/shapes.py:3293–3309  ·  view source on GitHub ↗

Computes the (u,v) pair closest to a given vector. :returns: (u, v) tuple :param pt: the location to compute the normal at. :type pt: a vector that lies on or close to the surface.

(self, pt: VectorLike)

Source from the content-addressed store, hash-verified

3291 return BRepTools.UVBounds_s(self.wrapped)
3292
3293 def paramAt(self, pt: VectorLike) -> tuple[float, float]:
3294 """
3295 Computes the (u,v) pair closest to a given vector.
3296
3297 :returns: (u, v) tuple
3298 :param pt: the location to compute the normal at.
3299 :type pt: a vector that lies on or close to the surface.
3300 """
3301 # get the geometry
3302 surface = self._geomAdaptor()
3303
3304 # project point on surface
3305 projector = GeomAPI_ProjectPointOnSurf(Vector(pt).toPnt(), surface)
3306
3307 u, v = projector.LowerDistanceParameters()
3308
3309 return u, v
3310
3311 def params(
3312 self, pts: Iterable[VectorLike], tol: float = 1e-9

Callers 2

test_edge_paramAtFunction · 0.45
test_face_paramAtFunction · 0.45

Calls 3

_geomAdaptorMethod · 0.95
VectorClass · 0.85
toPntMethod · 0.80

Tested by 2

test_edge_paramAtFunction · 0.36
test_face_paramAtFunction · 0.36