private static Curve CurveFromStbSecBox(Vector3d[] localAxis, Point3d point, Utils.SectionType type, double A, double B) { switch (type) { case Utils.SectionType.Column: case Utils.SectionType.Brace: return(new PolylineCurve( SectionCornerPoints.ColumnRect(point, B, A, localAxis[1], localAxis[2]))); case Utils.SectionType.Beam: return(new PolylineCurve( SectionCornerPoints.BeamRect(point, B, A, localAxis[1], localAxis[2]))); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
private static List <Curve> SecSrcBeamCurves(IReadOnlyList <object> figures, IReadOnlyList <Point3d> sectionPoints) { var curveList = new List <Curve>(); Vector3d[] localAxis = Utils.CreateLocalAxis(sectionPoints); switch (figures.Count) { case 1: var straight = figures[0] as StbSecBeam_SRC_Straight; curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[0], straight.depth, straight.width, localAxis[1], localAxis[2]))); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[3], straight.depth, straight.width, localAxis[1], localAxis[2]))); break; case 2: var taper = new[] { figures[0] as StbSecBeam_SRC_Taper, figures[1] as StbSecBeam_SRC_Taper }; curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[0], taper[0].depth, taper[0].width, localAxis[1], localAxis[2]))); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[1], taper[0].depth, taper[0].width, localAxis[1], localAxis[2]))); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[2], taper[1].depth, taper[1].width, localAxis[1], localAxis[2]))); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[3], taper[1].depth, taper[1].width, localAxis[1], localAxis[2]))); break; case 3: var haunch = new[] { figures[0] as StbSecBeam_SRC_Haunch, figures[1] as StbSecBeam_SRC_Haunch, figures[2] as StbSecBeam_SRC_Haunch }; StbSecBeam_SRC_Haunch start = haunch.First(fig => fig.pos == StbSecBeam_RC_HaunchPos.START); StbSecBeam_SRC_Haunch center = haunch.First(fig => fig.pos == StbSecBeam_RC_HaunchPos.CENTER); StbSecBeam_SRC_Haunch end = haunch.First(fig => fig.pos == StbSecBeam_RC_HaunchPos.END); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[0], start.depth, start.width, localAxis[1], localAxis[2]))); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[1], center.depth, center.width, localAxis[1], localAxis[2]))); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[2], center.depth, center.width, localAxis[1], localAxis[2]))); curveList.Add(new PolylineCurve(SectionCornerPoints.BeamRect(sectionPoints[3], end.depth, end.width, localAxis[1], localAxis[2]))); break; default: throw new Exception(); } return(curveList); }