Skip to content

Commit 0419a3a

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents a2df551 + 9ff1bf3 commit 0419a3a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Fixed input parameters and docstring of `compas_occ.geometry.NurbsSurface.closest_point`.
1415
* Fixed bug in `compas_occ.geometry.NurbsCurve.transform`.
1516

1617
### Removed

src/compas_occ/geometry/surfaces/nurbs.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,12 +654,26 @@ def frame_at(self, u, v):
654654
self.occ_surface.D1(u, v, point, uvec, vvec)
655655
return Frame(Point.from_occ(point), Vector.from_occ(uvec), Vector.from_occ(vvec))
656656

657-
def closest_point(self, point, distance=None, parameter=False):
657+
def closest_point(self, point, return_parameters=False):
658658
"""Compute the closest point on the curve to a given point.
659+
660+
Parameters
661+
----------
662+
point : Point
663+
The point to project to the surface.
664+
return_parameters : bool, optional
665+
Return the projected point as well as the surface UV parameters as tuple.
666+
667+
Returns
668+
-------
669+
:class:`compas.geometry.Point`
670+
The nearest point on the surface, if ``return_parameters`` is false.
671+
(:class:`compas.geometry.Point`, (float, float))
672+
The nearest as (point, parameters) tuple, if ``return_parameters`` is true.
659673
"""
660674
projector = GeomAPI_ProjectPointOnSurf(point.to_occ(), self.occ_surface)
661675
point = Point.from_occ(projector.NearestPoint())
662-
if not parameter:
676+
if not return_parameters:
663677
return point
664678
return point, projector.LowerDistanceParameters()
665679

0 commit comments

Comments
 (0)