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.
Returns: True if projection was successful.
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.
Returns: -1=indeterminable, 0=coincident, 1=left, 2=right
Evaluate the UV directions at a surface parameter.
Find all the circular subdomains of a curve.
Find all the linear subdomains of a curve.
Find the parameter on the curve where the curvature radius crosses the given threshold.
Returns: Parameter in the [t0, t1] interval closest to t0 where the curvature radius equals the threshold, or double.NaN.
Iterate over all discontinuities on a curve. The start and end of the curve domain are *always* included.
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
PointOnInterior
#Find the most remote point inside a set of closed polylines.
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.
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.
Split a curve with a plane.
Returns: True if the curve was split, false if it ended up in its entirety into either the above or below output.
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.Returns: The surface mesh, or null if meshing failed.
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.public static Mesh[] ToMeshSafe()
this Brep
brep,
Brep to mesh. May be null, in which case an empty array is returned.
parameters,
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.