DynamoDS/Dynamo — pull request #1965 by pboyer (2014-07-16 22:52:06+00:00)
Title: Face Edge Loop Partitioning

### Purpose

The core issue in #1934 is Revit's `Face` representation allows multiple outer `Edge` loops, which are not supported in ProtoGeometry `Surface`. Hence, extracting `Solid`s from a Revit `Element` would at times fail as a prerequisite for creating a `Solid` is correctly converting the `Face`s.

### Terminology (for reference)

In standard BRep (Boundary Representation) terminology:

* A *Solid* is a closed topology of faces and edges.
* A *Face* is represented by an underlying analytical surface (usually parameterized in 2D) and a collection of edge loops that bound the surface. A surface, of course, can have unlimited extent if not bound.
* An *Edge* is a curve, lying within a face, representing a boundary of a face. Two adjacent faces in a solid share an edge. A coedge constitutes a faces reference to an edge.
* An *Edge Loop* constitutes a multi-part trimming curve of an underlying analytical surface, made up of a close loop of coedges. These allow us to "trim" a surface into a face. Note that it's possible for edge loops to be nested within each other, allowing one to cut out inner regions of an outer edge loop.

An unfortunate reality of things is that a ProtoGeometry `Surface` is actually, under the hood, an ASM face! So, bear with me if the terminology seems mixed. This is odd, but it makes sense for users, who would prefer to not think about any of this kind of terminology.

### Discussion

In Revit, unlike ProtoGeometry, Dynamo's core geometry library, it's possible for a single Revit `Face` to possess two disconnected edge loops that are *not* contained within each other. This results in two *disconnected* components to a Revit `Face`, even though there is only one single underlying surface. This is common throughout the solids used to represent Revit Walls.

This pull request adds support to partition the edge loops of a Revit `Face` into disconnected components. Hence, there is now a 1-n mapping between a single Revit `Face` and ProtoGeometry `Surface`s when converted via ToProtoType().

This collection of ProtoGeometry Surfaces can be joined into order to form a Solid or PolySurface, which is done when converting a Revit Solid into it's ProtoGeometry equivalent.

### Unit tests

This pull request adds additional tests using wall geometry taken from the "advanced" sample in Revit.

### Screenshot

![wallelements](https://cloud.githubusercontent.com/assets/916345/3606796/cc1b47ca-0d3b-11e4-8cfd-64de00367b9d.PNG)