BACKGROUND:
We previously built a class called Contour that was IEnumerable<Curve>. This class was meant to support planar compositions of any curve type. It was not thoroughly designed. After completing work on trimmed curves in #957 #961 #959, we decided to rebuild a composite curve type capable of representing networks of lines and arcs.
DESCRIPTION:
This PR implements a new class IndexedPolycurve which is a composite curve of line and arc segments. The external representation of the curve is a set of vertices and a set of sets of of indices which implicitly describe the constructing curves. In this way it is similar to IFCIndexedPolycurve. In addition to being IEnumerable<BoundedCurve>, allowing the user to do foreach(var curve in polycurve), it is also a BoundedCurve, allowing the user to find the start, end, point at at parameter, and transforms along the curve.
The Contour class is deprecated, and locations that used the Contour class, such as the creation of a filleted polycurve from a polygon, now return an IndexedPolycurve.
TESTING:
How should a reviewer observe the behavior desired by this pull request?
FUTURE WORK:
We need to take a position on whether this curve is strictly planar. We do not check and we do not enforce planarity. As such, you can make a polycurve that represents, for example, a duct run, with arc sections and lines running in 3D. This seems useful.
This implementation sacrifices memory for inheritance. The indexed polycurve has a set of curves that are derived from its vertices. We don't want to have to recreate these whenever someone uses the iterator, so we cache them. This is an improvement over what we used to do with polygons, allowing people to call Segments(), but it creates curves even for the polygon case where they might not ever be used.
This is a mutable class, which is problematic because of the curves that we cache. If the caller adds or removes vertices to the polygon, the index sets and the internal curve sets need to be rebuilt. We can handle this by making the vertex collection read only and adding modifier methods, or we can make the iterator construct the curves.
REQUIRED:
[x] All changes are up to date in CHANGELOG.md.
An indexed polycurve created by filleting a polygon.
An indexed polycurve created by filleting a polyline.
BACKGROUND: We previously built a class called
Contour
that wasIEnumerable<Curve>
. This class was meant to support planar compositions of any curve type. It was not thoroughly designed. After completing work on trimmed curves in #957 #961 #959, we decided to rebuild a composite curve type capable of representing networks of lines and arcs.DESCRIPTION: This PR implements a new class
IndexedPolycurve
which is a composite curve of line and arc segments. The external representation of the curve is a set of vertices and a set of sets of of indices which implicitly describe the constructing curves. In this way it is similar to IFCIndexedPolycurve. In addition to beingIEnumerable<BoundedCurve>
, allowing the user to doforeach(var curve in polycurve)
, it is also aBoundedCurve
, allowing the user to find the start, end, point at at parameter, and transforms along the curve. TheContour
class is deprecated, and locations that used theContour
class, such as the creation of a filleted polycurve from a polygon, now return anIndexedPolycurve
.TESTING:
FUTURE WORK:
Segments()
, but it creates curves even for the polygon case where they might not ever be used.REQUIRED:
CHANGELOG.md
.An indexed polycurve created by filleting a polygon.
An indexed polycurve created by filleting a polyline.
This change is