Skip to content

Commit

Permalink
Merge pull request #256 from hrntsm/feature/support-C-section
Browse files Browse the repository at this point in the history
Add support unsupported steel section
  • Loading branch information
hrntsm committed Jun 10, 2023
2 parents 8f1a965 + 2607b4d commit 3f32f02
Show file tree
Hide file tree
Showing 10 changed files with 345 additions and 169 deletions.
24 changes: 12 additions & 12 deletions HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,31 @@ private SectionCurve[] SecSteelBraceToCurves(IReadOnlyList<object> figures, IRea
case 1:
var same = figures[0] as StbSecSteelBrace_S_Same;
center = same.shape;
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionPositionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionPositionType.Brace, localAxis));
break;
case 2:
var notSames = new[] { figures[0] as StbSecSteelBrace_S_NotSame, figures[1] as StbSecSteelBrace_S_NotSame };
start = notSames.First(sec => sec.pos == StbSecSteelBrace_S_NotSamePos.BOTTOM).shape;
end = notSames.First(sec => sec.pos == StbSecSteelBrace_S_NotSamePos.TOP).shape;
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionPositionType.Brace, localAxis));
curveList.Add(sectionPoints[0] == sectionPoints[1]
? SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[2], Utils.SectionType.Brace, localAxis)
: SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[1], Utils.SectionType.Brace, localAxis));
? SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[2], Utils.SectionPositionType.Brace, localAxis)
: SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[1], Utils.SectionPositionType.Brace, localAxis));
curveList.Add(sectionPoints[0] == sectionPoints[1]
? SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[2], Utils.SectionType.Brace, localAxis)
: SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[1], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionType.Brace, localAxis));
? SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[2], Utils.SectionPositionType.Brace, localAxis)
: SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[1], Utils.SectionPositionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionPositionType.Brace, localAxis));
break;
case 3:
var three = new[] { figures[0] as StbSecSteelBrace_S_ThreeTypes, figures[1] as StbSecSteelBrace_S_ThreeTypes, figures[2] as StbSecSteelBrace_S_ThreeTypes };
start = three.First(sec => sec.pos == StbSecSteelBrace_S_ThreeTypesPos.BOTTOM).shape;
center = three.First(sec => sec.pos == StbSecSteelBrace_S_ThreeTypesPos.CENTER).shape;
end = three.First(sec => sec.pos == StbSecSteelBrace_S_ThreeTypesPos.TOP).shape;
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionPositionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionPositionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionPositionType.Brace, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionPositionType.Brace, localAxis));
break;
default:
throw new ArgumentException("Unmatched StbSecSteelBrace_S");
Expand Down
48 changes: 24 additions & 24 deletions HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,35 @@ private SectionCurve[] SecCftColumnToCurves(IReadOnlyList<object> figures, IRead
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));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionPositionType.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));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[0], Utils.SectionPositionType.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));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[1], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[1], Utils.SectionPositionType.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, bottom, sectionPoints[2], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[2], Utils.SectionPositionType.Column, localAxis));
}
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionPositionType.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));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[0], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionPositionType.Column, localAxis));
break;
default:
throw new ArgumentException("Unmatched StbSecSteelColumn_CFT");
Expand Down Expand Up @@ -165,35 +165,35 @@ private SectionCurve[] SecSteelColumnToCurves(IReadOnlyList<object> figures, IRe
case 1:
var same = figures[0] as StbSecSteelColumn_S_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));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionPositionType.Column, localAxis));
break;
case 2:
var notSames = new[] { figures[0] as StbSecSteelColumn_S_NotSame, figures[1] as StbSecSteelColumn_S_NotSame };
bottom = notSames.First(item => item.pos == StbSecSteelColumn_S_NotSamePos.BOTTOM).shape;
top = notSames.First(item => item.pos == StbSecSteelColumn_S_NotSamePos.TOP).shape;
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[0], Utils.SectionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[0], Utils.SectionPositionType.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));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[1], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[1], Utils.SectionPositionType.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, bottom, sectionPoints[2], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[2], Utils.SectionPositionType.Column, localAxis));
}
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionPositionType.Column, localAxis));
break;
case 3:
var three = new[] { figures[0] as StbSecSteelColumn_S_ThreeTypes, figures[1] as StbSecSteelColumn_S_ThreeTypes, figures[2] as StbSecSteelColumn_S_ThreeTypes };
bottom = three.First(item => item.pos == StbSecSteelColumn_S_ThreeTypesPos.BOTTOM).shape;
center = three.First(item => item.pos == StbSecSteelColumn_S_ThreeTypesPos.CENTER).shape;
top = three.First(item => item.pos == StbSecSteelColumn_S_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));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, bottom, sectionPoints[0], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionPositionType.Column, localAxis));
curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, top, sectionPoints[3], Utils.SectionPositionType.Column, localAxis));
break;
default:
throw new ArgumentException("Unmatched StbSecSteelColumn_S");
Expand Down
Loading

0 comments on commit 3f32f02

Please sign in to comment.