public SectionLoop Duplicate() { var res = new SectionLoop(); res.Type = Type; foreach (var i in this) { res.Add(i); } return(res); }
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); }