Geometry_Engine: PlanarSurface throws unhelpful errors on some geometries
- Dominant language
- C#
- Stars
- 30
- Forks
- 13
- Avg merge
- 7d 10h
- Merged PRs (30d)
- 5
Description
#### Description:
Coming up in testing IES and XML toolkits, There are multiple panels which have geometry similar to this:

where an internal curve (as an opening) meets the external curve. When these curves are input into PlanarSurface, it causes this error to be raised:
```
1. This component failed to run properly.
- Error: Sequence contains more than one element
- Occured in BH.Engine.Geometry.Create.PlanarSurface(ICurve externalBoundary, List`1 internalBoundaries, Double tolerance)
called from BH.UI.Base.Caller.Run(List`1 inputs)
- Are you sure you have the correct type of inputs? Check their description for more details.
```
This was introduced a few years back in creating planar surfaces when multiple try/catches were removed, and some of the logic was changed. The error is thrown here:https://github.com/BHoM/BHoM_Engine/blob/aed0d0617bb80b49519fec32e548610c02ba8aab/Geometry_Engine/Create/PlanarSurface.cs#L139
caused by BooleanDifference returning a list with more than one element due to there being more than one region returned from boolean difference.
#### Steps to reproduce:
Use `Create.PlanarSurface(externalBoundary, internalBoundaries, tolerance)` with geometry similar to that of the image below.
#### Expected behaviour:
Not sure how to describe it, but it should create a surface that looks like this:

#### Test file(s):
Contributor guide
Assessment
This issue has not been assessed yet.