-
Notifications
You must be signed in to change notification settings - Fork 113
Feature/rhino object functions #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/rhino object functions #256
Conversation
…ng/remapping objects on surface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should avoid just providing wrappers to the corresponding rs.xxx functions and use RhinoCommon object methods where possible...
it is not entirely clear what some of the functions actually do, so examples and more explanations are necessary...
| The curve's length. | ||
| """ | ||
| return rs.CurveLength(self.guid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the object is also stored, and there is a method of the object for getting the length...
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Curve_GetLength_2.htm
| """ | ||
|
|
||
| return rs.IsCurveClosed(self.guid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/compas_rhino/geometry/surface.py
Outdated
| The list of XYZ coordinates of surface boundary kinks. | ||
| """ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line
src/compas_rhino/geometry/surface.py
Outdated
| """ | ||
|
|
||
| borders = self.borders(type = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces
src/compas_rhino/geometry/surface.py
Outdated
| borders = self.borders(type = 0) | ||
| proj_dist = {tuple(proj_xyz): distance_point_point(xyz, proj_xyz) for proj_xyz in [RhinoCurve(border).closest_point(xyz) for border in borders]} | ||
| delete_objects(borders) | ||
| return min(proj_dist, key = proj_dist.get) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces
src/compas_rhino/geometry/surface.py
Outdated
| The XYZ coordinates of the re-mapped point. | ||
| """ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line
src/compas_rhino/geometry/surface.py
Outdated
| The XYZ coordinates of the closest point on the boundaries of the surface. | ||
| """ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line
| The XYZ coordinates of the closest point on the surface. | ||
| """ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line
src/compas_rhino/geometry/surface.py
Outdated
|
|
||
| return rs.SurfaceClosestPoint(self.guid, xyz) + (0.,) | ||
|
|
||
| def remap_xyz_point(self, uv): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example?
src/compas_rhino/geometry/surface.py
Outdated
| Parameters | ||
| ---------- | ||
| uv : list | ||
| List of UV(0) coordinates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UV(0)
|
instead of wrapping rhinoscriptsyntax functions, is it better to wrap RhinoCommon functions or not wrapping anything and calling RhinoCommon methods directly? |
Rhino curve and surface functions
curve length and is_closed
surface kinks, closest_point, closest_point_on_boundary and several mapping/remapping functions between XYZ and UV(0) spaces based on the surface's parameterisation