Open Tom-Kingstone opened 4 months ago
After some discussion, @jamesramsden-bh suggested that we simply catch the error and provide a more user-friendly error when this exception is thrown. Something like one of the internal boundaries splits the planar surface into two, ensure that internal boundaries do not span the width of the planar surface
.
The overarching issue of Panels having invalid geometry for a planar surface (even when the panels' geometry is nominally valid) has a solution in this branch: https://github.com/BHoM/BHoM_Engine/tree/Analytical_Engine-%233322-PanelGeometryFix The issue with PlanarSurface not having a useful error message has a solution on this branch: https://github.com/BHoM/BHoM_Engine/tree/Geometry_Engine-%233322-ImprovePlanarSurfaceErrors
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:
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):