GeometryExtensionMethods
Extension methods for several types in Rhino.Geometry.
Methods
Perform poor-man's brep face closest point logic. It projects the point to the underlying surface then back onto the trimmed portion if need be.
Create samples in curve parameter space using a fixed number of span-divisions.
Create samples in curve parameter space using a fixed number of span-divisions.
Determine on which side of a curve a point falls.
Evaluate the UV directions at a surface parameter.
public static IEnumerable<Interval> FindCocircularDomains(this Curve curve, double absoluteTolerance, double angularTolarance)
Find all the circular subdomains of a curve.
public static IEnumerable<Interval> FindCollinearDomains(this Curve curve, double absoluteTolerance, double angularTolarance)
Find all the linear subdomains of a curve.
Find the parameter on the curve where the curvature radius crosses the given threshold.
Iterate over all discontinuities on a curve. The start and end of the curve domain are *always* included.
Parameters:
| curve (Curve) | |
| continuity (Continuity) |
Gets the 6 sides of a box as rectangles. Oriented such that the rectangle plane normal always points away from the box interior. The order of the faces is: bottom, left, front, right, back, top
Parameters:
| box (Box) |
PointOnInterior
#Find the most remote point inside a set of closed polylines.
Parameters:
| boundaries (Point2d[][]) | |
| precision (double) |
PointOnInterior
#Find the most remote point inside a set of closed polylines. Only the X and Y coordinates of the polylines are taken into account. Polylines should all be closed.
Parameters:
| boundaries (Polyline[]) | |
| precision (double) |
Return a point on the interior of a face.
Return a point on the interior of a face.
Return a point in the middle of the longest interior isocurve domain from a random sampling.
Get the curvature radius at a parameter.
Create an array of points sampled from each curve span.
Parameters:
| vertices (MeshVertexList) | |
| points (IEnumerable<Point3d>) |
Parameters:
| vertices (MeshVertexList) | |
| points (Point3d[]) |
Split a curve with a plane.
Mesh a surface in a thread-safe manner. See ToMeshSafe(Brep, MeshingParameters, MeshType?) for why this is necessary; this method locks on
surface so it cannot be meshed on two threads at once.Parameters:
| surface (Surface) | Surface to mesh. May be null, in which case null is returned. |
| parameters (MeshingParameters) | Meshing parameters. |
Returns: The surface mesh, or null if meshing failed.
public static Mesh[] ToMeshSafe(this Brep brep, MeshingParameters parameters, MeshType? meshType = null)
Mesh a brep in a thread-safe manner. Meshing a Rhino brep is not thread-safe on the native side. This method locks on
brep - the same monitor the display pipeline uses - so at most one thread meshes a given instance at a time. If every face already carries a cached mesh it is reused rather than re-meshed.Parameters:
| brep (Brep) | Brep to mesh. May be null, in which case an empty array is returned. |
| parameters (MeshingParameters) | Meshing parameters. |
| meshType (MeshType? = null) | Optional mesh type. When supplied, cached meshes of this type are reused and any freshly created meshes are stored back onto the brep faces for later reuse. When omitted, any available cached mesh is reused, but newly created meshes are not stored. |
Returns: One mesh per brep face, or an empty array if meshing failed.