-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from hrntsm/Feature/pile-and-foundation
Feature/pile and foundation
- Loading branch information
Showing
15 changed files
with
873 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Footing.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using Rhino.Geometry; | ||
|
||
using STBDotNet.v202; | ||
|
||
namespace HoaryFox.Component.Utils.Geometry.BrepMaker | ||
{ | ||
public class Footing | ||
{ | ||
private readonly IReadOnlyList<double> _tolerance; | ||
private readonly StbSections _sections; | ||
private readonly string _guid; | ||
|
||
public Footing(StbSections sections, IReadOnlyList<double> tolerance, string guid) | ||
{ | ||
_tolerance = tolerance; | ||
_sections = sections; | ||
_guid = guid; | ||
} | ||
|
||
public Brep CreateFootingBrep(string idSection, double rotate, IReadOnlyList<Point3d> sectionPoints, Vector3d axis) | ||
{ | ||
SectionCurve[] curveList = CreateCurveList(idSection, sectionPoints, axis); | ||
Utils.RotateCurveList(axis, curveList, rotate, sectionPoints); | ||
return Utils.CreateCapedBrepFromLoft(curveList, _tolerance[0]); | ||
} | ||
|
||
private SectionCurve[] CreateCurveList(string idSection, IReadOnlyList<Point3d> sectionPoints, Vector3d axis) | ||
{ | ||
SectionCurve[] curveList; | ||
try | ||
{ | ||
StbSecFoundation_RC rcSec = _sections.StbSecFoundation_RC.First(sec => sec.id == idSection); | ||
curveList = SecRcFootingToCurves(rcSec.StbSecFigureFoundation_RC.Item, sectionPoints, axis); | ||
} | ||
catch (Exception) | ||
{ | ||
throw new ArgumentException($"Error converting guid: {_guid}\nThe cross-sectional shape of the footing seems to be wrong. Please check."); | ||
} | ||
|
||
return curveList; | ||
} | ||
|
||
private static SectionCurve[] SecRcFootingToCurves(object figure, IReadOnlyList<Point3d> sectionPoints, Vector3d axis) | ||
{ | ||
var curveList = new List<SectionCurve>(); | ||
Vector3d[] localAxis = Utils.CreateLocalAxis(sectionPoints); | ||
|
||
switch (figure) | ||
{ | ||
case StbSecFoundation_RC_Rect rect: | ||
var topPt = sectionPoints[3] - axis * rect.depth; | ||
curveList.Add(SectionCurve.CreateSolidColumnRect(topPt, rect.width_X, rect.width_Y, localAxis)); | ||
curveList.Add(SectionCurve.CreateSolidColumnRect(sectionPoints[3], rect.width_X, rect.width_Y, localAxis)); | ||
break; | ||
default: | ||
throw new ArgumentException("Unsupported StbSecFoundation_RC type."); | ||
} | ||
|
||
return curveList.ToArray(); | ||
} | ||
} | ||
} |
Oops, something went wrong.