SubDEdgeChain
Since v8.36An ordered run of connected SubD edges.
Consecutive edges in a chain share a vertex, and each edge carries the direction it is traversed with, so the chain has a start and an end even when the individual edges do not agree on orientation. Chains are what commands like Bridge, Loft and edge sharpening operate on.
Remarks: A chain holds a reference to its SubD and does not keep it alive across edits that change the SubD topology; rebuild the chain after editing.
Constructors
Creates a chain containing a single starting edge. Grow it with AddAllNeighbors(ChainDirection, SubDChainType) or AddOneNeighbor(ChainDirection, SubDChainType).
Finalizer
Properties
The number of edges in this chain.
Methods
[CLSCompliant(false)]
public uint AddAllNeighbors(ChainDirection direction, SubDChainType chainType)
Extends the chain as far as it will go at one or both ends.
Parameters:
| direction (ChainDirection) | Which end or ends to extend. |
| chainType (SubDChainType) | Which edges and vertices the chain is allowed through. |
Returns: The number of edges that were added.
Adds an edge to whichever end of the chain it connects to.
Remarks: This cannot start a chain: adding to an empty chain does nothing and returns 0. Use Begin(SubDEdge) or the SubDEdgeChain(SubD, SubDEdge) constructor for the first edge.
Parameters:
| edge (SubDEdge) | The edge to add. |
Returns: The number of edges that were added, so 1 on success and 0 if the edge does not connect to either end, is already in the chain, or the chain is empty.
Extends the chain by one edge at one or both ends.
Parameters:
| direction (ChainDirection) | Which end or ends to extend. |
| chainType (SubDChainType) | Which edges and vertices the chain is allowed through. |
Returns: The number of edges that were added.
Clears the chain and restarts it from a single edge.
Parameters:
| startEdge (SubDEdge) | The edge to start from. |
Returns: The number of edges in the chain, so 1 on success and 0 on failure.
Gets the edge at the given position in the chain. The returned edge carries the direction the chain traverses it with, in SubDComponent.ComponentDirection.
Parameters:
| index (int) | The position in the chain. |
Returns: The edge, or null if index is out of range.
True when the chain is a closed loop that is convex.
Parameters:
| strictlyConvex (bool) | If true, a loop with three or more colinear points in a row is not convex. |
Sorts a set of edges into chains.
Remarks: This uses the mark bits on the edges and vertices involved, so it must not run on the same SubD from more than one thread at a time.
Parameters:
| subd (SubD) | The SubD the edges belong to. |
| edges (IEnumerable<SubDEdge>) | The edges to sort. Where three or more of them meet at one vertex, no chain passes through that vertex. |
Returns: One array of edges per chain, in chain order. Each returned edge carries the direction its chain traverses it with.
Gets a NURBS curve suitable for lofting SubDs, following this chain.
Returns: The curve, or null if the chain is not valid.
Gets a NURBS curve on the SubD surface following this chain.
Returns: The curve, or null if the chain is not valid.
Trims the chain down to the run of edges between firstEdge and lastEdge, removing everything before firstEdge and everything after lastEdge.
Remarks: This wraps ON_SubDEdgeChain::RemoveEdges, whose name reads as though the given range is what gets removed. It is the other way round: the range is what survives. Passing null for both edges therefore removes nothing and returns 0; use Clear() to empty the chain.
Parameters:
| firstEdge (SubDEdge) | The edge to keep as the new start of the chain. Pass null to keep the current start. |
| lastEdge (SubDEdge) | The edge to keep as the new end of the chain. Pass null to keep the current end. |
Returns: The number of edges that were removed.
Gets the vertex at the given position along the chain. A chain of N edges has N+1 vertices, or N when it is a closed loop.
Parameters:
| index (int) | The position along the chain. |
Returns: The vertex, or null if index is out of range.