public static ShapeObject CreatePolygon(Vector3[] pts) { Polygon pg = new Polygon(pts); ShapeObject so = ShapeObject.CreateBasic(); Vector3? ld = PointsBase.LongestDirection(pts); so.SetMeshable(pg, ld); return(so); }
public static ShapeObject CreateExtrusion(Vector3[] pts, float d) { Vector3 magUp = new Vector3(0, d, 0); Polygon pg = new Polygon(pts); Extrusion ext = pg.Extrude(magUp); ShapeObject so = ShapeObject.CreateBasic(); Vector3? ld = PointsBase.LongestDirection(pts); so.SetMeshable(ext, ld); return(so); }
void Start() { Vector3[] pts = new Vector3[5]; pts[0] = new Vector3(-80, 0, 46); pts[1] = new Vector3(-80, 0, -11); pts[2] = new Vector3(-10, 0, -54); pts[3] = new Vector3(103, 0, 25); pts[4] = new Vector3(96, 0, 70); pl = new Polyline(pts); Vector3?ld = PointsBase.LongestDirection(pts); //passed //ShapeObject so = ShapeObject.CreatePolygon(pts); ShapeObject so = ShapeObject.CreateExtrusion(pts, 40); }
public static ShapeObject CreateExtrusion(Vector3[] pts, float d) { Vector3 magUp = new Vector3(0, d, 0); Polygon pg = new Polygon(pts); Form ext = pg.Extrude(magUp); Debug.Log("ext.verticesCount" + ext.vertices.Length.ToString()); Debug.Log("ext.trianglesCount" + ext.triangles.Length.ToString()); Debug.Log("ext.polygonCount" + ext.components.Count.ToString()); ShapeObject so = ShapeObject.CreateBasic(); Vector3? ld = PointsBase.LongestDirection(pts); so.SetMeshable(ext, ld); return(so); }