CurveLoop Class


A class that represents a chain of curves.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 16.0.0.0 (16.0.0.0)
Since: 2012

Syntax

C#
public class CurveLoop : IEnumerable<Curve>, 
	IDisposable
Visual Basic
Public Class CurveLoop _
	Implements IEnumerable(Of Curve), IDisposable
Visual C++
public ref class CurveLoop : IEnumerable<Curve^>, 
	IDisposable

Remarks

There are a specific set of requirements for how valid CurveLoops must be formed:
  • The curves must typically be continuous.
  • It may be either closed (where the start and end points coincide) or open.
  • There should be no self-intersections.

A CurveLoop is said to be "continuous" if either:

  • the loop contains at most one curve
  • the end of each curve coincides with the start of the next one (if there is a next curve).

Many geometry utilities require CurveLoops to be continuous, but discontinuous CurveLoops are sometimes used. For example, the curves in a continuous CurveLoop may be offset, resulting in a discontinuous loop if the offset curves overlap or do not meet, and the offset curves might then be extended or trimmed to form a continuous CurveLoop.

A CurveLoop is said to be "closed" if it is non-empty, continuous, and if either:

  • the loop contains just one curve, which is unbounded and periodic
  • the loop's end point coincides with its start point
For example, a CurveLoop comprising four lines forming a rectangle, listed in order around the rectangle, with each curve oriented in direction in which the curves are listed is closed. As another example, a CurveLoop consisting of just one unbounded circle is closed.

A CurveLoop is said to be "open" if it is not closed. For example, a CurveLoop consisting of a single line is open, as is the "offset CurveLoop" mentioned above. Note that an open CurveLoop may be continuous or discontinuous, and a continuous CurveLoop may be open or closed. The definitions imply that a discontinuous CurveLoop is necessarily open and an empty CurveLoop is open.

It should also be noted that these definitions take the order of the curves and the curves' directions into account. For example, a CurveLoop comprising the four edges of a rectangle in the order {bottom, top, left, right} is discontinuous. Similarly, a CurveLoop comprising the four edges of a rectangle in the order {bottom, right, top, left}, with three of the lines oriented in the counter-clockwise direction of the rectangle and the fourth oriented in the clockwise direction, is discontinuous.

Finally, note that some routines in Revit may set the CurveLoop to be marked "open" or "closed" in spite of the actual geometry of the curves. In these special cases, the CurveLoop class does not require that the CurveLoop is correctly marked.

In the API, the members of the CurveLoop may be directly iterated, as the class implements IEnumerable<Curve>. The iteration provides copies of the curves directly contained in the loop; modification of the curves will not affect the curves that are contained in the loop.

Inheritance Hierarchy

System Object
Autodesk.Revit.DB CurveLoop

See Also