private List <Curve> CreateFromEachColumnKind(string idSection, StbColumnKind_structure kind, IReadOnlyList <Point3d> sectionPoints) { List <Curve> curveList; switch (kind) { case StbColumnKind_structure.RC: StbSecColumn_RC rcSec = _sections.StbSecColumn_RC.First(sec => sec.id == idSection); curveList = SecRcColumnToCurves(rcSec.StbSecFigureColumn_RC.Item, sectionPoints); break; case StbColumnKind_structure.S: StbSecColumn_S sSec = _sections.StbSecColumn_S.First(sec => sec.id == idSection); curveList = SecSteelColumnToCurves(sSec.StbSecSteelFigureColumn_S.Items, sectionPoints); break; case StbColumnKind_structure.SRC: StbSecColumn_SRC srcSec = _sections.StbSecColumn_SRC.First(sec => sec.id == idSection); curveList = SecRcColumnToCurves(srcSec.StbSecFigureColumn_SRC.Item, sectionPoints); break; case StbColumnKind_structure.CFT: case StbColumnKind_structure.UNDEFINED: throw new ArgumentException("Unsupported StbColumnKind"); default: throw new ArgumentOutOfRangeException(); } return(curveList); }
public Brep CreateColumnBrep(string idSection, double rotate, StbColumnKind_structure kind, IReadOnlyList <Point3d> sectionPoints, Vector3d memberAxis) { List <Curve> curveList = CreateFromEachColumnKind(idSection, kind, sectionPoints); Utils.RotateCurveList(memberAxis, curveList, rotate, sectionPoints); return(Utils.CreateCapedBrepFromLoft(curveList, _tolerance[0])); }
internal static StbColumn CreateColumn(ModelBeam elem, int croSecId, StbColumnKind_structure kind) { return(new StbColumn { id = (elem.ind + 1).ToString(), name = elem.id, id_node_bottom = (elem.node_inds[0] + 1).ToString(), id_node_top = (elem.node_inds[1] + 1).ToString(), rotate = 0d, id_section = (croSecId + 1).ToString(), kind_structure = kind }); }
private static GH_Structure <GH_String> GetTagStrings(IEnumerable <StbPost> columns, StbSections sections) { var ghSecStrings = new GH_Structure <GH_String>(); foreach (var item in columns.Select((column, index) => new { column, index })) { string secId = item.column.id_section; var ghPath = new GH_Path(0, item.index); StbColumnKind_structure kindStruct = item.column.kind_structure; switch (kindStruct) { case StbColumnKind_structure.RC: StbSecColumn_RC secRc = sections.StbSecColumn_RC.First(i => i.id == secId); ghSecStrings.AppendRange(TagUtils.GetColumnRcSection(secRc.StbSecFigureColumn_RC.Item, secRc.strength_concrete), ghPath); break; case StbColumnKind_structure.S: StbSecColumn_S secS = sections.StbSecColumn_S.First(i => i.id == secId); foreach (object figureObj in secS.StbSecSteelFigureColumn_S.Items) { ghSecStrings.AppendRange(TagUtils.GetColumnSSection(figureObj), ghPath); } break; case StbColumnKind_structure.SRC: StbSecColumn_SRC secSrc = sections.StbSecColumn_SRC.First(i => i.id == secId); ghSecStrings.AppendRange(TagUtils.GetColumnRcSection(secSrc.StbSecFigureColumn_SRC.Item, secSrc.strength_concrete), ghPath); foreach (object figureObj in secSrc.StbSecSteelFigureColumn_SRC.Items) { ghSecStrings.AppendRange(TagUtils.GetColumnSSection(figureObj), ghPath); } break; case StbColumnKind_structure.CFT: case StbColumnKind_structure.UNDEFINED: throw new ArgumentException("Unsupported section type."); default: throw new ArgumentOutOfRangeException(); } } return(ghSecStrings); }
public GH_Structure <GH_Brep> Post(IEnumerable <StbPost> posts) { var brepList = new GH_Structure <GH_Brep>(); if (posts == null) { return(brepList); } foreach ((StbPost post, int i) in posts.Select((post, index) => (post, index))) { StbColumnKind_structure kind = post.kind_structure; StbNode[] endNodes = { _nodes.First(node => node.id == post.id_node_bottom), _nodes.First(node => node.id == post.id_node_top) }; Point3d[] offset = { new Point3d(post.offset_bottom_X, post.offset_bottom_Y, post.offset_bottom_Z), new Point3d(post.offset_top_X, post.offset_top_Y, post.offset_top_Z) }; Point3d[] sectionPoints = { new Point3d(endNodes[0].X, endNodes[0].Y, endNodes[0].Z) + offset[0], new Point3d(), new Point3d(), new Point3d(endNodes[1].X, endNodes[1].Y, endNodes[1].Z) + offset[1] }; Vector3d memberAxis = sectionPoints[3] - sectionPoints[0]; sectionPoints[1] = sectionPoints[0] + memberAxis / memberAxis.Length * post.joint_bottom; sectionPoints[2] = sectionPoints[3] - memberAxis / memberAxis.Length * post.joint_top; var brepMaker = new BrepMaker.Column(_sections, _tolerance); brepList.Append(new GH_Brep(brepMaker.CreateColumnBrep(post.id_section, post.rotate, kind, sectionPoints, memberAxis)), new GH_Path(0, i)); } return(brepList); }
private void AddColumnSection(ICollection <StbSecColumn_S> secColumns_S, ICollection <StbSecColumn_RC> secColumns_RC, K2SSecSteelItems secSteel, StbColumnKind_structure kind, int croSecId, int cNum) { switch (kind) { case StbColumnKind_structure.S: secColumns_S.Add(K2StbSections.ColumnSteel(croSecId, cNum, _kModel)); if (_registeredCroSecName[0].IndexOf(_kModel.crosecs[croSecId].name) < 0) { K2StbSecSteel.GetSection(ref secSteel, _kModel, croSecId); _registeredCroSecName[0].Add(_kModel.crosecs[croSecId].name); } break; case StbColumnKind_structure.RC: secColumns_RC.Add(K2StbSections.ColumnRc(croSecId, cNum, _kModel)); break; default: throw new ArgumentException("Make sure that the family name of the material is \"Concrete\" or \"Steel\"."); } _registeredCroSecId[0].Add(croSecId); }