hypar-io / Elements

The smallest useful BIM.
https://www.hypar.io
MIT License
349 stars 74 forks source link

Indexed polycurve #976

Closed ikeough closed 1 year ago

ikeough commented 1 year ago

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:

FUTURE WORK:

REQUIRED:

An indexed polycurve created by filleting a polygon. image

An indexed polycurve created by filleting a polyline. image


This change is Reviewable

ikeough commented 1 year ago

Set this back to draft to fix all test failures and to unify parameters on polygons as well.