Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean Polyline #337

Merged
merged 5 commits into from
Aug 15, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions XML_Adapter/Serialise/Opening.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,17 @@ public partial class GBXMLSerializer

foreach (BH.oM.Environment.Elements.Opening opening in openings)
{
if (opening.Polyline() == null) continue;
Polyline openingPoly = opening.Polyline();

if (openingPoly == null || openingPoly.CleanPolyline(distanceTolerance: 0.01) == null) continue;

openingPoly = openingPoly.CleanPolyline(distanceTolerance: 0.01);

BH.oM.XML.Opening gbOpening = BH.Engine.XML.Convert.ToGBXML(opening);

//Normals away from space
if (!BH.Engine.Environment.Query.NormalAwayFromSpace(opening.Polyline(), space))
gbOpening.PlanarGeometry.PolyLoop = BH.Engine.XML.Convert.ToGBXML(opening.Polyline().Flip());
if (!BH.Engine.Environment.Query.NormalAwayFromSpace(openingPoly, space))
gbOpening.PlanarGeometry.PolyLoop = BH.Engine.XML.Convert.ToGBXML(openingPoly.Flip());

Panel buildingElement = new Panel();
;
Expand Down