SubDSurfaceInterpolator
ReferencesInterpolate some or all of the vertices limit surface positions in a SubD to specified locations. NB: It is recommended not to use these methods to interpolate more than 1000 vertices. SubD.SetVertexSurfacePoint(uint, Point3d) SubD.InterpolateSurfacePoints(Point3d[]) SubD.InterpolateSurfacePoints(uint[], Point3d[]) SubDVertex.SurfacePoint()
Constructors
public SubDSurfaceInterpolator()
Initialize an empty SubDSurfaceInterpolator.
Finalizer
~SubDSurfaceInterpolator()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
Properties
The context assigned id. This id is provided for applications using ON_SubDSurfaceInterpolator. It is not inspected or used in any part of the interpolation setup or calculations.
Remarks: In Rhino, when an interpolator is being used to modify a CRhinoSubDObject, this id is often the Rhino object id.
Interpolation requires building a solver. We estimate that this solver will work in reasonnable time if the number of interplolated vertices is smaller than MaximumInterpolatedVertexCount. However, given sufficient time, memory, and CPU resources, the code will work with any value. In version 8.0, this value is 1000.
Methods
[CLSCompliant(false)]
public static SubDSurfaceInterpolator CreateFromMarkedVertices(SubD subd, bool interpolatedVerticesMark, out uint freeVertexCount)
Create an interpolator where all the marked vertices (unmarked if interpolatedVerticesMark is false) in the SubD are free vertices in the linear system used for interpolation, and the unmarked (marked if interpolatedVerticesMark is false) are fixed to their initial positions. Free vertices are can move as a result of the interpolation, and can receive an interpolation target location.
Remarks: Sets ContextId to the Guid of the Rhino SubD object for subd.
Parameters:
| subd (SubD) | The SubD to use for interpolation |
| interpolatedVerticesMark (bool) | If True, marked vertices will be considered free, and unmarked vertices will be fixed. |
| freeVertexCount (out uint) | The number of free vertices in the system |
Returns: A new SubDSurfaceInterpolator
[CLSCompliant(false)]
public static SubDSurfaceInterpolator CreateFromSelectedVertices(SubD subd, out uint freeVertexCount)
Create an interpolator where all the selected vertices in the SubD are free vertices in the linear system used for interpolation, and the unselected are fixed to their initial positions. Free vertices are can move as a result of the interpolation, and can receive an interpolation target location.
[CLSCompliant(false)]
public static SubDSurfaceInterpolator CreateFromSubD(SubD subd, out uint freeVertexCount)
Create an interpolator where all the vertices in the SubD are free vertices in the linear system used for interpolation (i.e. can move as a result of the interpolation, and can receive an interpolation target location).
[CLSCompliant(false)]
public static SubDSurfaceInterpolator CreateFromVertexIdList(SubD subd, IEnumerable<uint> vertexIndices, out uint freeVertexCount)
Create an interpolator where all the listed vertices in the SubD are free vertices in the linear system used for interpolation, and the unselected are fixed to their initial positions. Free vertices are can move as a result of the interpolation, and can receive an interpolation target location.
Remarks: Sets ContextId to the Guid of the Rhino SubD object for subd.
Parameters:
| subd (SubD) | The SubD to use for interpolation |
| vertexIndices (IEnumerable<uint>) | Indices of the vertices to be interpolated |
| freeVertexCount (out uint) | The number of free vertices in the system |
Returns: A new SubDSurfaceInterpolator
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
For derived class implementers.
This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.
You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.
Also, you must call the base virtual method within your overriding method.
Parameters:
| disposing (bool) | true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer. |
Returns: Number of vertices with fixed surface points.
Returns: Number of vertices with interpolated surface points.
Parameters:
| vertexId (uint) |
Returns: If vertex is an interpolated vertex, returns the index of the vertex in the array returned by VertexIdList(). Otherwise, returns ON_UNSET_UINT_INDEX.
Parameters:
| vertex (SubDVertex) |
Returns: True if the vertex surface point is being interpolated.
Parameters:
| vertexId (uint) |
Returns: True if the vertex surface point is being interpolated.
Solve the interpolation system, given target interpolation locations for the free vertices in the system. Updates the subd referenced by this system so the corresponding surface points are at the locations given by surfacePoints.
Parameters:
| surfacePoints (Point3d[]) | The limit surface locations for the interpolated vertices. The number of desired locations needs to match the InterpolatedVertexCount(). |
Returns: True if a solution was found.
public void Transform(Transform transform)
Apply an arbitrary transformation to the target interpolation points.
Parameters:
| transform (Transform) | The transformation to apply. |
Returns: List of indices of the vertices with interpolated surface points. Vertices that are not in this vertex list have unchanged control net points.