private static void appendPointDefinition(StringBuilder sb, SectionPoint pt) { if (pt != null) { sb.AppendLine("VERT " + pt.Id + " " + pt.Y + " " + pt.Z); } }
public static Section CreateSection(Brep brp, Plane pln) { var sec = new Section(); string id = "P101"; var tx = Transform.ChangeBasis(Plane.WorldYZ, Util.SofiSectionBasePlane) * Transform.ChangeBasis(Plane.WorldXY, pln); int pointIndex = 0; foreach (var lp in brp.Loops) { var crv = lp.To3dCurve(); crv.Transform(tx); var polyLine = Util.CreatePolyLine(crv); if (polyLine != null) { var secLp = new SectionLoop(); secLp.Type = lp.LoopType == BrepLoopType.Outer ? SectionLoopType.Outer : SectionLoopType.Inner; foreach (var pt in polyLine) { var secPt = new SectionPoint() { Id = id, R = 0, Y = pt.Y, Z = pt.Z, }; id = Util.CountStringUp(id); secLp.Add(pointIndex++); sec.Points.Add(secPt); } sec.Loops.Add(secLp); } } return(sec); }