Skip to content

Commit

Permalink
#1152 updated Metod, added descriptions and inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
MajaLindroth authored and Fraser Greenroyd committed Oct 22, 2019
1 parent 3a310cb commit ab92e5c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Environment_Engine/Modify/CleanPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,17 @@ namespace BH.Engine.Environment
{
public static partial class Modify
{
[Description(" hej")]
[Input("panels", " ")]
[Output("cleanedPanels", " ")]
public static List<Panel> CleanPanel(this List<Panel> panels, double minimumAcceptableAngle, double minimunSegmentLength)
[Description("Returns a list of panels that has been cleaned from short segments and insignificant vertices")]
[Input("panels", "A list of panels that will be cleaned")]
[Input("angleTolerance", "The tolerance of the angle that defines a straight line. Default is set to the value defined by BH.oM.Geometry.Tolerance.Angle")]
[Input("minimumSegmentLength", "The length of the smallest allowed segment. Segments smaller than this will be removed. Default is set to the value defined by BH.oM.Geometry.Tolerance.Distance")]
[Output("cleanedPanels", "A list of panels that has been cleaned")]
public static List<Panel> CleanPanel(this List<Panel> panels, double angleTolerance = Tolerance.Angle, double minimunSegmentLength = Tolerance.Distance)
{
//Two tolerances coming in:
//minimumSegmentLength - default to Tolerance.Distance
//minimumAcceptableAngle - default to Tolerance.Angle

List<Panel> clonedPanels = new List<Panel>(panels.Select(x => x.DeepClone<Panel>()).ToList());

foreach (Panel p in clonedPanels)
p.ExternalEdges = p.Polyline().CleanPolyline().ToEdges();

p.ExternalEdges = p.Polyline().CleanPolyline(angleTolerance, minimunSegmentLength).ToEdges();
return clonedPanels;
}
}
Expand Down

0 comments on commit ab92e5c

Please sign in to comment.