public Structural2DVoid(double[] edgeVertices, int?color, string applicationId = null, Dictionary <string, object> properties = null) { if (properties != null) { Properties = properties; } var pm = new PolygonMesher.PolygonMesher(); pm.Init(edgeVertices); Faces = pm.Faces().ToList(); Vertices = pm.Coordinates.ToList(); if (color != null) { Colors = Enumerable.Repeat(color.Value, Vertices.Count() / 3).ToList(); } else { Colors = new List <int>(); } ApplicationId = applicationId; TextureCoordinates = null; GenerateHash(); }
public Structural2DElementMesh(IEnumerable <double> edgeVertices, int?color, Structural2DElementType elementType, string propertyRef, IEnumerable <StructuralAxis> axes, IEnumerable <double> offsets, string applicationId = null, Dictionary <string, object> properties = null) { if (properties != null) { Properties = properties; } var pm = new PolygonMesher.PolygonMesher(); pm.Init(edgeVertices); Faces = pm.Faces().ToList(); Vertices = pm.Coordinates.ToList(); Colors = (color == null) ? new List <int>() : Enumerable.Repeat(color.Value, Vertices.Count() / 3).ToList(); ElementType = elementType; PropertyRef = propertyRef; if (axes != null) { Axis = axes.ToList(); } if (offsets != null && offsets.Count() > 0) { Offset = offsets.ToList(); } ApplicationId = applicationId; TextureCoordinates = null; GenerateHash(); }