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
Show file tree
Hide file tree
Changes from 2 commits
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: settings.Tolerance) == null) continue;

openingPoly = openingPoly.CleanPolyline(distanceTolerance: settings.Tolerance);

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
1 change: 1 addition & 0 deletions XML_oM/XMLSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class XMLSettings : BHoMObject
public bool NewFile { get; set; } = true;
public UnitType UnitType { get; set; } = UnitType.SI;
public ExportDetail ExportDetail { get; set; } = ExportDetail.Full;
public Double Tolerance { get; set; } = 0.01;
FraserGreenroyd marked this conversation as resolved.
Show resolved Hide resolved

/***************************************************/
}
Expand Down