From 0331593c2615b0f610d7f93554620f0cac5b113f Mon Sep 17 00:00:00 2001 From: hrntsm Date: Thu, 18 May 2023 22:17:07 +0900 Subject: [PATCH 1/2] Add Brep display in the outer S section of the CFT --- .../Utils/Geometry/BrepMaker/Column.cs | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs index 939da3ab..bc6ca10b 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs @@ -58,6 +58,9 @@ private SectionCurve[] CreateCurveList(string idSection, StbColumnKind_structure curveList = SecRcColumnToCurves(srcSec.StbSecFigureColumn_SRC.Item, sectionPoints); break; case StbColumnKind_structure.CFT: + StbSecColumn_CFT cftSec = _sections.StbSecColumn_CFT.First(sec => sec.id == idSection); + curveList = SecCftColumnToCurves(cftSec.StbSecSteelFigureColumn_CFT.Items, sectionPoints); + break; case StbColumnKind_structure.UNDEFINED: throw new ArgumentException("Unsupported StbColumnKind"); default: @@ -67,6 +70,54 @@ private SectionCurve[] CreateCurveList(string idSection, StbColumnKind_structure return curveList; } + private SectionCurve[] SecCftColumnToCurves(IReadOnlyList figures, IReadOnlyList sectionPoints) + { + var curveList = new List(); + Vector3d[] localAxis = Utils.CreateLocalAxis(sectionPoints); + + string bottom, center, top; + switch (figures.Count) + { + case 1: + var same = figures[0] as StbSecSteelColumn_CFT_Same; + center = same.shape; + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionType.Column, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionType.Column, localAxis)); + break; + case 2: + var notSames = new[] { figures[0] as StbSecSteelColumn_CFT_NotSame, figures[1] as StbSecSteelColumn_CFT_NotSame }; + bottom = notSames.First(item => item.pos == StbSecSteelColumn_CFT_NotSamePos.BOTTOM).shape; + top = notSames.First(item => item.pos == StbSecSteelColumn_CFT_NotSamePos.TOP).shape; + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[0], Utils.SectionType.Column, localAxis)); + if (sectionPoints[1].Z > sectionPoints[0].Z) + { + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[1], Utils.SectionType.Column, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[1], Utils.SectionType.Column, localAxis)); + } + else + { + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[2], Utils.SectionType.Column, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[2], Utils.SectionType.Column, localAxis)); + } + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionType.Column, localAxis)); + break; + case 3: + var three = new[] { figures[0] as StbSecSteelColumn_CFT_ThreeTypes, figures[1] as StbSecSteelColumn_CFT_ThreeTypes, figures[2] as StbSecSteelColumn_CFT_ThreeTypes }; + bottom = three.First(item => item.pos == StbSecSteelColumn_CFT_ThreeTypesPos.BOTTOM).shape; + center = three.First(item => item.pos == StbSecSteelColumn_CFT_ThreeTypesPos.CENTER).shape; + top = three.First(item => item.pos == StbSecSteelColumn_CFT_ThreeTypesPos.TOP).shape; + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[0], Utils.SectionType.Column, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Column, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Column, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionType.Column, localAxis)); + break; + default: + throw new ArgumentException("Unmatched StbSecSteelColumn_CFT"); + } + + return curveList.ToArray(); + } + private static SectionCurve[] SecRcColumnToCurves(object figure, IReadOnlyList sectionPoints) { var curveList = new List(); From 3cea44e5949dea4a529f1f02d01cd127a712393e Mon Sep 17 00:00:00 2001 From: hrntsm Date: Thu, 18 May 2023 22:42:25 +0900 Subject: [PATCH 2/2] Update CFT sec to support infill concrete to brep --- HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs | 5 ++++- HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs | 3 +-- HoaryFox/RH7/Component/Utils/Geometry/SectionCurve.cs | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs index bc6ca10b..e99af064 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs @@ -114,7 +114,10 @@ private SectionCurve[] SecCftColumnToCurves(IReadOnlyList figures, IRead default: throw new ArgumentException("Unmatched StbSecSteelColumn_CFT"); } - + foreach (var curve in curveList) + { + curve.IsCft = true; + } return curveList.ToArray(); } diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs index a2587faa..02e065e1 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs @@ -57,14 +57,13 @@ public static void RotateCurveList(Vector3d rotateAxis, IReadOnlyList c.OuterCurve), Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0] .CapPlanarHoles(tolerance); if (brep == null) { return null; } - if (sectionCurve[0].InnerCurve != null) + if (sectionCurve[0].InnerCurve != null && !sectionCurve[0].IsCft) { Brep innerBrep = Brep.CreateFromLoft(sectionCurve.Select(c => c.InnerCurve), Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0] .CapPlanarHoles(tolerance); diff --git a/HoaryFox/RH7/Component/Utils/Geometry/SectionCurve.cs b/HoaryFox/RH7/Component/Utils/Geometry/SectionCurve.cs index bcd47877..a201440d 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/SectionCurve.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/SectionCurve.cs @@ -9,14 +9,12 @@ public class SectionCurve public SectionShape Shape { get; set; } public SectionType Type { get; set; } public Vector3d XAxis { get; set; } + public bool IsCft { get; set; } public void RotateSection(double inPlaneAngle, Vector3d rotateAxis, Point3d sectionPoint) { OuterCurve.Rotate(inPlaneAngle, rotateAxis, sectionPoint); - if (InnerCurve != null) - { - InnerCurve.Rotate(inPlaneAngle, rotateAxis, sectionPoint); - } + InnerCurve?.Rotate(inPlaneAngle, rotateAxis, sectionPoint); } public static SectionCurve CreateSolidColumnRect(Point3d sectionPoint, double widthX, double widthY, Vector3d[] localAxis)