Skip to content

Commit

Permalink
Merge pull request #195 from hrntsm/fix/deckslap-to-brep-error
Browse files Browse the repository at this point in the history
Fix convert deck & precast slab to brep error
  • Loading branch information
hrntsm authored Sep 28, 2021
2 parents 8fe256b + 8f623e9 commit a60297d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
14 changes: 5 additions & 9 deletions HoaryFox/Component/Utils/Geometry/BrepMaker/Slab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,18 @@ public static double GetDepth(StbSections sections, StbSlab slab)
depth = tapers.First(sec => sec.pos == StbSecSlab_RC_TaperPos.TIP).depth;
break;
case 3:
var haunches = new[]
{
slabRc[0] as StbSecSlab_RC_Haunch, slabRc[1] as StbSecSlab_RC_Haunch,
slabRc[2] as StbSecSlab_RC_Haunch
};
var haunches = new[] { slabRc[0] as StbSecSlab_RC_Haunch, slabRc[1] as StbSecSlab_RC_Haunch, slabRc[2] as StbSecSlab_RC_Haunch };
depth = haunches.First(sec => sec.pos == StbSecSlab_RC_HaunchPos.CENTER).depth;
break;
}

break;
case StbSlabKind_structure.DECK:
// StbSecSlabDeck slabDeck = _sections.StbSecSlabDeck.FirstOrDefault(sec => sec.id == slab.id_section);
// break;
depth = sections.StbSecSlabDeck.FirstOrDefault(sec => sec.id == slab.id_section).StbSecFigureSlabDeck.StbSecSlabDeckStraight.depth;
break;
case StbSlabKind_structure.PRECAST:
// StbSecSlabPrecast slabPrecast = _sections.StbSecSlabPrecast.FirstOrDefault(sec => sec.id == slab.id_section);
// break;
depth = sections.StbSecSlabPrecast.FirstOrDefault(sec => sec.id == slab.id_section).StbSecFigureSlabPrecast.StbSecSlabPrecastStraight.depth_concrete;
break;
default:
throw new ArgumentOutOfRangeException();
}
Expand Down
12 changes: 12 additions & 0 deletions HoaryFox/Component/Utils/TagUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ internal static IEnumerable<GH_String> GetBeamSSection(object steelFigure)
var ghSecStrings = new GH_Structure<GH_String>();
switch (steelFigure)
{
case StbSecSteelBeam_S_Joint figure:
ghSecStrings.Append(new GH_String(figure.pos + ":" + figure.shape + "(" + figure.strength_main + ")"));
break;
case StbSecSteelBeam_S_Haunch figure:
ghSecStrings.Append(new GH_String(figure.pos + ":" + figure.shape + "(" + figure.strength_main + ")"));
break;
Expand All @@ -132,6 +135,9 @@ internal static IEnumerable<GH_String> GetBeamSSection(object steelFigure)
case StbSecSteelBeam_S_Straight figure:
ghSecStrings.Append(new GH_String(figure.shape + "(" + figure.strength_main + ")"));
break;
case StbSecSteelBeam_SRC_Joint figure:
ghSecStrings.Append(new GH_String(figure.pos + ":" + figure.shape + "(" + figure.strength_main + ")"));
break;
case StbSecSteelBeam_SRC_Haunch figure:
ghSecStrings.Append(new GH_String(figure.pos + ":" + figure.shape + "(" + figure.strength_main + ")"));
break;
Expand Down Expand Up @@ -420,7 +426,13 @@ private static void AppendSectionInfos(IDictionary<string, string> pDict, StbSec
}
break;
case "DECK":
StbSecSlabDeck slabDeck = sections.StbSecSlabDeck.First(sec => sec.id == pDict["id_section"]);
var deckFigure = slabDeck.StbSecFigureSlabDeck.StbSecSlabDeckStraight;
sectionInfo.AddRange(GetSlabDeckSection(deckFigure, slabDeck.strength_concrete).ToList());
break;
case "PRECAST":
StbSecSlabPrecast slabPrecast = sections.StbSecSlabPrecast.First(sec => sec.id == pDict["id_section"]);
sectionInfo.AddRange(GetSlabPrecastSection(slabPrecast.precast_type, slabPrecast.StbSecProductSlabPrecast, slabPrecast.strength_concrete).ToList());
break;
}
break;
Expand Down

0 comments on commit a60297d

Please sign in to comment.