public static Grevit.Types.Point ToGrevitPoint(this SketchUpNET.Vertex v, SketchUpNET.Transform t = null) { if (t != null) { SketchUpNET.Vertex vertex = t.GetTransformed(v); return new Grevit.Types.Point(vertex.X, vertex.Y, vertex.Z); } else return new Grevit.Types.Point(v.X, v.Y , v.Z ); }
public static List<Grevit.Types.Component> ToGrevitOutline(this SketchUpNET.Surface surface, SketchUpNET.Transform t = null) { List<Grevit.Types.Component> lines = new List<Types.Component>(); foreach (SketchUpNET.Edge corner in surface.OuterEdges.Edges) { lines.Add(corner.ToGrevitLine(t)); } return lines; }
public static Grevit.Types.Line ToGrevitLine(this SketchUpNET.Edge corner, SketchUpNET.Transform t = null) { return new Grevit.Types.Line() { from = corner.Start.ToGrevitPoint(t), to = corner.End.ToGrevitPoint(t) }; }
public static Grevit.Types.Profile ToGrevitProfile(this SketchUpNET.Surface surface, SketchUpNET.Transform t = null) { Types.Profile profile = new Types.Profile(); profile.profile = new List<Loop>(); Loop outerloop = new Loop(); outerloop.outline = new List<Types.Component>(); foreach (SketchUpNET.Edge corner in surface.OuterEdges.Edges) outerloop.outline.Add(corner.ToGrevitLine(t)); profile.profile.Add(outerloop); foreach (SketchUpNET.Loop skploop in surface.InnerEdges) { Loop innerloop = new Loop(); innerloop.outline = new List<Types.Component>(); foreach (SketchUpNET.Edge corner in skploop.Edges) innerloop.outline.Add(corner.ToGrevitLine(t)); profile.profile.Add(innerloop); } return profile; }