diff --git a/.vscode/launch.json b/.vscode/launch.json index bf07d24f..60958a3c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,21 +5,26 @@ "version": "0.2.0", "configurations": [ { - "name": ".NET Core Launch (console)", + "name": "Run Rhino8 WIP", "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "C:/Program Files/Rhino 6/System/Rhino.exe", - "args": [], + "program": "C:/Program Files/Rhino 8 WIP/System/Rhino.exe", + "args": ["/nosplash"], "cwd": "${workspaceFolder}", "console": "internalConsole", "stopAtEntry": true }, { - "name": ".NET Core Attach", + "name": "Run Rhino7", "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } + "request": "launch", + "preLaunchTask": "build", + "program": "C:/Program Files/Rhino 7/System/Rhino.exe", + "args": ["/nosplash"], + "cwd": "${workspaceFolder}", + "console": "internalConsole", + "stopAtEntry": true + }, ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d96f354e..0e4358c6 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,36 +7,11 @@ "type": "process", "args": [ "build", - "${workspaceFolder}/HoaryFox/HoaryFox.csproj", + "${workspaceFolder}/HoaryFox/RH7/HoaryFoxRH7.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile" }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/HoaryFox/HoaryFox.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "${workspaceFolder}/HoaryFox/HoaryFox.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - } ] } \ No newline at end of file diff --git a/HoaryFox/RH6/HoaryFoxRH6.csproj b/HoaryFox/RH6/HoaryFoxRH6.csproj index 84f3248d..6e693941 100644 --- a/HoaryFox/RH6/HoaryFoxRH6.csproj +++ b/HoaryFox/RH6/HoaryFoxRH6.csproj @@ -1,7 +1,7 @@  net48 - 2.3.0 + 2.4.0 HoaryFox This Component read ST-Bridge file(.stb) and display its model data. .gha diff --git a/HoaryFox/RH6/HoaryFoxRH6Info.cs b/HoaryFox/RH6/HoaryFoxRH6Info.cs index dfa9722a..c4134074 100644 --- a/HoaryFox/RH6/HoaryFoxRH6Info.cs +++ b/HoaryFox/RH6/HoaryFoxRH6Info.cs @@ -8,15 +8,19 @@ namespace HoaryFox public class HoaryFoxRH6Info : GH_AssemblyInfo { public override string Name => "HoaryFox"; - public override Bitmap Icon => HoaryFoxCommon.Properties.Resource.InfoIcon; - public override string Description => "This Component read ST-Bridge file(.stb) and display its model data."; - public override Guid Id => new Guid("093de648-746b-4b0b-85ef-495c6fb4514f"); - public override string AuthorName => "hrntsm"; - public override string AuthorContact => "contact@hrntsm.com"; } + + public class HoaryFoxCategoryIcon : GH_AssemblyPriority + { + public override GH_LoadingInstruction PriorityLoad() + { + Grasshopper.Instances.ComponentServer.AddCategoryIcon("HoaryFox", HoaryFoxCommon.Properties.Resource.InfoIcon); + return GH_LoadingInstruction.Proceed; + } + } } diff --git a/HoaryFox/RH7/Component/Geometry/Stb2Brep.cs b/HoaryFox/RH7/Component/Geometry/Stb2Brep.cs index d70e875c..06fe8af9 100644 --- a/HoaryFox/RH7/Component/Geometry/Stb2Brep.cs +++ b/HoaryFox/RH7/Component/Geometry/Stb2Brep.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.IO; using System.Linq; using Grasshopper.Kernel; @@ -22,7 +23,7 @@ namespace HoaryFox.Component.Geometry public class Stb2Brep : GH_Component { private ST_BRIDGE _stBridge; - private readonly GH_Structure[] _brepList = new GH_Structure[7]; + private readonly GH_Structure[] _brepList = new GH_Structure[9]; public override GH_Exposure Exposure => GH_Exposure.primary; @@ -41,6 +42,7 @@ protected override void RegisterInputParams(GH_InputParamManager pManager) protected override void RegisterOutputParams(GH_OutputParamManager pManager) { + pManager.AddTextParameter("Log", "Log", "Log", GH_ParamAccess.item); pManager.AddBrepParameter("Columns", "Col", "output StbColumns to Brep", GH_ParamAccess.tree); pManager.AddBrepParameter("Girders", "Gird", "output StbGirders to Brep", GH_ParamAccess.tree); pManager.AddBrepParameter("Posts", "Pst", "output StbPosts to Brep", GH_ParamAccess.tree); @@ -48,6 +50,8 @@ protected override void RegisterOutputParams(GH_OutputParamManager pManager) pManager.AddBrepParameter("Braces", "Brc", "output StbBraces to Brep", GH_ParamAccess.tree); pManager.AddBrepParameter("Slabs", "Slb", "output StbSlabs to Brep", GH_ParamAccess.tree); pManager.AddBrepParameter("Walls", "Wl", "output StbWalls to Brep", GH_ParamAccess.tree); + pManager.AddBrepParameter("Piles", "Pil", "output StbPiles to Brep", GH_ParamAccess.tree); + pManager.AddBrepParameter("Footings", "Ftg", "output StbFootings to Brep", GH_ParamAccess.tree); } protected override void SolveInstance(IGH_DataAccess dataAccess) @@ -56,25 +60,27 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) if (!dataAccess.GetData("Data", ref _stBridge)) { return; } if (!dataAccess.GetData("Bake", ref isBake)) { return; } - CreateBrep(); + var log = CreateBrep(); if (isBake) { BakeBrep(); } - for (var i = 0; i < 7; i++) + dataAccess.SetData(0, log); + for (var i = 1; i < 10; i++) { - dataAccess.SetDataTree(i, _brepList[i]); + dataAccess.SetDataTree(i, _brepList[i - 1]); } } protected override Bitmap Icon => Resource.Brep; public override Guid ComponentGuid => new Guid("B2D5EA7F-E75F-406B-8D22-C267B43C5E72"); - private void CreateBrep() + private string CreateBrep() { + var path = Path.GetDirectoryName(Grasshopper.Instances.ComponentServer.FindAssemblyByObject(this).Location); StbMembers member = _stBridge.StbModel.StbMembers; - var brepFromStb = new CreateMemberBrepListFromStb(_stBridge.StbModel.StbSections, _stBridge.StbModel.StbNodes, new[] { DocumentTolerance(), DocumentAngleTolerance() }); + var brepFromStb = new CreateMemberBrepListFromStb(_stBridge.StbModel.StbSections, _stBridge.StbModel.StbNodes, new[] { DocumentTolerance(), DocumentAngleTolerance() }, path); _brepList[0] = brepFromStb.Column(member.StbColumns); _brepList[1] = brepFromStb.Girder(member.StbGirders); _brepList[2] = brepFromStb.Post(member.StbPosts); @@ -82,13 +88,17 @@ private void CreateBrep() _brepList[4] = brepFromStb.Brace(member.StbBraces); _brepList[5] = brepFromStb.Slab(member.StbSlabs); _brepList[6] = brepFromStb.Wall(member.StbWalls, member.StbOpens); + _brepList[7] = brepFromStb.Pile(member.StbPiles); + _brepList[8] = brepFromStb.Footing(member.StbFootings); + brepFromStb.SerializeLog(); + return brepFromStb.Logger.ToString(); } private void BakeBrep() { RhinoDoc activeDoc = RhinoDoc.ActiveDoc; - var parentLayerNames = new[] { "Column", "Girder", "Post", "Beam", "Brace", "Slab", "Wall" }; - Color[] layerColors = { Color.Red, Color.Green, Color.Aquamarine, Color.LightCoral, Color.MediumPurple, Color.DarkGray, Color.CornflowerBlue }; + var parentLayerNames = new[] { "Column", "Girder", "Post", "Beam", "Brace", "Slab", "Wall", "Pile", "Footing" }; + Color[] layerColors = new[] { Color.Red, Color.Green, Color.Aquamarine, Color.LightCoral, Color.MediumPurple, Color.DarkGray, Color.CornflowerBlue, Color.DarkOrange, Color.DarkKhaki }; GeometryBaker.MakeParentLayers(activeDoc, parentLayerNames, layerColors); Dictionary[][] infoArray = Utils.TagUtils.GetAllSectionInfoArray(_stBridge.StbModel.StbMembers, _stBridge.StbModel.StbSections); diff --git a/HoaryFox/RH7/Component/Geometry/Stb2Line.cs b/HoaryFox/RH7/Component/Geometry/Stb2Line.cs index 51a8784b..d0815efa 100644 --- a/HoaryFox/RH7/Component/Geometry/Stb2Line.cs +++ b/HoaryFox/RH7/Component/Geometry/Stb2Line.cs @@ -23,7 +23,7 @@ public class Stb2Line : GH_Component { private ST_BRIDGE _stBridge; private List _nodes = new List(); - private readonly GH_Structure[] _lineList = new GH_Structure[5]; + private readonly GH_Structure[] _lineList = new GH_Structure[8]; public override GH_Exposure Exposure => GH_Exposure.primary; @@ -37,6 +37,7 @@ public Stb2Line() protected override void RegisterInputParams(GH_InputParamManager pManager) { pManager.AddGenericParameter("Data", "D", "input ST-Bridge Data", GH_ParamAccess.item); + pManager.AddBooleanParameter("OffsetNode", "OfNd", "If it true, offset geometry.", GH_ParamAccess.item, false); pManager.AddBooleanParameter("Bake", "Bake", "If it true, bake geometry.", GH_ParamAccess.item, false); } @@ -48,15 +49,18 @@ protected override void RegisterOutputParams(GH_OutputParamManager pManager) pManager.AddLineParameter("Posts", "Pst", "output StbPosts to Line", GH_ParamAccess.tree); pManager.AddLineParameter("Beams", "Beam", "output StbBeams to Line", GH_ParamAccess.tree); pManager.AddLineParameter("Braces", "Brc", "output StbBraces to Line", GH_ParamAccess.tree); + pManager.AddLineParameter("Piles", "Pil", "output StbPiles to Line", GH_ParamAccess.tree); } protected override void SolveInstance(IGH_DataAccess dataAccess) { var isBake = false; + var isOffset = false; if (!dataAccess.GetData("Data", ref _stBridge)) { return; } + if (!dataAccess.GetData("OffsetNode", ref isOffset)) { return; } if (!dataAccess.GetData("Bake", ref isBake)) { return; } - CreateLine(); + CreateLine(isOffset); if (isBake) { BakeLine(); @@ -65,21 +69,36 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) dataAccess.SetDataList(0, _nodes); foreach ((GH_Structure geometry, int i) in _lineList.Select((geo, index) => (geo, index + 1))) { - dataAccess.SetDataTree(i, geometry); + if (i == 8) + { + dataAccess.SetDataTree(6, geometry); + } + else if (i == 6 || i == 7) + { + continue; + } + else + { + dataAccess.SetDataTree(i, geometry); + } } } private void BakeLine() { RhinoDoc activeDoc = RhinoDoc.ActiveDoc; - var parentLayerNames = new[] { "Column", "Girder", "Post", "Beam", "Brace", "Slab", "Wall" }; - Color[] layerColors = { Color.Red, Color.Green, Color.Aquamarine, Color.LightCoral, Color.MediumPurple, Color.DarkGray, Color.CornflowerBlue }; + var parentLayerNames = new[] { "Column", "Girder", "Post", "Beam", "Brace", "Slab", "Wall", "Pile" }; + Color[] layerColors = { Color.Red, Color.Green, Color.Aquamarine, Color.LightCoral, Color.MediumPurple, Color.DarkGray, Color.CornflowerBlue, Color.DarkOrange }; GeometryBaker.MakeParentLayers(activeDoc, parentLayerNames, layerColors); Dictionary[][] infoArray = Utils.TagUtils.GetAllSectionInfoArray(_stBridge.StbModel.StbMembers, _stBridge.StbModel.StbSections); foreach ((GH_Structure lines, int i) in _lineList.Select((frameBrep, index) => (frameBrep, index))) { + if (lines == null) + { + continue; + } Layer parentLayer = activeDoc.Layers.FindName(parentLayerNames[i]); int parentIndex = parentLayer.Index; Guid parentId = parentLayer.Id; @@ -87,44 +106,38 @@ private void BakeLine() { var objAttr = new ObjectAttributes(); - if (i < 5) + Dictionary[] infos = infoArray[i]; + Dictionary info = infos[bIndex]; + + foreach (KeyValuePair pair in info) { - Dictionary[] infos = infoArray[i]; - Dictionary info = infos[bIndex]; - - foreach (KeyValuePair pair in info) - { - objAttr.SetUserString(pair.Key, pair.Value); - } - - var layer = new Layer { Name = info["name"], ParentLayerId = parentId, Color = layerColors[i] }; - int layerIndex = activeDoc.Layers.Add(layer); - if (layerIndex == -1) - { - layer = activeDoc.Layers.FindName(info["name"]); - layerIndex = layer.Index; - } - objAttr.LayerIndex = layerIndex; + objAttr.SetUserString(pair.Key, pair.Value); } - else + + var layer = new Layer { Name = info["name"], ParentLayerId = parentId, Color = layerColors[i] }; + int layerIndex = activeDoc.Layers.Add(layer); + if (layerIndex == -1) { - objAttr.LayerIndex = parentIndex; + layer = activeDoc.Layers.FindName(info["name"]); + layerIndex = layer.Index; } + objAttr.LayerIndex = layerIndex; activeDoc.Objects.AddLine(line, objAttr); } } } - private void CreateLine() + private void CreateLine(bool isOffset) { - var createLines = new CreateLineFromStb(_stBridge); + var createLines = new CreateLineFromStb(_stBridge, isOffset); _nodes = createLines.Nodes(); _lineList[0] = createLines.Columns(); _lineList[1] = createLines.Girders(); _lineList[2] = createLines.Posts(); _lineList[3] = createLines.Beams(); _lineList[4] = createLines.Braces(); + _lineList[7] = createLines.Piles(); } protected override Bitmap Icon => Resource.Line; diff --git a/HoaryFox/RH7/Component/Utils/ConvertLogger.cs b/HoaryFox/RH7/Component/Utils/ConvertLogger.cs new file mode 100644 index 00000000..31c034e0 --- /dev/null +++ b/HoaryFox/RH7/Component/Utils/ConvertLogger.cs @@ -0,0 +1,105 @@ +using System; +using System.IO; +using System.Text; + +namespace HoaryFox.Component.Utils +{ + public class ConvertLogger + { + private readonly StringBuilder _logger = new StringBuilder(); + private readonly string _path; + + public ConvertLogger(string path, string version) + { + _path = path; + _logger.AppendLine(@"--------------------------------------"); + _logger.AppendLine(@" ____ ____ ________"); + _logger.AppendLine(@"|_ || _| |_ __ |"); + _logger.AppendLine(@" | |__| | .--. ,--. _ .--. _ __ | |_ \_| .--. _ __"); + _logger.AppendLine(@" | __ | / .'`\ \ `'_\ : [ `/'`\] [ \ [ ] | _| / .'`\ \ [ \ [ ]"); + _logger.AppendLine(@" _| | | |_ | \__. | // | |, | | \ '/ / _| |_ | \__. | > ' <"); + _logger.AppendLine(@"|____||____| '.__.' \'-;__/ [___] [\_: / |_____| '.__.' [__]`\_]"); + _logger.AppendLine(@" \__.'"); + _logger.AppendLine($" version:{version}"); + _logger.AppendLine(@" ST-Bridge to Brep Convert Log"); + _logger.AppendLine(@"--------------------------------------"); + _logger.AppendLine($"::INFO :: 変換開始 | {DateTime.Now}"); + } + + public void Clear() + { + _logger.Clear(); + } + + public void AppendInfoMessage(string message) + { + _logger.AppendLine($"::INFO :: {message}"); + } + + public void AppendInfoConvertStartMessage(string message) + { + _logger.AppendLine("--------------------------------------"); + _logger.AppendLine($"::INFO :: {message}の変換を開始しました。 | {DateTime.Now}"); + } + + public void AppendInfoConvertEndMessage(string message) + { + _logger.AppendLine($"::INFO :: {message}の変換を終了しました。 | {DateTime.Now}"); + _logger.AppendLine("--------------------------------------"); + } + + public void AppendInfoDataNotFoundMessage(string message) + { + _logger.AppendLine($"::INFO :: {message}のデータはありませんでした。 | {DateTime.Now}"); + _logger.AppendLine("--------------------------------------"); + } + + public void AppendInfo(string guid, string message) + { + _logger.AppendLine($"::INFO :: [{guid}] | {message}"); + } + + public void AppendConvertSuccess(string guid, string tag) + { + _logger.AppendLine($"::INFO :: [{guid}] | {tag} | 変換完了"); + } + + public void AppendWarning(string guid, string message) + { + _logger.AppendLine($"::WARNING:: [{guid}] | {message}"); + } + + public void AppendConvertWarning(string guid, string tag, string message) + { + _logger.AppendLine($"::WARNING:: [{guid}] | {tag} | 変換結果 要確認 | {message}"); + } + + public void AppendError(string guid, string message) + { + _logger.AppendLine($"::ERROR :: [{guid}] | {message}"); + } + + public void AppendConvertFailed(string guid, string tag, string message) + { + _logger.AppendLine($"::ERROR :: [{guid}] | {tag} | 変換失敗 | {message}"); + } + + public void AppendSummary(int[] resultCount) + { + _logger.AppendLine($"::INFO :: [SUMMARY] | {resultCount[0]} 件の変換に成功しました。"); + _logger.AppendLine($"::INFO :: [SUMMARY] | {resultCount[1]} 件が変換出来ましたが、結果の確認が必要です。"); + _logger.AppendLine($"::INFO :: [SUMMARY] | {resultCount[2]} 件の変換に失敗しました。"); + } + + public void Serialize() + { + AppendInfoConvertEndMessage("ST-BridgeデータのBrepへ"); + File.WriteAllText(_path + "/S2B_convert.log", _logger.ToString()); + } + + public override string ToString() + { + return _logger.ToString(); + } + } +} diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs index 221bd1a2..28e9a838 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs @@ -12,11 +12,13 @@ public class Brace { private readonly IReadOnlyList _tolerance; private readonly StbSections _sections; + private readonly string _guid; - public Brace(StbSections sections, IReadOnlyList tolerance) + public Brace(StbSections sections, IReadOnlyList tolerance, string guid) { _tolerance = tolerance; _sections = sections; + _guid = guid; } public Brep CreateBraceBrep(string idSection, double rotate, StbBraceKind_structure kind, IReadOnlyList sectionPoints, Vector3d memberAxis) @@ -45,7 +47,7 @@ private SectionCurve[] CreateFromEachBraceKind(string idSection, StbBraceKind_st } catch (Exception) { - throw new ArgumentException("The cross-sectional shape of the brace seems to be wrong. Please check."); + throw new ArgumentException($"Error converting guid: {_guid}\nThe cross-sectional shape of the brace seems to be wrong. Please check."); } } @@ -60,31 +62,31 @@ private SectionCurve[] SecSteelBraceToCurves(IReadOnlyList 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"); diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs index 939da3ab..9c4db635 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs @@ -12,10 +12,13 @@ public class Column { private readonly IReadOnlyList _tolerance; private readonly StbSections _sections; - public Column(StbSections sections, IReadOnlyList tolerance) + private readonly string _guid; + + public Column(StbSections sections, IReadOnlyList tolerance, string guid) { _tolerance = tolerance; _sections = sections; + _guid = guid; } public Brep CreateColumnBrep(string idSection, double rotate, StbColumnKind_structure kind, IReadOnlyList sectionPoints, Vector3d memberAxis) @@ -34,7 +37,7 @@ private SectionCurve[] CreateFromEachColumnKind(string idSection, StbColumnKind_ } catch (Exception) { - throw new ArgumentException("The cross-sectional shape of the column or post seems to be wrong. Please check."); + throw new ArgumentException($"Error converting guid: {_guid}\nThe cross-sectional shape of the column or post seems to be wrong. Please check."); } return curveList; @@ -58,6 +61,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 +73,57 @@ 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.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.SectionPositionType.Column, localAxis)); + if (sectionPoints[1].Z > sectionPoints[0].Z) + { + 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.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.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.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"); + } + foreach (var curve in curveList) + { + curve.IsCft = true; + } + return curveList.ToArray(); + } + private static SectionCurve[] SecRcColumnToCurves(object figure, IReadOnlyList sectionPoints) { var curveList = new List(); @@ -108,35 +165,35 @@ private SectionCurve[] SecSteelColumnToCurves(IReadOnlyList 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"); diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Footing.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Footing.cs new file mode 100644 index 00000000..c36929be --- /dev/null +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Footing.cs @@ -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 _tolerance; + private readonly StbSections _sections; + private readonly string _guid; + + public Footing(StbSections sections, IReadOnlyList tolerance, string guid) + { + _tolerance = tolerance; + _sections = sections; + _guid = guid; + } + + public Brep CreateFootingBrep(string idSection, double rotate, IReadOnlyList 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 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 sectionPoints, Vector3d axis) + { + var curveList = new List(); + 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(); + } + } +} diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Girder.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Girder.cs index 309cba44..82620f9e 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Girder.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Girder.cs @@ -12,11 +12,15 @@ public class Girder { private readonly IReadOnlyList _tolerance; private readonly StbSections _sections; - public Girder(StbSections sections, IReadOnlyList tolerance) + private readonly string _guid; + + public Girder(StbSections sections, IReadOnlyList tolerance, string guid) { _tolerance = tolerance; _sections = sections; + _guid = guid; } + public Brep CreateGirderBrep(string idSection, double rotate, StbGirderKind_structure kind, IReadOnlyList sectionPoints, Vector3d memberAxis) { SectionCurve[] curveList = CreateFromEachGirderKind(idSection, kind, sectionPoints); @@ -33,7 +37,7 @@ private SectionCurve[] CreateFromEachGirderKind(string idSection, StbGirderKind_ } catch (Exception) { - throw new ArgumentException("The cross-sectional shape of the girder or beam seems to be wrong. Please check."); + throw new ArgumentException($"Error converting guid: {_guid}\nThe cross-sectional shape of the girder or beam seems to be wrong. Please check."); } return curveList; @@ -77,14 +81,14 @@ private static SectionCurve[] SecRcBeamCurves(IReadOnlyList figures, IRe case 1: var straight = figures[0] as StbSecBeam_RC_Straight; curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[0], straight.depth, straight.width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[3], straight.depth, straight.width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[5], straight.depth, straight.width, localAxis)); break; case 2: var taper = new[] { figures[0] as StbSecBeam_RC_Taper, figures[1] as StbSecBeam_RC_Taper }; curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[0], taper[0].depth, taper[0].width, localAxis)); curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[1], taper[0].depth, taper[0].width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[2], taper[1].depth, taper[1].width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[3], taper[1].depth, taper[1].width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[4], taper[1].depth, taper[1].width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[5], taper[1].depth, taper[1].width, localAxis)); break; case 3: var haunch = new[] { figures[0] as StbSecBeam_RC_Haunch, figures[1] as StbSecBeam_RC_Haunch, figures[2] as StbSecBeam_RC_Haunch }; @@ -93,8 +97,8 @@ private static SectionCurve[] SecRcBeamCurves(IReadOnlyList figures, IRe StbSecBeam_RC_Haunch end = haunch.First(fig => fig.pos == StbSecBeam_RC_HaunchPos.END); curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[0], start.depth, start.width, localAxis)); curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[1], center.depth, center.width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[2], center.depth, center.width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[3], end.depth, end.width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[4], center.depth, center.width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[5], end.depth, end.width, localAxis)); break; default: throw new Exception(); @@ -113,14 +117,14 @@ private static SectionCurve[] SecSrcBeamCurves(IReadOnlyList figures, IR case 1: var straight = figures[0] as StbSecBeam_SRC_Straight; curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[0], straight.depth, straight.width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[3], straight.depth, straight.width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[5], straight.depth, straight.width, localAxis)); break; case 2: var taper = new[] { figures[0] as StbSecBeam_SRC_Taper, figures[1] as StbSecBeam_SRC_Taper }; curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[0], taper[0].depth, taper[0].width, localAxis)); curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[1], taper[0].depth, taper[0].width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[2], taper[1].depth, taper[1].width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[3], taper[1].depth, taper[1].width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[4], taper[1].depth, taper[1].width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[5], taper[1].depth, taper[1].width, localAxis)); break; case 3: var haunch = new[] { figures[0] as StbSecBeam_SRC_Haunch, figures[1] as StbSecBeam_SRC_Haunch, figures[2] as StbSecBeam_SRC_Haunch }; @@ -129,8 +133,8 @@ private static SectionCurve[] SecSrcBeamCurves(IReadOnlyList figures, IR StbSecBeam_SRC_Haunch end = haunch.First(fig => fig.pos == StbSecBeam_RC_HaunchPos.END); curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[0], start.depth, start.width, localAxis)); curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[1], center.depth, center.width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[2], center.depth, center.width, localAxis)); - curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[3], end.depth, end.width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[4], center.depth, center.width, localAxis)); + curveList.Add(SectionCurve.CreateSolidBeamRect(sectionPoints[5], end.depth, end.width, localAxis)); break; default: throw new Exception(); diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs index fd00fb9f..d9b51b64 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs @@ -21,8 +21,8 @@ public void SingleFigure(IReadOnlyList figures, IReadOnlyList s { var straight = figures[0] as StbSecSteelBeam_S_Straight; string center = straight.shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } public void TwoFigure(IReadOnlyList figures, IReadOnlyList sectionPoints, ICollection curveList, Vector3d[] localAxis) @@ -76,10 +76,10 @@ private void TwoFigureTaper(IReadOnlyList figures, IReadOnlyList sec.pos == StbSecSteelBeam_S_TaperPos.START).shape; string end = tapers.First(sec => sec.pos == StbSecSteelBeam_S_TaperPos.END).shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[1], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[2], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[1], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[4], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } private void TwoFigureJoint(IReadOnlyList figures, IReadOnlyList sectionPoints, ICollection curveList, Vector3d[] localAxis) @@ -90,18 +90,18 @@ private void TwoFigureJoint(IReadOnlyList figures, IReadOnlyList sec.pos == StbSecSteelBeam_S_JointPos.START) != null) { string start = joint.First(sec => sec.pos == StbSecSteelBeam_S_JointPos.START).shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } else { string end = joint.First(sec => sec.pos == StbSecSteelBeam_S_JointPos.END).shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } } @@ -114,19 +114,19 @@ private void TwoFigureHaunch(IReadOnlyList figures, IReadOnlyList sec.pos == StbSecSteelBeam_S_HaunchPos.START).shape; center = joint.First(sec => sec.pos == StbSecSteelBeam_S_HaunchPos.CENTER).shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[4], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } else { center = joint.First(sec => sec.pos == StbSecSteelBeam_S_HaunchPos.CENTER).shape; string end = joint.First(sec => sec.pos == StbSecSteelBeam_S_HaunchPos.END).shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[4], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } } @@ -136,10 +136,10 @@ private void ThreeFigureHaunch(IReadOnlyList figures, IReadOnlyList sec.pos == StbSecSteelBeam_S_HaunchPos.START).shape; string center = haunch.First(sec => sec.pos == StbSecSteelBeam_S_HaunchPos.CENTER).shape; string end = haunch.First(sec => sec.pos == StbSecSteelBeam_S_HaunchPos.END).shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[4], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } private void ThreeFigureJoint(IReadOnlyList figures, IReadOnlyList sectionPoints, ICollection curveList, Vector3d[] localAxis) @@ -148,10 +148,10 @@ private void ThreeFigureJoint(IReadOnlyList figures, IReadOnlyList sec.pos == StbSecSteelBeam_S_JointPos.START).shape; string center = joint.First(sec => sec.pos == StbSecSteelBeam_S_JointPos.CENTER).shape; string end = joint.First(sec => sec.pos == StbSecSteelBeam_S_JointPos.END).shape; - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[1], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionType.Beam, localAxis)); - curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[3], Utils.SectionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, start, sectionPoints[0], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[2], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, center, sectionPoints[3], Utils.SectionPositionType.Beam, localAxis)); + curveList.Add(SteelSections.GetCurve(_sections.StbSecSteel, end, sectionPoints[5], Utils.SectionPositionType.Beam, localAxis)); } } } diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Pile.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Pile.cs new file mode 100644 index 00000000..80011c7a --- /dev/null +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Pile.cs @@ -0,0 +1,177 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +using Rhino.Geometry; + +using STBDotNet.v202; + +namespace HoaryFox.Component.Utils.Geometry.BrepMaker +{ + public class Pile + { + private readonly IReadOnlyList _tolerance; + private readonly StbSections _sections; + private readonly string _guid; + + public Pile(StbSections sections, IReadOnlyList tolerance, string guid) + { + _tolerance = tolerance; + _sections = sections; + _guid = guid; + } + + public Brep CreatePileBrep(string idSection, StbPileKind_structure kind, IReadOnlyList sectionPoints, Vector3d axis) + { + SectionCurve[] curveList = CreateFromEachColumnKind(idSection, kind, sectionPoints, axis); + return Utils.CreateCapedBrepFromLoft(curveList, _tolerance[0]); + } + + private SectionCurve[] CreateFromEachColumnKind(string idSection, StbPileKind_structure kind, IReadOnlyList sectionPoints, Vector3d axis) + { + SectionCurve[] curveList; + try + { + curveList = CreateCurveList(idSection, kind, sectionPoints, axis); + } + catch (Exception) + { + throw new ArgumentException($"Error converting guid: {_guid}\nThe cross-sectional shape of the pile seems to be wrong. Please check."); + } + + return curveList; + } + + private SectionCurve[] CreateCurveList(string idSection, StbPileKind_structure kind, IReadOnlyList sectionPoints, Vector3d axis) + { + SectionCurve[] curveList; + switch (kind) + { + case StbPileKind_structure.RC: + StbSecPile_RC rcSec = _sections.StbSecPile_RC.First(sec => sec.id == idSection); + curveList = SecRcPileToCurves(rcSec.StbSecFigurePile_RC.Item, sectionPoints, axis); + break; + case StbPileKind_structure.PC: + StbSecPileProduct productSec = _sections.StbSecPileProduct.First(sec => sec.id == idSection); + curveList = SecProductPileToCurves(productSec, sectionPoints, axis); + break; + case StbPileKind_structure.S: + default: + throw new ArgumentException("Unsupported StbPileKind"); + } + + return curveList; + } + + private SectionCurve[] SecProductPileToCurves(StbSecPileProduct stbSecPileProduct, IReadOnlyList sectionPoints, Vector3d axis) + { + var curveList = new List(); + var figures = PCPileFigure.GetFigureList(stbSecPileProduct); + foreach ((PCPileFigure fig, int index) in figures.Select((fig, index) => (fig, index))) + { + curveList.Add(SectionCurve.CreateSolidColumnPipe( + sectionPoints[index], fig.Diameter, fig.Diameter - 2 * fig.Thickness, -Vector3d.ZAxis) + ); + curveList.Add(SectionCurve.CreateSolidColumnPipe( + sectionPoints[index + 1] + 10 * Vector3d.ZAxis, fig.Diameter, fig.Diameter - 2 * fig.Thickness, -Vector3d.ZAxis) + ); + } + curveList.Add(SectionCurve.CreateSolidColumnPipe( + sectionPoints.Last(), figures.Last().Diameter, figures.Last().Diameter - 2 * figures.Last().Thickness, -Vector3d.ZAxis) + ); + return curveList.ToArray(); + } + + private static SectionCurve[] SecRcPileToCurves(object figure, IReadOnlyList sectionPoints, Vector3d axis) + { + var curveList = new List(); + Vector3d[] localAxis = Utils.CreateLocalAxis(sectionPoints); + switch (figure) + { + case StbSecPile_RC_Straight straight: + PileStraight(sectionPoints, curveList, localAxis, straight.D); + break; + case StbSecPile_RC_ExtendedFoot foot: + if (foot.D_axial == foot.D_extended_foot) + { + PileStraight(sectionPoints, curveList, localAxis, foot.D_axial); + } + else + { + PileExtendedFoot(sectionPoints, axis, curveList, localAxis, foot.D_axial, foot.D_extended_foot, foot.length_extended_foot, foot.angle_extended_foot_taper); + } + break; + case StbSecPile_RC_ExtendedTop top: + if (top.D_axial == top.D_extended_top) + { + PileStraight(sectionPoints, curveList, localAxis, top.D_axial); + } + else + { + PileExtendedTop(sectionPoints, axis, curveList, localAxis, top.D_extended_top, top.D_axial, top.angle_extended_top_taper); + } + break; + case StbSecPile_RC_ExtendedTopFoot both: + if (both.D_axial == both.D_extended_foot && both.D_axial == both.D_extended_top) + { + PileStraight(sectionPoints, curveList, localAxis, both.D_axial); + } + else if (both.D_axial == both.D_extended_foot) + { + PileExtendedTop(sectionPoints, axis, curveList, localAxis, both.D_extended_top, both.D_axial, both.angle_extended_top_taper); + } + else if (both.D_axial == both.D_extended_top) + { + PileExtendedFoot(sectionPoints, axis, curveList, localAxis, both.D_axial, both.D_extended_foot, both.length_extended_foot, both.angle_extended_foot_taper); + } + else + { + PileExtendedTopFoot(sectionPoints, axis, curveList, localAxis, both); + } + break; + default: + throw new ArgumentException(); + } + + return curveList.ToArray(); + } + + private static void PileExtendedTopFoot(IReadOnlyList sectionPoints, Vector3d axis, List curveList, Vector3d[] localAxis, StbSecPile_RC_ExtendedTopFoot both) + { + var bothPos1 = sectionPoints[1] + axis * (both.D_extended_top - both.D_axial) / 2d / Math.Tan(Math.PI / 180 * both.angle_extended_top_taper); + var bothPos2 = sectionPoints[3] - axis * both.length_extended_foot; + var bothPos3 = bothPos2 - axis * (both.D_extended_foot - both.D_axial) / 2d / Math.Tan(Math.PI / 180 * both.angle_extended_foot_taper); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[0], both.D_extended_top, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[1], both.D_extended_top, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(bothPos1, both.D_axial, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(bothPos3, both.D_axial, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(bothPos2, both.D_extended_foot, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[3], both.D_extended_foot, localAxis[0])); + } + + private static void PileExtendedTop(IReadOnlyList sectionPoints, Vector3d axis, List curveList, Vector3d[] localAxis, double dExtend, double d, double angle) + { + var topPos1 = sectionPoints[1] + axis * (dExtend - d) / 2d / Math.Tan(Math.PI / 180 * angle); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[0], dExtend, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[1], dExtend, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(topPos1, d, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[3], d, localAxis[0])); + } + + private static void PileExtendedFoot(IReadOnlyList sectionPoints, Vector3d axis, List curveList, Vector3d[] localAxis, double d, double dExtend, double length, double angle) + { + var footPos1 = sectionPoints[3] - axis * length; + var footPos2 = footPos1 - axis * (dExtend - d) / 2d / Math.Tan(Math.PI / 180 * angle); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[0], d, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(footPos2, d, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(footPos1, dExtend, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[3], dExtend, localAxis[0])); + } + + private static void PileStraight(IReadOnlyList sectionPoints, List curveList, Vector3d[] localAxis, double d) + { + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[0], d, localAxis[0])); + curveList.Add(SectionCurve.CreateSolidColumnCircle(sectionPoints[3], d, localAxis[0])); + } + } +} diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/SteelSections.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/SteelSections.cs index 5232b1ab..86730d55 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/SteelSections.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/SteelSections.cs @@ -10,12 +10,12 @@ namespace HoaryFox.Component.Utils.Geometry.BrepMaker { public static class SteelSections { - public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d point, Utils.SectionType type, Vector3d[] localAxis) + public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d point, Utils.SectionPositionType type, Vector3d[] localAxis) { - // TODO: foreach なのに最初にマッチしたもので return しているのでが変なので直す。 if (secSteel.StbSecBuildBOX != null) { - foreach (StbSecBuildBOX box in secSteel.StbSecBuildBOX.Where(box => box.name == shape)) + StbSecBuildBOX box = secSteel.StbSecBuildBOX.FirstOrDefault(b => b.name == shape); + if (box != null) { return CurveFromStbSecBox(localAxis, point, type, box.A, box.B, box.t1, box.t2); } @@ -23,7 +23,8 @@ public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d if (secSteel.StbSecRollBOX != null) { - foreach (StbSecRollBOX box in secSteel.StbSecRollBOX.Where(box => box.name == shape)) + StbSecRollBOX box = secSteel.StbSecRollBOX.FirstOrDefault(b => b.name == shape); + if (box != null) { return CurveFromStbSecBox(localAxis, point, type, box.A, box.B, box.t, box.t); } @@ -31,7 +32,8 @@ public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d if (secSteel.StbSecFlatBar != null) { - foreach (StbSecFlatBar flatBar in secSteel.StbSecFlatBar.Where(bar => bar.name == shape)) + StbSecFlatBar flatBar = secSteel.StbSecFlatBar.FirstOrDefault(bar => bar.name == shape); + if (flatBar != null) { return CurveFromStbSecBox(localAxis, point, type, flatBar.B, flatBar.t, -1, -1); } @@ -39,7 +41,8 @@ public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d if (secSteel.StbSecBuildH != null) { - foreach (StbSecBuildH buildH in secSteel.StbSecBuildH.Where(buildH => buildH.name == shape)) + StbSecBuildH buildH = secSteel.StbSecBuildH.FirstOrDefault(bH => bH.name == shape); + if (buildH != null) { return CurveFromStbSecH(localAxis, point, type, buildH.A, buildH.B, buildH.t1, buildH.t2); } @@ -47,15 +50,26 @@ public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d if (secSteel.StbSecRollH != null) { - foreach (StbSecRollH rollH in secSteel.StbSecRollH.Where(rollH => rollH.name == shape)) + StbSecRollH rollH = secSteel.StbSecRollH.FirstOrDefault(rH => rH.name == shape); + if (rollH != null) { return CurveFromStbSecH(localAxis, point, type, rollH.A, rollH.B, rollH.t1, rollH.t2); } } + if (secSteel.StbSecRollT != null) + { + StbSecRollT rollT = secSteel.StbSecRollT.FirstOrDefault(rT => rT.name == shape); + if (rollT != null) + { + return CurveFromStbSecT(localAxis, point, type, rollT.A, rollT.B, rollT.t1, rollT.t2); + } + } + if (secSteel.StbSecRollL != null) { - foreach (StbSecRollL rollL in secSteel.StbSecRollL.Where(rollL => rollL.name == shape)) + StbSecRollL rollL = secSteel.StbSecRollL.FirstOrDefault(rL => rL.name == shape); + if (rollL != null) { return CurveFromStbSecL(localAxis, point, type, rollL); } @@ -63,7 +77,8 @@ public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d if (secSteel.StbSecPipe != null) { - foreach (StbSecPipe pipe in secSteel.StbSecPipe.Where(pipe => pipe.name == shape)) + StbSecPipe pipe = secSteel.StbSecPipe.FirstOrDefault(p => p.name == shape); + if (pipe != null) { return CurveFromStbSecPipe(localAxis, point, type, pipe.D, pipe.t); } @@ -71,22 +86,99 @@ public static SectionCurve GetCurve(StbSecSteel secSteel, string shape, Point3d if (secSteel.StbSecRoundBar != null) { - foreach (StbSecRoundBar bar in secSteel.StbSecRoundBar.Where(pipe => pipe.name == shape)) + StbSecRoundBar bar = secSteel.StbSecRoundBar.FirstOrDefault(b => b.name == shape); + if (bar != null) { return CurveFromStbSecPipe(localAxis, point, type, bar.R, -1); } } - // TODO: C 断面を実装する - if (secSteel.StbSecRollC != null || secSteel.StbSecLipC != null) + if (secSteel.StbSecRollC != null) + { + StbSecRollC rollC = secSteel.StbSecRollC.FirstOrDefault(rC => rC.name == shape); + if (rollC != null) + { + return CurveFromStbSecRollC(localAxis, point, type, rollC); + } + } + + if (secSteel.StbSecLipC != null) { - throw new ArgumentException("StbSecRollC & StbSecLipC is not supported"); + StbSecLipC lipC = secSteel.StbSecLipC.FirstOrDefault(lC => lC.name == shape); + if (lipC != null) + { + return CurveFromStbSecLipC(localAxis, point, type, lipC); + } } throw new ArgumentException("There are no matching steel section"); } - private static SectionCurve CurveFromStbSecPipe(IReadOnlyList localAxis, Point3d point, Utils.SectionType type, double diameter, double thickness) + private static SectionCurve CurveFromStbSecLipC(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, StbSecLipC lipC) + { + StbSecRollCType shapeType; + switch (lipC.type) + { + case StbSecLipCType.SINGLE: + shapeType = StbSecRollCType.SINGLE; + break; + case StbSecLipCType.BACKTOBACK: + shapeType = StbSecRollCType.BACKTOBACK; + break; + case StbSecLipCType.FACETOFACE: + shapeType = StbSecRollCType.FACETOFACE; + break; + default: + throw new ArgumentOutOfRangeException(); + } + return CurveFromSecC(localAxis, point, type, lipC.A, lipC.H, lipC.t, lipC.t, shapeType); + } + + private static SectionCurve CurveFromStbSecRollC(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, StbSecRollC rollC) + { + return CurveFromSecC(localAxis, point, type, rollC.B, rollC.A, rollC.t1, rollC.t2, rollC.type); + } + + private static SectionCurve CurveFromSecC(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, double width, double height, double tw, double tf, StbSecRollCType shapeType) + { + var sectionCurve = new SectionCurve + { + Shape = SectionShape.C, + Type = shapeType == StbSecRollCType.FACETOFACE ? SectionType.Hollow : SectionType.Solid, + XAxis = localAxis[0], + }; + switch (type) + { + case Utils.SectionPositionType.Column: + case Utils.SectionPositionType.Brace: + if (shapeType == StbSecRollCType.FACETOFACE) + { + sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.ColumnRect(point, 2 * width, height, localAxis[1], localAxis[2])); + sectionCurve.InnerCurve = new PolylineCurve(SectionCornerPoints.ColumnRect(point, 2 * width - tw * 2, height - tf * 2, localAxis[1], localAxis[2])); + } + else + { + sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.ColumnC(point, height, width, tw, tf, shapeType, localAxis[1], localAxis[2])); + } + break; + case Utils.SectionPositionType.Beam: + if (shapeType == StbSecRollCType.FACETOFACE) + { + sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.BeamRect(point, height, width, localAxis[1], localAxis[2])); + sectionCurve.InnerCurve = new PolylineCurve(SectionCornerPoints.BeamRect(point, height - tf * 2, width - tw * 2, localAxis[1], localAxis[2])); + } + else + { + sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.BeamC(point, height, width, tw, tf, shapeType, localAxis[1], localAxis[2])); + } + break; + default: + throw new ArgumentOutOfRangeException(nameof(type), type, null); + } + return sectionCurve; + } + + private static SectionCurve CurveFromStbSecPipe(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, double diameter, double thickness) { var radius = diameter / 2; var sectionCurve = new SectionCurve @@ -97,12 +189,12 @@ private static SectionCurve CurveFromStbSecPipe(IReadOnlyList localAxi }; switch (type) { - case Utils.SectionType.Column: - case Utils.SectionType.Brace: + case Utils.SectionPositionType.Column: + case Utils.SectionPositionType.Brace: sectionCurve.OuterCurve = SectionCornerPoints.ColumnPipe(point, radius, localAxis[0]); sectionCurve.InnerCurve = thickness > 0 ? SectionCornerPoints.ColumnPipe(point, radius - thickness, localAxis[0]) : null; break; - case Utils.SectionType.Beam: + case Utils.SectionPositionType.Beam: sectionCurve.OuterCurve = SectionCornerPoints.BeamPipe(point, radius, localAxis[0]); sectionCurve.InnerCurve = thickness > 0 ? SectionCornerPoints.BeamPipe(point, radius - thickness, localAxis[0]) : null; break; @@ -112,7 +204,7 @@ private static SectionCurve CurveFromStbSecPipe(IReadOnlyList localAxi return sectionCurve; } - private static SectionCurve CurveFromStbSecL(IReadOnlyList localAxis, Point3d point, Utils.SectionType type, StbSecRollL rollL) + private static SectionCurve CurveFromStbSecL(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, StbSecRollL rollL) { var sectionCurve = new SectionCurve { @@ -122,11 +214,11 @@ private static SectionCurve CurveFromStbSecL(IReadOnlyList localAxis, }; switch (type) { - case Utils.SectionType.Column: - case Utils.SectionType.Brace: + case Utils.SectionPositionType.Column: + case Utils.SectionPositionType.Brace: sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.ColumnL(point, rollL.A, rollL.B, rollL.t1, rollL.t2, rollL.type, localAxis[1], localAxis[2])); break; - case Utils.SectionType.Beam: + case Utils.SectionPositionType.Beam: sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.BeamL(point, rollL.A, rollL.B, rollL.t1, rollL.t2, rollL.type, localAxis[1], localAxis[2])); break; default: @@ -135,7 +227,7 @@ private static SectionCurve CurveFromStbSecL(IReadOnlyList localAxis, return sectionCurve; } - private static SectionCurve CurveFromStbSecBox(IReadOnlyList localAxis, Point3d point, Utils.SectionType type, double A, double B, double t1, double t2) + private static SectionCurve CurveFromStbSecBox(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, double A, double B, double t1, double t2) { var sectionCurve = new SectionCurve { @@ -145,12 +237,12 @@ private static SectionCurve CurveFromStbSecBox(IReadOnlyList localAxis }; switch (type) { - case Utils.SectionType.Column: - case Utils.SectionType.Brace: + case Utils.SectionPositionType.Column: + case Utils.SectionPositionType.Brace: sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.ColumnRect(point, B, A, localAxis[1], localAxis[2])); sectionCurve.InnerCurve = t1 > 0 ? new PolylineCurve(SectionCornerPoints.ColumnRect(point, B - 2 * t1, A - 2 * t2, localAxis[1], localAxis[2])) : null; break; - case Utils.SectionType.Beam: + case Utils.SectionPositionType.Beam: sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.BeamRect(point, B, A, localAxis[1], localAxis[2])); sectionCurve.InnerCurve = t1 > 0 ? new PolylineCurve(SectionCornerPoints.BeamRect(point, B - 2 * t1, A - 2 * t2, localAxis[1], localAxis[2])) : null; break; @@ -160,7 +252,7 @@ private static SectionCurve CurveFromStbSecBox(IReadOnlyList localAxis return sectionCurve; } - private static SectionCurve CurveFromStbSecH(IReadOnlyList localAxis, Point3d point, Utils.SectionType type, double A, double B, double t1, double t2) + private static SectionCurve CurveFromStbSecH(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, double A, double B, double t1, double t2) { var sectionCurve = new SectionCurve { @@ -170,11 +262,11 @@ private static SectionCurve CurveFromStbSecH(IReadOnlyList localAxis, }; switch (type) { - case Utils.SectionType.Column: - case Utils.SectionType.Brace: + case Utils.SectionPositionType.Column: + case Utils.SectionPositionType.Brace: sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.ColumnH(point, A, B, t1, t2, localAxis[1], localAxis[2])); break; - case Utils.SectionType.Beam: + case Utils.SectionPositionType.Beam: sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.BeamH(point, A, B, t1, t2, localAxis[1], localAxis[2])); break; default: @@ -182,5 +274,28 @@ private static SectionCurve CurveFromStbSecH(IReadOnlyList localAxis, } return sectionCurve; } + + private static SectionCurve CurveFromStbSecT(IReadOnlyList localAxis, Point3d point, Utils.SectionPositionType type, double A, double B, double t1, double t2) + { + var sectionCurve = new SectionCurve + { + Shape = SectionShape.T, + Type = SectionType.Solid, + XAxis = localAxis[0], + }; + switch (type) + { + case Utils.SectionPositionType.Column: + case Utils.SectionPositionType.Brace: + sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.ColumnT(point, A, B, t1, t2, localAxis[1], localAxis[2])); + break; + case Utils.SectionPositionType.Beam: + sectionCurve.OuterCurve = new PolylineCurve(SectionCornerPoints.BeamT(point, A, B, t1, t2, localAxis[1], localAxis[2])); + break; + default: + throw new ArgumentOutOfRangeException(nameof(type), type, null); + } + return sectionCurve; + } } } diff --git a/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs index a2587faa..ae6068c2 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); @@ -92,7 +91,7 @@ public static Brep CreateCapedBrepFromLoft(SectionCurve[] sectionCurve, double t return brep; } - public enum SectionType + public enum SectionPositionType { Column, Beam, diff --git a/HoaryFox/RH7/Component/Utils/Geometry/CreateLineFromStb.cs b/HoaryFox/RH7/Component/Utils/Geometry/CreateLineFromStb.cs index 25ca8d7f..1a53a73f 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/CreateLineFromStb.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/CreateLineFromStb.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using Grasshopper.Kernel.Data; @@ -13,12 +14,16 @@ namespace HoaryFox.Component.Utils.Geometry public class CreateLineFromStb { private readonly StbMembers _members; + private readonly StbSections _sections; private readonly StbNode[] _nodes; + private readonly bool _isOffset; - public CreateLineFromStb(ST_BRIDGE stBridge) + public CreateLineFromStb(ST_BRIDGE stBridge, bool isOffset) { _members = stBridge.StbModel.StbMembers; + _sections = stBridge.StbModel.StbSections; _nodes = stBridge.StbModel.StbNodes; + _isOffset = isOffset; } public List Nodes() @@ -36,8 +41,32 @@ public GH_Structure Columns() foreach ((StbColumn member, int i) in _members.StbColumns.Select((member, index) => (member, index))) { - StbNode nodeBottom = _nodes.First(node => node.id == member.id_node_bottom); - StbNode nodeTop = _nodes.First(node => node.id == member.id_node_top); + StbNode nodeBottom = new StbNode(); + StbNode nodeTop = new StbNode(); + + StbNode nodeBottomBase = _nodes.First(node => node.id == member.id_node_bottom); + StbNode nodeTopBase = _nodes.First(node => node.id == member.id_node_top); + + if (_isOffset) + { + nodeBottom = new StbNode + { + X = nodeBottomBase.X + member.offset_bottom_X, + Y = nodeBottomBase.Y + member.offset_bottom_Y, + Z = nodeBottomBase.Z + member.offset_bottom_Z + }; + nodeTop = new StbNode + { + X = nodeTopBase.X + member.offset_top_X, + Y = nodeTopBase.Y + member.offset_top_Y, + Z = nodeTopBase.Z + member.offset_top_Z + }; + } + else + { + nodeBottom = nodeBottomBase; + nodeTop = nodeTopBase; + } lines.Append(GH_LineFromStbNode(nodeBottom, nodeTop), new GH_Path(0, i)); } @@ -55,9 +84,32 @@ public GH_Structure Girders() foreach ((StbGirder member, int i) in _members.StbGirders.Select((member, index) => (member, index))) { - StbNode nodeStart = _nodes.First(node => node.id == member.id_node_start); - StbNode nodeEnd = _nodes.First(node => node.id == member.id_node_end); + var nodeStart = new StbNode(); + var nodeEnd = new StbNode(); + + StbNode nodeStartBase = _nodes.First(node => node.id == member.id_node_start); + StbNode nodeEndBase = _nodes.First(node => node.id == member.id_node_end); + if (_isOffset) + { + nodeStart = new StbNode + { + X = nodeStartBase.X + member.offset_start_X, + Y = nodeStartBase.Y + member.offset_start_Y, + Z = nodeStartBase.Z + member.offset_start_Z + }; + nodeEnd = new StbNode + { + X = nodeEndBase.X + member.offset_end_X, + Y = nodeEndBase.Y + member.offset_end_Y, + Z = nodeEndBase.Z + member.offset_end_Z + }; + } + else + { + nodeStart = nodeStartBase; + nodeEnd = nodeEndBase; + } lines.Append(GH_LineFromStbNode(nodeStart, nodeEnd), new GH_Path(0, i)); } @@ -74,8 +126,32 @@ public GH_Structure Posts() foreach ((StbPost member, int i) in _members.StbPosts.Select((member, index) => (member, index))) { - StbNode nodeBottom = _nodes.First(node => node.id == member.id_node_bottom); - StbNode nodeTop = _nodes.First(node => node.id == member.id_node_top); + var nodeBottom = new StbNode(); + var nodeTop = new StbNode(); + + StbNode nodeBottomBase = _nodes.First(node => node.id == member.id_node_bottom); + StbNode nodeTopBase = _nodes.First(node => node.id == member.id_node_top); + + if (_isOffset) + { + nodeBottom = new StbNode + { + X = nodeBottomBase.X + member.offset_bottom_X, + Y = nodeBottomBase.Y + member.offset_bottom_Y, + Z = nodeBottomBase.Z + member.offset_bottom_Z + }; + nodeTop = new StbNode + { + X = nodeTopBase.X + member.offset_top_X, + Y = nodeTopBase.Y + member.offset_top_Y, + Z = nodeTopBase.Z + member.offset_top_Z + }; + } + else + { + nodeBottom = nodeBottomBase; + nodeTop = nodeTopBase; + } lines.Append(GH_LineFromStbNode(nodeBottom, nodeTop), new GH_Path(0, i)); } @@ -93,8 +169,32 @@ public GH_Structure Beams() foreach ((StbBeam member, int i) in _members.StbBeams.Select((member, index) => (member, index))) { - StbNode nodeStart = _nodes.First(node => node.id == member.id_node_start); - StbNode nodeEnd = _nodes.First(node => node.id == member.id_node_end); + var nodeStart = new StbNode(); + var nodeEnd = new StbNode(); + + StbNode nodeStartBase = _nodes.First(node => node.id == member.id_node_start); + StbNode nodeEndBase = _nodes.First(node => node.id == member.id_node_end); + + if (_isOffset) + { + nodeStart = new StbNode + { + X = nodeStartBase.X + member.offset_start_X, + Y = nodeStartBase.Y + member.offset_start_Y, + Z = nodeStartBase.Z + member.offset_start_Z + }; + nodeEnd = new StbNode + { + X = nodeEndBase.X + member.offset_end_X, + Y = nodeEndBase.Y + member.offset_end_Y, + Z = nodeEndBase.Z + member.offset_end_Z + }; + } + else + { + nodeStart = nodeStartBase; + nodeEnd = nodeEndBase; + } lines.Append(GH_LineFromStbNode(nodeStart, nodeEnd), new GH_Path(0, i)); } @@ -112,8 +212,32 @@ public GH_Structure Braces() foreach ((StbBrace member, int i) in _members.StbBraces.Select((member, index) => (member, index))) { - StbNode nodeStart = _nodes.First(node => node.id == member.id_node_start); - StbNode nodeEnd = _nodes.First(node => node.id == member.id_node_end); + var nodeStart = new StbNode(); + var nodeEnd = new StbNode(); + + StbNode nodeStartBase = _nodes.First(node => node.id == member.id_node_start); + StbNode nodeEndBase = _nodes.First(node => node.id == member.id_node_end); + + if (_isOffset) + { + nodeStart = new StbNode + { + X = nodeStartBase.X + member.offset_start_X, + Y = nodeStartBase.Y + member.offset_start_Y, + Z = nodeStartBase.Z + member.offset_start_Z + }; + nodeEnd = new StbNode + { + X = nodeEndBase.X + member.offset_end_X, + Y = nodeEndBase.Y + member.offset_end_Y, + Z = nodeEndBase.Z + member.offset_end_Z + }; + } + else + { + nodeStart = nodeStartBase; + nodeEnd = nodeEndBase; + } lines.Append(GH_LineFromStbNode(nodeStart, nodeEnd), new GH_Path(0, i)); } @@ -121,6 +245,109 @@ public GH_Structure Braces() return lines; } + internal GH_Structure Piles() + { + var lines = new GH_Structure(); + if (_members.StbPiles == null) + { + return lines; + } + + foreach ((StbPile member, int i) in _members.StbPiles.Select((member, index) => (member, index))) + { + switch (member.kind_structure) + { + case StbPileKind_structure.RC: + GetRcPileLines(lines, member, i); + break; + case StbPileKind_structure.PC: + GetPcPileLines(lines, member, i); + break; + case StbPileKind_structure.S: + throw new NotImplementedException(); + } + } + + return lines; + } + + private void GetPcPileLines(GH_Structure lines, StbPile member, int i) + { + var figures = PCPileFigure.GetFigureList(_sections, member); + + var nodes = new List(); + StbNode node = _nodes.First(n => n.id == member.id_node); + if (_isOffset) + { + nodes.Add(new StbNode + { + X = node.X + member.offset_X, + Y = node.Y + member.offset_Y, + Z = node.Z + member.level_top + }); + } + else + { + nodes.Add(new StbNode + { + X = node.X, + Y = node.Y, + Z = node.Z + }); + } + + foreach ((PCPileFigure figure, int index) in figures.Select((figure, index) => (figure, index))) + { + nodes.Add(new StbNode + { + X = nodes[index].X, + Y = nodes[index].Y, + Z = nodes[index].Z - figure.Length + }); + lines.Append(GH_LineFromStbNode(nodes[index], nodes[index + 1]), new GH_Path(0, i)); + } + } + + private void GetRcPileLines(GH_Structure lines, StbPile member, int i) + { + var nodeBottom = new StbNode(); + var nodeTop = new StbNode(); + + StbNode node = _nodes.First(n => n.id == member.id_node); + if (_isOffset) + { + nodeTop = new StbNode + { + X = node.X + member.offset_X, + Y = node.Y + member.offset_Y, + Z = node.Z + member.level_top + }; + nodeBottom = new StbNode + { + X = nodeTop.X, + Y = nodeTop.Y, + Z = nodeTop.Z - member.length_all + }; + + } + else + { + nodeTop = new StbNode + { + X = node.X, + Y = node.Y, + Z = node.Z + }; + nodeBottom = new StbNode + { + X = nodeTop.X, + Y = nodeTop.Y, + Z = nodeTop.Z - member.length_all + member.level_top + }; + } + lines.Append(GH_LineFromStbNode(nodeBottom, nodeTop), new GH_Path(0, i)); + } + private static GH_Line GH_LineFromStbNode(StbNode from, StbNode to) { var ptFrom = new Point3d(from.X, from.Y, from.Z); diff --git a/HoaryFox/RH7/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs b/HoaryFox/RH7/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs index 482621a3..ecf7e06a 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs @@ -1,5 +1,7 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; +using System.Reflection; using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; @@ -15,256 +17,363 @@ public class CreateMemberBrepListFromStb private readonly IEnumerable _nodes; private readonly IReadOnlyList _tolerance; private readonly StbSections _sections; + public ConvertLogger Logger { get; private set; } - public CreateMemberBrepListFromStb(StbSections sections, IEnumerable nodes, IReadOnlyList tolerance) + public CreateMemberBrepListFromStb(StbSections sections, IEnumerable nodes, IReadOnlyList tolerance, string logPath) { _nodes = nodes; _tolerance = tolerance; _sections = sections; + var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(3); + Logger = new ConvertLogger(logPath, version); + } + + public void SerializeLog() + { + Logger.Serialize(); } public GH_Structure Column(IEnumerable columns) { + var typeStr = "柱"; + Logger.AppendInfoConvertStartMessage(typeStr); + var resultCount = new int[] { 0, 0, 0 }; var brepList = new GH_Structure(); if (columns == null) { + Logger.AppendInfoDataNotFoundMessage(typeStr); return brepList; } foreach ((StbColumn column, int i) in columns.Select((column, index) => (column, index))) { - StbColumnKind_structure kind = column.kind_structure; - - StbNode[] endNodes = + try { - _nodes.First(node => node.id == column.id_node_bottom), - _nodes.First(node => node.id == column.id_node_top) - }; - Point3d[] offset = - { - new Point3d(column.offset_bottom_X, column.offset_bottom_Y, column.offset_bottom_Z), - new Point3d(column.offset_top_X, column.offset_top_Y, column.offset_top_Z) - }; - Point3d[] sectionPoints = + StbColumnKind_structure kind = column.kind_structure; + StbNode[] endNodes = + { + _nodes.First(node => node.id == column.id_node_bottom), + _nodes.First(node => node.id == column.id_node_top) + }; + Point3d[] offset = + { + new Point3d(column.offset_bottom_X, column.offset_bottom_Y, column.offset_bottom_Z), + new Point3d(column.offset_top_X, column.offset_top_Y, column.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 * column.joint_bottom; + sectionPoints[2] = sectionPoints[3] - memberAxis / memberAxis.Length * column.joint_top; + + var brepMaker = new BrepMaker.Column(_sections, _tolerance, column.guid); + var brep = brepMaker.CreateColumnBrep(column.id_section, column.rotate, kind, sectionPoints, memberAxis); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(resultCount, column.guid, column.name, brep); + } + catch (Exception e) { - 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 * column.joint_bottom; - sectionPoints[2] = sectionPoints[3] - memberAxis / memberAxis.Length * column.joint_top; - - var brepMaker = new BrepMaker.Column(_sections, _tolerance); - brepList.Append(new GH_Brep(brepMaker.CreateColumnBrep(column.id_section, column.rotate, kind, sectionPoints, memberAxis)), new GH_Path(0, i)); + ConvertFailed(resultCount, column.guid, column.name, e); + } } + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeStr); return brepList; } public GH_Structure Post(IEnumerable posts) { + var typeStr = "間柱"; + Logger.AppendInfoConvertStartMessage(typeStr); + var resultCount = new int[] { 0, 0, 0 }; var brepList = new GH_Structure(); if (posts == null) { + Logger.AppendInfoDataNotFoundMessage(typeStr); 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 = + try { - 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 = + 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, post.guid); + var brep = brepMaker.CreateColumnBrep(post.id_section, post.rotate, kind, sectionPoints, memberAxis); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(resultCount, post.guid, post.name, brep); + } + catch (Exception e) { - 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)); + ConvertFailed(resultCount, post.guid, post.name, e); + } } + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeStr); return brepList; } public GH_Structure Girder(IEnumerable girders) { + var typeStr = "大梁"; + Logger.AppendInfoConvertStartMessage(typeStr); + var resultCount = new int[] { 0, 0, 0 }; var brepList = new GH_Structure(); if (girders == null) { + Logger.AppendInfoDataNotFoundMessage(typeStr); return brepList; } foreach ((StbGirder girder, int i) in girders.Select((girder, index) => (girder, index))) { - StbGirderKind_structure kind = girder.kind_structure; - - StbNode[] endNodes = - { - _nodes.First(node => node.id == girder.id_node_start), - _nodes.First(node => node.id == girder.id_node_end) - }; - Point3d[] offset = + try { - new Point3d(girder.offset_start_X, girder.offset_start_Y, girder.offset_start_Z), - new Point3d(girder.offset_end_X, girder.offset_end_Y, girder.offset_end_Z) - }; - Point3d[] sectionPoints = + StbGirderKind_structure kind = girder.kind_structure; + StbNode[] endNodes = + { + _nodes.First(node => node.id == girder.id_node_start), + _nodes.First(node => node.id == girder.id_node_end) + }; + Point3d[] offset = + { + new Point3d(girder.offset_start_X, girder.offset_start_Y, girder.offset_start_Z), + new Point3d(girder.offset_end_X, girder.offset_end_Y, girder.offset_end_Z) + }; + Point3d[] sectionPoints = + { + new Point3d(endNodes[0].X, endNodes[0].Y, endNodes[0].Z) + offset[0], + Point3d.Origin, // haunch_s + Point3d.Origin, // joint_s + Point3d.Origin, // joint_e + Point3d.Origin, // haunch_e + new Point3d(endNodes[1].X, endNodes[1].Y, endNodes[1].Z) + offset[1] + }; + Vector3d memberAxis = sectionPoints[5] - sectionPoints[0]; + sectionPoints[1] = sectionPoints[0] + memberAxis / memberAxis.Length * girder.haunch_start; + sectionPoints[2] = sectionPoints[0] + memberAxis / memberAxis.Length * girder.joint_start; + sectionPoints[3] = sectionPoints[5] - memberAxis / memberAxis.Length * girder.joint_end; + sectionPoints[4] = sectionPoints[5] - memberAxis / memberAxis.Length * girder.haunch_end; + + var brepMaker = new BrepMaker.Girder(_sections, _tolerance, girder.guid); + var brep = brepMaker.CreateGirderBrep(girder.id_section, girder.rotate, kind, sectionPoints, memberAxis); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(resultCount, girder.guid, girder.name, brep); + } + catch (Exception e) { - new Point3d(endNodes[0].X, endNodes[0].Y, endNodes[0].Z) + offset[0], - Point3d.Origin, - Point3d.Origin, - 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 * girder.joint_start; - sectionPoints[2] = sectionPoints[3] - memberAxis / memberAxis.Length * girder.joint_end; - - var brepMaker = new BrepMaker.Girder(_sections, _tolerance); - brepList.Append(new GH_Brep(brepMaker.CreateGirderBrep(girder.id_section, girder.rotate, kind, sectionPoints, memberAxis)), new GH_Path(0, i)); + ConvertFailed(resultCount, girder.guid, girder.name, e); + } } + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeStr); return brepList; } public GH_Structure Beam(IEnumerable beams) { + var typeStr = "小梁"; + Logger.AppendInfoConvertStartMessage(typeStr); + var resultCount = new int[] { 0, 0, 0 }; var brepList = new GH_Structure(); if (beams == null) { + Logger.AppendInfoDataNotFoundMessage(typeStr); return brepList; } foreach ((StbBeam beam, int i) in beams.Select((beam, index) => (beam, index))) { - StbGirderKind_structure kind = beam.kind_structure; - - StbNode[] endNodes = - { - _nodes.First(node => node.id == beam.id_node_start), - _nodes.First(node => node.id == beam.id_node_end) - }; - Point3d[] offset = + try { - new Point3d(beam.offset_start_X, beam.offset_start_Y, beam.offset_start_Z), - new Point3d(beam.offset_end_X, beam.offset_end_Y, beam.offset_end_Z) - }; - Point3d[] sectionPoints = + StbGirderKind_structure kind = beam.kind_structure; + StbNode[] endNodes = + { + _nodes.First(node => node.id == beam.id_node_start), + _nodes.First(node => node.id == beam.id_node_end) + }; + Point3d[] offset = + { + new Point3d(beam.offset_start_X, beam.offset_start_Y, beam.offset_start_Z), + new Point3d(beam.offset_end_X, beam.offset_end_Y, beam.offset_end_Z) + }; + Point3d[] sectionPoints = + { + new Point3d(endNodes[0].X, endNodes[0].Y, endNodes[0].Z) + offset[0], + Point3d.Origin, // haunch_s + Point3d.Origin, // joint_s + Point3d.Origin, // joint_e + Point3d.Origin, // haunch_e + new Point3d(endNodes[1].X, endNodes[1].Y, endNodes[1].Z) + offset[1] + }; + Vector3d memberAxis = sectionPoints[5] - sectionPoints[0]; + sectionPoints[1] = sectionPoints[0] + memberAxis / memberAxis.Length * beam.haunch_start; + sectionPoints[2] = sectionPoints[0] + memberAxis / memberAxis.Length * beam.joint_start; + sectionPoints[3] = sectionPoints[5] - memberAxis / memberAxis.Length * beam.joint_end; + sectionPoints[4] = sectionPoints[5] - memberAxis / memberAxis.Length * beam.haunch_end; + + var brepMaker = new BrepMaker.Girder(_sections, _tolerance, beam.guid); + var brep = brepMaker.CreateGirderBrep(beam.id_section, beam.rotate, kind, sectionPoints, memberAxis); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(resultCount, beam.guid, beam.name, brep); + } + catch (Exception e) { - new Point3d(endNodes[0].X, endNodes[0].Y, endNodes[0].Z) + offset[0], - Point3d.Origin, - Point3d.Origin, - 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 * beam.joint_start; - sectionPoints[2] = sectionPoints[3] - memberAxis / memberAxis.Length * beam.joint_end; - - var brepMaker = new BrepMaker.Girder(_sections, _tolerance); - brepList.Append(new GH_Brep(brepMaker.CreateGirderBrep(beam.id_section, beam.rotate, kind, sectionPoints, memberAxis)), new GH_Path(0, i)); + ConvertFailed(resultCount, beam.guid, beam.name, e); + } } + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeStr); return brepList; } public GH_Structure Brace(IEnumerable braces) { + var typeStr = "ブレース"; + Logger.AppendInfoConvertStartMessage(typeStr); + var resultCount = new int[] { 0, 0, 0 }; var brepList = new GH_Structure(); if (braces == null) { + Logger.AppendInfoDataNotFoundMessage(typeStr); return brepList; } foreach ((StbBrace brace, int i) in braces.Select((brace, index) => (brace, index))) { - StbBraceKind_structure kind = brace.kind_structure; - - StbNode[] endNodes = - { - _nodes.First(node => node.id == brace.id_node_start), - _nodes.First(node => node.id == brace.id_node_end) - }; - Point3d[] offset = + try { - new Point3d(brace.offset_start_X, brace.offset_start_Y, brace.offset_start_Z), - new Point3d(brace.offset_end_X, brace.offset_end_Y, brace.offset_end_Z) - }; - Point3d[] sectionPoints = + StbBraceKind_structure kind = brace.kind_structure; + StbNode[] endNodes = + { + _nodes.First(node => node.id == brace.id_node_start), + _nodes.First(node => node.id == brace.id_node_end) + }; + Point3d[] offset = + { + new Point3d(brace.offset_start_X, brace.offset_start_Y, brace.offset_start_Z), + new Point3d(brace.offset_end_X, brace.offset_end_Y, brace.offset_end_Z) + }; + Point3d[] sectionPoints = + { + new Point3d(endNodes[0].X, endNodes[0].Y, endNodes[0].Z) + offset[0], + Point3d.Origin, + Point3d.Origin, + 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 * brace.joint_start; + sectionPoints[2] = sectionPoints[3] - memberAxis / memberAxis.Length * brace.joint_end; + + var brepMaker = new BrepMaker.Brace(_sections, _tolerance, brace.guid); + var brep = brepMaker.CreateBraceBrep(brace.id_section, brace.rotate, kind, sectionPoints, memberAxis); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(resultCount, brace.guid, brace.name, brep); + } + catch (Exception e) { - new Point3d(endNodes[0].X, endNodes[0].Y, endNodes[0].Z) + offset[0], - Point3d.Origin, - Point3d.Origin, - 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 * brace.joint_start; - sectionPoints[2] = sectionPoints[3] - memberAxis / memberAxis.Length * brace.joint_end; - - var brepMaker = new BrepMaker.Brace(_sections, _tolerance); - brepList.Append(new GH_Brep(brepMaker.CreateBraceBrep(brace.id_section, brace.rotate, kind, sectionPoints, memberAxis)), new GH_Path(0, i)); + ConvertFailed(resultCount, brace.guid, brace.name, e); + } } + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeStr); return brepList; } public GH_Structure Slab(IEnumerable slabs) { + var typeStr = "スラブ"; + Logger.AppendInfoConvertStartMessage(typeStr); + var resultCount = new int[] { 0, 0, 0 }; var brepList = new GH_Structure(); if (slabs == null) { + Logger.AppendInfoDataNotFoundMessage(typeStr); return brepList; } foreach ((StbSlab slab, int i) in slabs.Select((slab, index) => (slab, index))) { - StbSlabOffset[] offsets = slab.StbSlabOffsetList; - var curveList = new PolylineCurve[2]; - double depth = BrepMaker.Slab.GetDepth(_sections, slab); - string[] nodeIds = slab.StbNodeIdOrder.Split(' '); - var topPts = new List(); - foreach (string nodeId in nodeIds) + try { - var offsetVec = new Vector3d(); - if (offsets != null) + StbSlabOffset[] offsets = slab.StbSlabOffsetList; + var curveList = new PolylineCurve[2]; + double depth = BrepMaker.Slab.GetDepth(_sections, slab); + string[] nodeIds = slab.StbNodeIdOrder.Split(' '); + var topPts = new List(); + foreach (string nodeId in nodeIds) { - foreach (StbSlabOffset offset in offsets) + var offsetVec = new Vector3d(); + if (offsets != null) { - if (nodeId == offset.id_node) + foreach (StbSlabOffset offset in offsets) { - offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); + if (nodeId == offset.id_node) + { + offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); + } } } + + StbNode node = _nodes.First(n => n.id == nodeId); + topPts.Add(new Point3d(node.X, node.Y, node.Z) + offsetVec); } - StbNode node = _nodes.First(n => n.id == nodeId); - topPts.Add(new Point3d(node.X, node.Y, node.Z) + offsetVec); - } + topPts.Add(topPts[0]); + curveList[0] = new PolylineCurve(topPts); + var brep = CreateSlabBrep(slab.guid, depth, curveList, topPts); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); - topPts.Add(topPts[0]); - curveList[0] = new PolylineCurve(topPts); - brepList.Append(CreateSlabBrep(depth, curveList, topPts), new GH_Path(0, i)); + ConvertResultCheck(resultCount, slab.guid, slab.name, brep); + } + catch (Exception e) + { + ConvertFailed(resultCount, slab.guid, slab.name, e); + } } + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeStr); return brepList; } - private GH_Brep CreateSlabBrep(double depth, IList curveList, IEnumerable topPts) + private Brep CreateSlabBrep(string guid, double depth, IList curveList, IEnumerable topPts) { if (depth > 0) { @@ -275,19 +384,20 @@ private GH_Brep CreateSlabBrep(double depth, IList curveList, IEn if (capedBrep == null) { + Logger.AppendInfo(guid, "スラブがplanerではないため、NetSurfaceで曲面のスラブ生成します。"); return NonPlanarBrep(depth, curveList); } CheckBrepOrientation(capedBrep); - return new GH_Brep(capedBrep); + return capedBrep; } - return new GH_Brep(curveList[0].IsPlanar() + return curveList[0].IsPlanar() ? Brep.CreatePlanarBreps(curveList[0], _tolerance[0])[0] - : Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0])); + : Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0]); } - private GH_Brep NonPlanarBrep(double depth, IList curveList) + private Brep NonPlanarBrep(double depth, IList curveList) { var nonPlanarBrep = new List(); var topBrep = Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0]); @@ -307,57 +417,73 @@ private GH_Brep NonPlanarBrep(double depth, IList curveList) IEnumerable edgeCurveList = topBrep.Edges.Select(edge => edge.DuplicateCurve()); nonPlanarBrep.AddRange(edgeCurveList.Select(edgeCurve => Surface.CreateExtrusion(edgeCurve, faceNormal * depth).ToBrep())); - return new GH_Brep(Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep); + return Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep; } public GH_Structure Wall(IEnumerable walls, IEnumerable opens) { + var typeStr = "壁"; + Logger.AppendInfoConvertStartMessage(typeStr); + var resultCount = new int[] { 0, 0, 0 }; var brepList = new GH_Structure(); if (walls == null) { + Logger.AppendInfoDataNotFoundMessage(typeStr); return brepList; } foreach ((StbWall wall, int i) in walls.Select((wall, index) => (wall, index))) { - StbWallOffset[] offsets = wall.StbWallOffsetList; - var curveList = new PolylineCurve[2]; - double thickness = BrepMaker.Wall.GetThickness(_sections, wall); - string[] nodeIds = wall.StbNodeIdOrder.Split(' '); - var wallPts = new List(); - foreach (string nodeId in nodeIds) + try { - var offsetVec = new Vector3d(); - if (offsets != null) + StbWallOffset[] offsets = wall.StbWallOffsetList; + var curveList = new PolylineCurve[2]; + double thickness = BrepMaker.Wall.GetThickness(_sections, wall); + string[] nodeIds = wall.StbNodeIdOrder.Split(' '); + var wallPts = new List(); + foreach (string nodeId in nodeIds) { - foreach (StbWallOffset offset in offsets) + var offsetVec = new Vector3d(); + if (offsets != null) { - if (nodeId == offset.id_node) + foreach (StbWallOffset offset in offsets) { - offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); - break; + if (nodeId == offset.id_node) + { + offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); + break; + } } } - } - StbNode node = _nodes.First(n => n.id == nodeId); - wallPts.Add(new Point3d(node.X, node.Y, node.Z) + offsetVec); + StbNode node = _nodes.First(n => n.id == nodeId); + wallPts.Add(new Point3d(node.X, node.Y, node.Z) + offsetVec); + } + wallPts.Add(wallPts[0]); + var centerCurve = new PolylineCurve(wallPts); + Vector3d normal = Vector3d.CrossProduct(centerCurve.TangentAtEnd, centerCurve.TangentAtStart); + curveList[0] = new PolylineCurve(wallPts.Select(pt => pt + normal * thickness / 2)); + curveList[1] = new PolylineCurve(wallPts.Select(pt => pt - normal * thickness / 2)); + Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0]); + CheckBrepOrientation(brep); + + brep = ApplyWallOpen(wall.guid, opens, wall, wallPts, brep); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(resultCount, wall.guid, wall.name, brep); + } + catch (Exception e) + { + ConvertFailed(resultCount, wall.guid, wall.name, e); } - wallPts.Add(wallPts[0]); - var centerCurve = new PolylineCurve(wallPts); - Vector3d normal = Vector3d.CrossProduct(centerCurve.TangentAtEnd, centerCurve.TangentAtStart); - curveList[0] = new PolylineCurve(wallPts.Select(pt => pt + normal * thickness / 2)); - curveList[1] = new PolylineCurve(wallPts.Select(pt => pt - normal * thickness / 2)); - Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0]); - CheckBrepOrientation(brep); - - brep = ApplyWallOpen(opens, wall, wallPts, brep); - brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); } + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeStr); return brepList; } + private static void CheckBrepOrientation(Brep brep) { if (brep == null) @@ -372,7 +498,7 @@ private static void CheckBrepOrientation(Brep brep) brep.Faces.SplitKinkyFaces(); } - private Brep ApplyWallOpen(IEnumerable opens, StbWall wall, IReadOnlyList wallPts, Brep brep) + private Brep ApplyWallOpen(string guid, IEnumerable opens, StbWall wall, IReadOnlyList wallPts, Brep brep) { if (brep == null) { @@ -394,7 +520,14 @@ private Brep ApplyWallOpen(IEnumerable opens, StbWall wall, IReadOnlyLi Brep openBrep = Brep.CreateFromLoft(openCurve, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0]); CheckBrepOrientation(openBrep); - brep = Brep.CreateBooleanDifference(brep, openBrep, 1)[0]; + if (openBrep != null) + { + brep = Brep.CreateBooleanDifference(brep, openBrep, 1)[0]; + } + else + { + Logger.AppendWarning(guid, $"開口id:{id}の作成に失敗しました。"); + } } } @@ -424,5 +557,167 @@ private static Point3d[] GetOpenCurvePts(IReadOnlyList wallPts, StbOpen return openCurvePts; } + + public GH_Structure Pile(IEnumerable piles) + { + var typeString = "杭"; + Logger.AppendInfoConvertStartMessage(typeString); + var resultCount = new[] { 0, 0, 0 }; + var brepList = new GH_Structure(); + if (piles == null) + { + Logger.AppendInfoDataNotFoundMessage(typeString); + return brepList; + } + + foreach ((StbPile pile, int i) in piles.Select((pile, index) => (pile, index))) + { + try + { + StbPileKind_structure kind = pile.kind_structure; + StbNode node = _nodes.First(n => n.id == pile.id_node); + var sectionPoints = new List(); + + switch (kind) + { + case StbPileKind_structure.RC: + Point3d[] endNodes = + { + new Point3d(node.X, node.Y, node.Z), + new Point3d(node.X, node.Y, node.Z - pile.length_all) + }; + Point3d[] offset = + { + new Point3d(pile.offset_X, pile.offset_Y, pile.level_top), + new Point3d(pile.offset_X, pile.offset_Y, pile.level_top), + }; + sectionPoints = new List + { + endNodes[0] + offset[0], + new Point3d(), + new Point3d(), + endNodes[1] + offset[1] + }; + sectionPoints[1] = sectionPoints[0] - Vector3d.ZAxis * pile.length_head; + break; + case StbPileKind_structure.PC: + var figures = PCPileFigure.GetFigureList(_sections, pile); + sectionPoints.Add(new Point3d + { + X = node.X + pile.offset_X, + Y = node.Y + pile.offset_Y, + Z = node.Z + pile.level_top + }); + foreach ((PCPileFigure figure, int index) in figures.Select((figure, index) => (figure, index))) + { + sectionPoints.Add(new Point3d + { + X = sectionPoints[index].X, + Y = sectionPoints[index].Y, + Z = sectionPoints[index].Z - figure.Length + }); + } + break; + } + + var brepMaker = new BrepMaker.Pile(_sections, _tolerance, pile.guid); + var brep = brepMaker.CreatePileBrep(pile.id_section, kind, sectionPoints, -Vector3d.ZAxis); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(resultCount, pile.guid, pile.name, brep); + } + catch (Exception e) + { + ConvertFailed(resultCount, pile.guid, pile.name, e); + } + } + + Logger.AppendSummary(resultCount); + Logger.AppendInfoConvertEndMessage(typeString); + return brepList; + } + + public GH_Structure Footing(IEnumerable footings) + { + var typeStr = "フーチング"; + Logger.AppendInfoConvertStartMessage(typeStr); + var convertCount = new[] { 0, 0, 0 }; + var brepList = new GH_Structure(); + if (footings == null) + { + Logger.AppendInfoDataNotFoundMessage(typeStr); + return brepList; + } + + foreach ((StbFooting footing, int i) in footings.Select((f, index) => (f, index))) + { + try + { + StbNode node = _nodes.First(n => n.id == footing.id_node); + Point3d[] endNodes = + { + new Point3d(node.X, node.Y, node.Z), + new Point3d(node.X, node.Y, node.Z + footing.level_bottom) + }; + Point3d[] offset = + { + new Point3d(footing.offset_X, footing.offset_Y, 0), + new Point3d(footing.offset_X, footing.offset_Y, 0), + }; + Point3d[] sectionPoints = + { + endNodes[0] + offset[0], + new Point3d(), + new Point3d(), + endNodes[1] + offset[1] + }; + Vector3d memberAxis = sectionPoints[3] - sectionPoints[0]; + + var brepMaker = new BrepMaker.Footing(_sections, _tolerance, footing.guid); + var brep = brepMaker.CreateFootingBrep(footing.id_section, footing.rotate, sectionPoints, memberAxis / memberAxis.Length); + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); + + ConvertResultCheck(convertCount, footing.guid, footing.name, brep); + } + catch (Exception e) + { + ConvertFailed(convertCount, footing.guid, footing.name, e); + } + } + + Logger.AppendSummary(convertCount); + Logger.AppendInfoConvertEndMessage(typeStr); + return brepList; + } + + private void ConvertResultCheck(int[] resultCount, string guid, string tag, Brep brep) + { + if (brep == null) + { + resultCount[2]++; + Logger.AppendConvertFailed(guid, tag, "Brepへの変換結果がnullです。"); + return; + } + else if (!brep.IsValid) + { + resultCount[1]++; + Logger.AppendConvertWarning(guid, tag, "BrepがInvalidです。Bakeに失敗する可能性があります。"); + return; + } + else + { + resultCount[0]++; + Logger.AppendConvertSuccess(guid, tag); + } + } + + private void ConvertFailed(int[] resultCount, string guid, string tag, Exception e) + { + resultCount[2]++; + Logger.AppendConvertFailed(guid, tag, e.Message); +#if DEBUG + throw e; +#endif + } } } diff --git a/HoaryFox/RH7/Component/Utils/Geometry/PCPileFigure.cs b/HoaryFox/RH7/Component/Utils/Geometry/PCPileFigure.cs new file mode 100644 index 00000000..5f2e8c36 --- /dev/null +++ b/HoaryFox/RH7/Component/Utils/Geometry/PCPileFigure.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +using STBDotNet.v202; + +namespace HoaryFox.Component.Utils.Geometry +{ + public class PCPileFigure : IComparable + { + public int Order { get; private set; } + public double Diameter { get; private set; } + public double Thickness { get; private set; } + public double Length { get; private set; } + + public PCPileFigure(int order, double diameter, double thickness, double length) + { + Order = order; + Diameter = diameter; + Thickness = thickness; + Length = length; + } + + public PCPileFigure(StbSecPileProductNodular_CPRC figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D1; + Thickness = figure.tc; + Length = figure.length_pile; + } + + public PCPileFigure(StbSecPileProductNodular_PRC figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D1; + Thickness = figure.tc; + Length = figure.length_pile; + } + + public PCPileFigure(StbSecPileProductNodular_PHC figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D1; + Thickness = figure.t; + Length = figure.length_pile; + } + + public PCPileFigure(StbSecPileProduct_CPRC figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D; + Thickness = figure.tc; + Length = figure.length_pile; + } + + public PCPileFigure(StbSecPileProduct_PRC figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D; + Thickness = figure.tc; + Length = figure.length_pile; + } + + public PCPileFigure(StbSecPileProduct_PHC figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D; + Thickness = figure.t; + Length = figure.length_pile; + } + + public PCPileFigure(StbSecPileProduct_SC figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D; + Thickness = figure.tc; + Length = figure.length_pile; + } + + public PCPileFigure(StbSecPileProduct_ST figure) + { + Order = int.Parse(figure.id_order); + Diameter = figure.D1; + Thickness = figure.t1; + Length = figure.length_pile; + } + + public int CompareTo(PCPileFigure other) + { + return Order.CompareTo(other.Order); + } + + public static IEnumerable GetFigureList(StbSections sections, StbPile member) + { + var figures = new List(); + var idSection = member.id_section; + + StbSecPileProduct secPileProduct = sections.StbSecPileProduct.First(sec => sec.id == idSection); + return GetFigureList(secPileProduct); + } + + public static List GetFigureList(StbSecPileProduct secPileProduct) + { + var figures = new List(); + var secNodularCPRC = secPileProduct.StbSecFigurePileProduct.StbSecPileProductNodular_CPRC; + if (secNodularCPRC != null) + { + figures.AddRange(secNodularCPRC.Select(figure => new PCPileFigure(figure))); + } + var secNodularPHC = secPileProduct.StbSecFigurePileProduct.StbSecPileProductNodular_PHC; + if (secNodularPHC != null) + { + figures.AddRange(secNodularPHC.Select(figure => new PCPileFigure(figure))); + } + var secNodularPRC = secPileProduct.StbSecFigurePileProduct.StbSecPileProductNodular_PRC; + if (secNodularPRC != null) + { + figures.AddRange(secNodularPRC.Select(figure => new PCPileFigure(figure))); + } + var secCPRC = secPileProduct.StbSecFigurePileProduct.StbSecPileProduct_CPRC; + if (secCPRC != null) + { + figures.AddRange(secCPRC.Select(figure => new PCPileFigure(figure))); + } + var secPHC = secPileProduct.StbSecFigurePileProduct.StbSecPileProduct_PHC; + if (secPHC != null) + { + figures.AddRange(secPHC.Select(figure => new PCPileFigure(figure))); + } + var secPRC = secPileProduct.StbSecFigurePileProduct.StbSecPileProduct_PRC; + if (secPRC != null) + { + figures.AddRange(secPRC.Select(figure => new PCPileFigure(figure))); + } + var secSC = secPileProduct.StbSecFigurePileProduct.StbSecPileProduct_SC; + if (secSC != null) + { + figures.AddRange(secSC.Select(figure => new PCPileFigure(figure))); + } + var secST = secPileProduct.StbSecFigurePileProduct.StbSecPileProduct_ST; + if (secST != null) + { + figures.AddRange(secST.Select(figure => new PCPileFigure(figure))); + } + + figures.Sort(); + return figures; + } + } +} diff --git a/HoaryFox/RH7/Component/Utils/Geometry/SectionCornerPoints.cs b/HoaryFox/RH7/Component/Utils/Geometry/SectionCornerPoints.cs index 1baebdab..9cf4b845 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/SectionCornerPoints.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/SectionCornerPoints.cs @@ -48,16 +48,51 @@ public static Point3d[] ColumnH(Point3d pt, double height, double width, double }; } - public static Point3d[] ColumnL(Point3d pt, double height, double width, double tw, double tf, StbSecRollLType type, Vector3d xAxis, Vector3d yAxis) + // 5 - - - - - 4 + // Y 6 - 7 2 - 3 + // ^ | o | + // o > X 0 - 1 + public static Point3d[] ColumnT(Point3d pt, double height, double width, double tw, double tf, Vector3d xAxis, Vector3d yAxis) + { + return new[] + { + pt - xAxis * tw - yAxis * height / 2, + pt + xAxis * tw - yAxis * height / 2, + pt + xAxis * tw + yAxis * (height / 2 - tf), + pt + xAxis * width + yAxis * (height / 2 - tf), + pt + xAxis * width + yAxis * height / 2, + pt - xAxis * width + yAxis * height / 2, + pt - xAxis * width + yAxis * (height / 2 - tf), + pt - xAxis * tw + yAxis * (height / 2 - tf), + }; + } + + // TODO: 重心位置をちゃんと計算する + // 今は バウンディングボックスの図心 = STBの節点位置 になっている。 + // 7 - - 6 + // | 4 - 5 + // Y | | o + // ^ | 3 - 2 + // o > X 0 - - 1 + public static Point3d[] ColumnC(Point3d pt, double height, double width, double tw, double tf, StbSecRollCType type, Vector3d xAxis, Vector3d yAxis) { switch (type) { - case StbSecRollLType.SINGLE: - return ColumnLSingle(pt, height, width, tw, tf, xAxis, yAxis); - case StbSecRollLType.BACKTOBACK: - return ColumnLBackToBack(pt, height, width, tw, tf, xAxis, yAxis); - case StbSecRollLType.FACETOFACE: - return ColumnLFaceToFace(pt, height, width, tw, tf, xAxis, yAxis); + case StbSecRollCType.SINGLE: + return new[] + { + pt - xAxis * width / 2 - yAxis * height / 2, + pt + xAxis * width / 2 - yAxis * height / 2, + pt + xAxis * width / 2 - yAxis * (height / 2 - tf), + pt - xAxis * (width / 2 - tw) - yAxis * (height / 2 - tf), + pt - xAxis * (width / 2 - tw) + yAxis * (height / 2 - tf), + pt + xAxis * width / 2 + yAxis * (height / 2 - tf), + pt + xAxis * width / 2 + yAxis * height / 2, + pt - xAxis * width / 2 + yAxis * height / 2, + }; + case StbSecRollCType.BACKTOBACK: + return ColumnH(pt, height, width, 2 * tw, tf, xAxis, yAxis); + case StbSecRollCType.FACETOFACE: default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } @@ -69,32 +104,28 @@ public static Point3d[] ColumnL(Point3d pt, double height, double width, double // Y | 2 - 3 // ^ | | o // o > X 0 1 - private static Point3d[] ColumnLSingle(Point3d pt, double height, double width, double tw, double tf, Vector3d xAxis, Vector3d yAxis) + public static Point3d[] ColumnL(Point3d pt, double height, double width, double tw, double tf, StbSecRollLType type, Vector3d xAxis, Vector3d yAxis) { - return new[] + switch (type) { - pt - xAxis * width / 2 - yAxis * height / 2, - pt - xAxis * (width / 2 - tw) - yAxis * height / 2, - pt - xAxis * (width / 2 - tw) + yAxis * (height / 2 - tf), - pt + xAxis * width / 2 + yAxis * (height / 2 - tf), - pt + xAxis * width / 2 + yAxis * height / 2, - pt - xAxis * width / 2 + yAxis * height / 2, - pt - xAxis * width / 2 - yAxis * height / 2, - }; - } - - // 5 - - - - - 4 - // Y 6 - 7 2 - 3 - // ^ | o | - // o > X 0 - 1 - private static Point3d[] ColumnLBackToBack(Point3d pt, double height, double width, double tw, double tf, Vector3d xAxis, Vector3d yAxis) - { - throw new NotImplementedException(); - } - - private static Point3d[] ColumnLFaceToFace(Point3d pt, double height, double width, double tw, double tf, Vector3d xAxis, Vector3d yAxis) - { - throw new NotImplementedException(); + case StbSecRollLType.SINGLE: + return new[] + { + pt - xAxis * width / 2 - yAxis * height / 2, + pt - xAxis * (width / 2 - tw) - yAxis * height / 2, + pt - xAxis * (width / 2 - tw) + yAxis * (height / 2 - tf), + pt + xAxis * width / 2 + yAxis * (height / 2 - tf), + pt + xAxis * width / 2 + yAxis * height / 2, + pt - xAxis * width / 2 + yAxis * height / 2, + pt - xAxis * width / 2 - yAxis * height / 2, + }; + case StbSecRollLType.BACKTOBACK: + return ColumnT(pt, height, 2 * width, 2 * tw, tf, xAxis, yAxis); + case StbSecRollLType.FACETOFACE: + return ColumnC(pt, 2 * width, height, tf, tw, StbSecRollCType.SINGLE, -yAxis, xAxis); + default: + throw new ArgumentOutOfRangeException(nameof(type), type, null); + } } internal static Curve ColumnPipe(Point3d pt, double radius, Vector3d zAxis) @@ -143,16 +174,50 @@ public static Point3d[] BeamH(Point3d pt, double height, double width, double tw }; } - public static Point3d[] BeamL(Point3d pt, double height, double width, double tw, double tf, StbSecRollLType type, Vector3d yAxis, Vector3d zAxis) + // 5 - - o - - 4 + // Y 6 - 7 2 - 3 + // ^ | | + // o > X 0 - 1 + public static Point3d[] BeamT(Point3d pt, double height, double width, double tw, double tf, Vector3d xAxis, Vector3d yAxis) + { + return new[] + { + pt - xAxis * tw - yAxis * height, + pt + xAxis * tw - yAxis * height, + pt + xAxis * tw + yAxis * (height - tf), + pt + xAxis * width + yAxis * (height - tf), + pt + xAxis * width + yAxis * height, + pt - xAxis * width + yAxis * height, + pt - xAxis * width + yAxis * (height - tf), + pt - xAxis * tw + yAxis * (height - tf), + }; + } + + // TODO: 原点はここでよい? + // 7 - o - 6 + // | 4 - - 5 + // Z | | + // ^ | 3 - - 2 + // o > Y 0 - - - 1 + public static Point3d[] BeamC(Point3d pt, double height, double width, double tw, double tf, StbSecRollCType type, Vector3d yAxis, Vector3d zAxis) { switch (type) { - case StbSecRollLType.SINGLE: - return BeamLSingle(pt, height, width, tw, tf, yAxis, zAxis); - case StbSecRollLType.BACKTOBACK: - return BeamLBackToBack(pt, height, width, tw, tf, yAxis, zAxis); - case StbSecRollLType.FACETOFACE: - return BeamLFaceToFace(pt, height, width, tw, tf, yAxis, zAxis); + case StbSecRollCType.SINGLE: + return new[] + { + pt - yAxis * width / 2 - zAxis * height, + pt + yAxis * width / 2 - zAxis * height, + pt + yAxis * width / 2 - zAxis * (height - tf), + pt - yAxis * (width / 2 - tw) - zAxis * (height - tf), + pt - yAxis * (width / 2 - tw) + zAxis * (height - tf), + pt + yAxis * width / 2 + zAxis * (height - tf), + pt + yAxis * width / 2, + pt - yAxis * width / 2, + }; + case StbSecRollCType.BACKTOBACK: + return BeamH(pt, height, width, 2 * tw, tf, yAxis, yAxis); + case StbSecRollCType.FACETOFACE: default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } @@ -163,39 +228,30 @@ public static Point3d[] BeamL(Point3d pt, double height, double width, double tw // Z | 2 - - 3 // ^ | | // o > Y 0 1 - private static Point3d[] BeamLSingle(Point3d pt, double height, double width, double tw, double tf, Vector3d yAxis, Vector3d zAxis) + public static Point3d[] BeamL(Point3d pt, double height, double width, double tw, double tf, StbSecRollLType type, Vector3d yAxis, Vector3d zAxis) { - return new[] + switch (type) { - pt - yAxis * width / 2 - zAxis * height, - pt - yAxis * (width / 2 - tw) - zAxis * height, - pt - yAxis * (width / 2 - tw) - zAxis * tf, - pt + yAxis * width / 2 - zAxis * tf, - pt + yAxis * width / 2, - pt - yAxis * width / 2, - pt - yAxis * width / 2 - zAxis * height - }; - } - - // 5 - - o - - 4 - // Z 6 - 7 2 - 3 - // ^ | | - // o > Y 0 - 1 - private static Point3d[] BeamLBackToBack(Point3d pt, double height, double width, double tw, double tf, Vector3d yAxis, Vector3d zAxis) - { - throw new NotImplementedException(); - } - - // 7 - - o - - 6 - // Z | 2 - 3 | - // ^ | | | | - // o > Y 0 - 1 4 - 5 - private static Point3d[] BeamLFaceToFace(Point3d pt, double height, double width, double tw, double tf, Vector3d yAxis, Vector3d zAxis) - { - throw new NotImplementedException(); + case StbSecRollLType.SINGLE: + return new[] + { + pt - yAxis * width / 2 - zAxis * height, + pt - yAxis * (width / 2 - tw) - zAxis * height, + pt - yAxis * (width / 2 - tw) - zAxis * tf, + pt + yAxis * width / 2 - zAxis * tf, + pt + yAxis * width / 2, + pt - yAxis * width / 2, + pt - yAxis * width / 2 - zAxis * height + }; + case StbSecRollLType.BACKTOBACK: + return BeamT(pt, height, width, tw, tf, yAxis, zAxis); + case StbSecRollLType.FACETOFACE: + return BeamC(pt, 2 * width, height, tf, tw, StbSecRollCType.SINGLE, -zAxis, yAxis); + default: + throw new ArgumentOutOfRangeException(nameof(type), type, null); + } } - internal static Curve BeamPipe(Point3d pt, double radius, Vector3d xAxis) { var centerPt = new Point3d(pt.X, pt.Y, pt.Z - radius); diff --git a/HoaryFox/RH7/Component/Utils/Geometry/SectionCurve.cs b/HoaryFox/RH7/Component/Utils/Geometry/SectionCurve.cs index bcd47877..0c2b6ef7 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) @@ -35,7 +33,7 @@ public static SectionCurve CreateSolidColumnCircle(Point3d sectionPoint, double { return new SectionCurve { - OuterCurve = SectionCornerPoints.ColumnPipe(sectionPoint, diameter, xAxis), + OuterCurve = SectionCornerPoints.ColumnPipe(sectionPoint, diameter / 2, xAxis), InnerCurve = null, Shape = SectionShape.Circle, Type = SectionType.Solid, @@ -43,6 +41,20 @@ public static SectionCurve CreateSolidColumnCircle(Point3d sectionPoint, double }; } + public static SectionCurve CreateSolidColumnPipe(Point3d sectionPoint, double outerDiameter, double innerDiameter, Vector3d xAxis) + { + return new SectionCurve + { + OuterCurve = SectionCornerPoints.ColumnPipe(sectionPoint, outerDiameter / 2, xAxis), + InnerCurve = outerDiameter != innerDiameter + ? SectionCornerPoints.ColumnPipe(sectionPoint, innerDiameter / 2, xAxis) + : null, + Shape = SectionShape.Circle, + Type = SectionType.Solid, + XAxis = xAxis, + }; + } + public static SectionCurve CreateSolidBeamRect(Point3d sectionPoint, double depth, double width, Vector3d[] localAxis) { return new SectionCurve() diff --git a/HoaryFox/RH7/Component/Utils/Geometry/SectionShape.cs b/HoaryFox/RH7/Component/Utils/Geometry/SectionShape.cs index 0ab08efa..86cab545 100644 --- a/HoaryFox/RH7/Component/Utils/Geometry/SectionShape.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/SectionShape.cs @@ -4,10 +4,13 @@ public enum SectionShape { Box, H, + T, Pipe, L, Rectangle, Circle, + C, + LipC, Other, } } diff --git a/HoaryFox/RH7/Component/Utils/TagUtils.cs b/HoaryFox/RH7/Component/Utils/TagUtils.cs index 6546163a..8d237259 100644 --- a/HoaryFox/RH7/Component/Utils/TagUtils.cs +++ b/HoaryFox/RH7/Component/Utils/TagUtils.cs @@ -294,10 +294,10 @@ internal static IEnumerable GetWallRcSection(StbSecWall_RC_Straight f public static Dictionary[][] GetAllSectionInfoArray(StbMembers members, StbSections sections) { - var allTagList = new Dictionary[7][]; + var allTagList = new Dictionary[9][]; - var memberArray = new object[][] { members.StbColumns, members.StbGirders, members.StbPosts, members.StbBeams, members.StbBraces, members.StbSlabs, members.StbWalls }; - for (var i = 0; i < 7; i++) + var memberArray = new object[][] { members.StbColumns, members.StbGirders, members.StbPosts, members.StbBeams, members.StbBraces, members.StbSlabs, members.StbWalls, members.StbPiles, members.StbFootings }; + for (var i = 0; i < 9; i++) { allTagList[i] = memberArray[i] != null ? StbMembersToDictArray(memberArray[i], sections) : Array.Empty>(); } diff --git a/HoaryFox/RH7/HoaryFoxRH7.csproj b/HoaryFox/RH7/HoaryFoxRH7.csproj index dd9b4489..01162241 100644 --- a/HoaryFox/RH7/HoaryFoxRH7.csproj +++ b/HoaryFox/RH7/HoaryFoxRH7.csproj @@ -1,7 +1,7 @@  net48 - 2.3.0 + 2.4.0 HoaryFox This Component read ST-Bridge file(.stb) and display its model data. .gha diff --git a/HoaryFox/RH7/HoaryFoxRH7Info.cs b/HoaryFox/RH7/HoaryFoxRH7Info.cs index 97e678a0..bcb5eac2 100644 --- a/HoaryFox/RH7/HoaryFoxRH7Info.cs +++ b/HoaryFox/RH7/HoaryFoxRH7Info.cs @@ -8,15 +8,19 @@ namespace HoaryFox public class HoaryFoxRH7Info : GH_AssemblyInfo { public override string Name => "HoaryFox"; - public override Bitmap Icon => HoaryFoxCommon.Properties.Resource.InfoIcon; - public override string Description => "This Component read ST-Bridge file(.stb) and display its model data."; - public override Guid Id => new Guid("093de648-746b-4b0b-85ef-495c6fb4514f"); - public override string AuthorName => "hrntsm"; - public override string AuthorContact => "contact@hrntsm.com"; } + + public class HoaryFoxCategoryIcon : GH_AssemblyPriority + { + public override GH_LoadingInstruction PriorityLoad() + { + Grasshopper.Instances.ComponentServer.AddCategoryIcon("HoaryFox", HoaryFoxCommon.Properties.Resource.InfoIcon); + return GH_LoadingInstruction.Proceed; + } + } } diff --git a/KarambaConnect/RH6K1/karambaConnectRH6K1.csproj b/KarambaConnect/RH6K1/karambaConnectRH6K1.csproj index 7c5c4f8b..2dac9405 100644 --- a/KarambaConnect/RH6K1/karambaConnectRH6K1.csproj +++ b/KarambaConnect/RH6K1/karambaConnectRH6K1.csproj @@ -2,7 +2,7 @@ net48 - 2.3.0 + 2.4.0 karambaConnect HoaryFox karamba connect extension .gha diff --git a/KarambaConnect/RH6K2/karambaConnectRH6K2.csproj b/KarambaConnect/RH6K2/karambaConnectRH6K2.csproj index 1f8fdfab..6a5a059b 100644 --- a/KarambaConnect/RH6K2/karambaConnectRH6K2.csproj +++ b/KarambaConnect/RH6K2/karambaConnectRH6K2.csproj @@ -2,7 +2,7 @@ net48 - 2.3.0 + 2.4.0 karambaConnect HoaryFox karamba connect extension .gha diff --git a/KarambaConnect/RH7K1/karambaConnectRH7K1.csproj b/KarambaConnect/RH7K1/karambaConnectRH7K1.csproj index 8f542293..c51fcda7 100644 --- a/KarambaConnect/RH7K1/karambaConnectRH7K1.csproj +++ b/KarambaConnect/RH7K1/karambaConnectRH7K1.csproj @@ -2,7 +2,7 @@ net48 - 2.3.0 + 2.4.0 karambaConnect HoaryFox karamba connect extension .gha diff --git a/KarambaConnect/RH7K2/karambaConnectRH7K2.csproj b/KarambaConnect/RH7K2/karambaConnectRH7K2.csproj index 99de7030..9a1f6b0d 100644 --- a/KarambaConnect/RH7K2/karambaConnectRH7K2.csproj +++ b/KarambaConnect/RH7K2/karambaConnectRH7K2.csproj @@ -2,7 +2,7 @@ net48 - 2.3.0 + 2.4.0 karambaConnect HoaryFox karamba connect extension .gha diff --git a/README(JP).md b/README(JP).md index 233d47db..46aa2ed3 100644 --- a/README(JP).md +++ b/README(JP).md @@ -10,7 +10,6 @@ HoaryFox は 建築構造架構の可視化ツールです。 ST-Bridge file(.stb) を読み込んで、表示をします。 対応するデータの形式を一貫構造計算ソフトから出力されてる stb データとすることで、使用しているソフトに限らずモデルの生成ができ、かつ可視化用に別途モデリングする必要がないことが特徴です。 -Rhino を使わないスタンドアロンのビューアが必要な場合は [STEVIA](https://github.com/hrntsm/STEVIA-Stb2U/wiki) を使ってみてください。 モデルを Karamba3D へ変換する機能、および Karamba3D のモデルを ST-Bridge データとして出力する機能を追加しました。 ## Install @@ -67,9 +66,9 @@ ST-Bridge の規格を作成している [building SMART Japan の構造設計 [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G5C2MIU) -上記、または [PixivFANBOX](https://hiron.fanbox.cc/) よりドネートしていただけると開発のモチベーションが上がります。 +上記よりドネートしていただけると開発のモチベーションが上がります。 ## License HoaryFox is licensed under the [MIT](https://github.com/hrntsm/HoaryFox/blob/master/LICENSE) license. -Copyright© 2019-2021, hrntsm +Copyright© 2019-2023, hrntsm diff --git a/README.md b/README.md index 2d677185..4b7be689 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,11 @@ [![Release](https://img.shields.io/github/v/release/hrntsm/HoaryFox)](https://github.com/hrntsm/HoaryFox/releases) [![download](https://img.shields.io/github/downloads/hrntsm/HoaryFox/total)](https://github.com/hrntsm/HoaryFox/releases) -![Build](https://img.shields.io/github/workflow/status/hrntsm/HoaryFox/Build%20Grasshopper%20Plugin) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/c0a462728dce4983802d447ed67d3e7c)](https://www.codacy.com/gh/hrntsm/HoaryFox/dashboard?utm_source=github.com&utm_medium=referral&utm_content=hrntsm/HoaryFox&utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/bc78a575fcf5e9448929/maintainability)](https://codeclimate.com/github/hrntsm/HoaryFox/maintainability) Grasshopper Component which read ST-Bridge file(.stb) and display its model information. You can easily check frames and present structure frame!! -If you need stand-alone ST-Bridge file viewer, Please see [STEVIA](https://github.com/hrntsm/STEVIA-Stb2U/wiki) As a experimental function, it creates an analytical model of Karamba from st-bridge data. ## Install @@ -34,8 +32,8 @@ If you need more information, send direct message to my twitter account. Conversion of data into Karamba3D supports only beam elements. Mesh elements such as floor and wall are not supported. -L-type and C-type cross-sections are replaced by rectangular cross-sections with equivalent axial cross-sections because Karamba3D does not support them. -Output is STB2.0. +L-type and C-type cross-sections are replaced by rectangular cross-sections with equivalent axial cross-sections because Karamba3D does not support them. +Output is only STB2.0 supported. ## What is ST-Bridge @@ -62,9 +60,7 @@ If you like this software, please donation. [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G5C2MIU) -Or [pixivFANBOX](https://hiron.fanbox.cc/) - ## License HoaryFox is licensed under the [MIT](https://github.com/hrntsm/HoaryFox/blob/master/LICENSE) license. -Copyright© 2019-2021, hrntsm +Copyright© 2019-2023, hrntsm diff --git a/website/docs/Changelog.md b/website/docs/Changelog.md index 16ec8488..2d687f0f 100644 --- a/website/docs/Changelog.md +++ b/website/docs/Changelog.md @@ -5,6 +5,28 @@ title: Changelog --- +## [v2.4.0 - 2023-06-11](https://github.com/hrntsm/HoaryFox/releases/tag/v2.4.0) + +### 追加 + +- S2Lコンポーネント + - 杭の可視化対応 + - 節点のオフセットの有無を反映するboolの追加 +- S2Bコンポーネント + - S杭を除く杭の可視化 + - 矩形のフーチングの可視化 + - 変換結果のログ出力と保存 + - 鉄骨のT断面、C断面、L断面の背中合わせ、顔合わせに対応 + - CFT断面の出力 + +### 変更 + +- これまで1つでもエラーがあると変換結果が出力されなかったが、変換エラーの情報をログに記載して、それ以外は出力されるようにした。 + +### 修正 + +- ハンチのある梁のハンチ長がこれまではジョイント長で作成されていたため、ハンチ長で作成するようにした。 + ## [v2.3.0 - 2022-10-15](https://github.com/hrntsm/HoaryFox/releases/tag/v2.3.0) ### 追加 diff --git a/website/docs/Component/Geometry.md b/website/docs/Component/Geometry.md index 435856be..10d8d724 100644 --- a/website/docs/Component/Geometry.md +++ b/website/docs/Component/Geometry.md @@ -13,19 +13,25 @@ title: Geometry 部材を Line で表示する -|入力|説明| -|---|:---:| -|Data|Load STB file コンポーネントの Data 出力を入力| -|Bake|各 Line を断面符号ごとにレイヤー分けして Bake する| - -|出力|説明| -|---|:---:| -|Nodes| 節点の Point3d のリストを出力| -|Columns| 柱の Line のツリーを出力| -|Girders| 大梁の Line のツリーを出力| -|Posts| 間柱の Line のツリーを出力| -|Beams| 小梁の Line のツリーを出力| -|Braces| ブレースの Line のツリーを出力| +| 入力 | 説明 | +| ---------- | :------------------------------------------------: | +| Data | Load STB file コンポーネントの Data 出力を入力 | +| OffsetNode | 部材端部のオフセットの考慮の有無 | +| Bake | 各 Line を断面符号ごとにレイヤー分けして Bake する | + +| 出力 | 説明 | +| ------- | :----------------------------: | +| Nodes | 節点の Point3d のリストを出力 | +| Columns | 柱の Line のツリーを出力 | +| Girders | 大梁の Line のツリーを出力 | +| Posts | 間柱の Line のツリーを出力 | +| Beams | 小梁の Line のツリーを出力 | +| Braces | ブレースの Line のツリーを出力 | +| Piles | 杭の Line のツリーを出力 | + +### 備考 + +- 杭についてはオフセットの有無で杭長が変わらないように出力しているため、オフセットを False にした場合、杭先端がオフセット分だけ異なる位置に表示されます。 --- @@ -35,25 +41,32 @@ title: Geometry 部材を Brep で表示する -|入力|説明| -|---|:---:| -|Data|Load STB file コンポーネントの Data 出力を入力| -|Bake|各 Brep を断面符号ごとにレイヤー分けして Bake する| - -|出力|説明| -|---|:---:| -|Columns| 柱形状を表す Brep のツリーを出力| -|Girders| 大梁形状を表す Brep のツリーを出力| -|Posts| 間柱形状を表す Brep のツリーを出力| -|Beams| 小梁形状を表す Brep のツリーを出力| -|Braces| ブレース形状を表す Brep のツリーを出力| -|Slabs| スラブ形状を表す Brep のツリーを出力| -|Walls| 壁形状を表す Brep のツリーを出力| +| 入力 | 説明 | +| ---- | :------------------------------------------------: | +| Data | Load STB file コンポーネントの Data 出力を入力 | +| Bake | 各 Brep を断面符号ごとにレイヤー分けして Bake する | + +| 出力 | 説明 | +| -------- | :--------------------------------------: | +| Log | 変換結果のログ出力 | +| Columns | 柱形状を表す Brep のツリーを出力 | +| Girders | 大梁形状を表す Brep のツリーを出力 | +| Posts | 間柱形状を表す Brep のツリーを出力 | +| Beams | 小梁形状を表す Brep のツリーを出力 | +| Braces | ブレース形状を表す Brep のツリーを出力 | +| Slabs | スラブ形状を表す Brep のツリーを出力 | +| Walls | 壁形状を表す Brep のツリーを出力 | +| Piles | 杭形状を表す Brep のツリーを出力 | +| Footings | フーチング形状を表す Brep のツリーを出力 | ### 表示仕様 -- 床、壁の開口は反映されません。 +- Log は GH コンポーネントと同じフォルダに変換ごとにファイルとして保存されます。 +- 床の開口は反映されません。 - 平面でないスラブでは近似した面を張るため処理が重い場合があります。 +- SRC,CFT は S と RC を一体化した一つの Brep として作成されます。 +- C 断面の背中合わせは H 型、顔合わせはボックス型として出力されます。 +- L 断面の背中合わせは T 型、顔合わせは C 型として出力されます。 --- @@ -63,12 +76,12 @@ title: Geometry 階と軸をラインで表示する -|入力|説明| -|---|:---:| -|Data|Load STB file コンポーネントの Data 出力を入力| -|Factor|軸線の長さの比率| -|Size|軸名、階名の文字のサイズ。デフォルトは 12| +| 入力 | 説明 | +| ------ | :--------------------------------------------: | +| Data | Load STB file コンポーネントの Data 出力を入力 | +| Factor | 軸線の長さの比率 | +| Size | 軸名、階名の文字のサイズ。デフォルトは 12 | -|出力|説明| -|---|:---:| -|Axis| 軸と階を示す Line の出力| \ No newline at end of file +| 出力 | 説明 | +| ---- | :----------------------: | +| Axis | 軸と階を示す Line の出力 | diff --git a/website/images/Component/StbToBrep.png b/website/images/Component/StbToBrep.png index f0b6d2b5..0619c62e 100644 Binary files a/website/images/Component/StbToBrep.png and b/website/images/Component/StbToBrep.png differ diff --git a/website/images/Component/StbToLine.png b/website/images/Component/StbToLine.png index 9f44f0d6..b9eb54b7 100644 Binary files a/website/images/Component/StbToLine.png and b/website/images/Component/StbToLine.png differ diff --git a/website/package-lock.json b/website/package-lock.json index 405e7cf9..3e99bc2e 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -1,12 +1,12 @@ { "name": "hoaryfox-website", - "version": "2.1.1", + "version": "2.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "hoaryfox-website", - "version": "2.1.1", + "version": "2.3.0", "dependencies": { "@docusaurus/core": "2.0.0-beta.17", "@docusaurus/preset-classic": "2.0.0-beta.17", @@ -2748,9 +2748,9 @@ } }, "node_modules/@sideway/formula": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", - "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" }, "node_modules/@sideway/pinpoint": { "version": "2.0.0", @@ -3450,9 +3450,9 @@ } }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "bin": { "acorn": "bin/acorn" }, @@ -3751,9 +3751,9 @@ } }, "node_modules/babel-loader/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dependencies": { "minimist": "^1.2.0" }, @@ -3762,9 +3762,9 @@ } }, "node_modules/babel-loader/node_modules/loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -5503,9 +5503,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz", - "integrity": "sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", + "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -6785,9 +6785,9 @@ } }, "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "node_modules/http-deceiver": { "version": "1.2.7", @@ -7460,11 +7460,6 @@ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -7476,12 +7471,9 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dependencies": { - "minimist": "^1.2.5" - }, + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "bin": { "json5": "lib/cli.js" }, @@ -7573,9 +7565,9 @@ } }, "node_modules/loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -9524,9 +9516,9 @@ } }, "node_modules/react-dev-utils/node_modules/loader-utils": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.0.tgz", - "integrity": "sha512-HVl9ZqccQihZ7JM85dco1MvO9G+ONvxoGa9rkhzFsneGLKSUg1gJf9bWzhRhcvm2qChhWpebQhP44qxjKIUCaQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", + "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==", "engines": { "node": ">= 12.13.0" } @@ -9784,25 +9776,14 @@ } }, "node_modules/recursive-readdir": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", - "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dependencies": { - "minimatch": "3.0.4" + "minimatch": "^3.0.5" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/recursive-readdir/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "node": ">=6.0.0" } }, "node_modules/regenerate": { @@ -10543,15 +10524,15 @@ } }, "node_modules/serve-handler": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.3.tgz", - "integrity": "sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.5.tgz", + "integrity": "sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==", "dependencies": { "bytes": "3.0.0", "content-disposition": "0.5.2", "fast-url-parser": "1.1.3", "mime-types": "2.1.18", - "minimatch": "3.0.4", + "minimatch": "3.1.2", "path-is-inside": "1.0.2", "path-to-regexp": "2.2.1", "range-parser": "1.2.0" @@ -10576,17 +10557,6 @@ "node": ">= 0.6" } }, - "node_modules/serve-handler/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/serve-handler/node_modules/path-to-regexp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", @@ -11312,9 +11282,9 @@ } }, "node_modules/ua-parser-js": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", - "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", + "version": "0.7.33", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", + "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==", "funding": [ { "type": "opencollective", @@ -11880,9 +11850,9 @@ } }, "node_modules/watchpack": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", - "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -11914,33 +11884,33 @@ "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" }, "node_modules/webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.76.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", + "integrity": "sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==", "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^0.0.51", "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/wasm-edit": "1.11.1", "@webassemblyjs/wasm-parser": "1.11.1", - "acorn": "^8.4.1", + "acorn": "^8.7.1", "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.9.2", + "enhanced-resolve": "^5.10.0", "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.9", - "json-parse-better-errors": "^1.0.2", + "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.1.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.3.1", + "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, "bin": { @@ -14579,9 +14549,9 @@ } }, "@sideway/formula": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", - "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" }, "@sideway/pinpoint": { "version": "2.0.0", @@ -15139,9 +15109,9 @@ } }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==" }, "acorn-import-assertions": { "version": "1.8.0", @@ -15361,17 +15331,17 @@ }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "requires": { "minimist": "^1.2.0" } }, "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "requires": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -16640,9 +16610,9 @@ } }, "enhanced-resolve": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz", - "integrity": "sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", + "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", "requires": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -17588,9 +17558,9 @@ } }, "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "http-deceiver": { "version": "1.2.7", @@ -18040,11 +18010,6 @@ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" - }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -18056,12 +18021,9 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" }, "jsonfile": { "version": "6.1.0", @@ -18124,9 +18086,9 @@ "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==" }, "loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "requires": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -19474,9 +19436,9 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "loader-utils": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.0.tgz", - "integrity": "sha512-HVl9ZqccQihZ7JM85dco1MvO9G+ONvxoGa9rkhzFsneGLKSUg1gJf9bWzhRhcvm2qChhWpebQhP44qxjKIUCaQ==" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", + "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==" }, "locate-path": { "version": "6.0.0", @@ -19668,21 +19630,11 @@ } }, "recursive-readdir": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", - "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "requires": { - "minimatch": "3.0.4" - }, - "dependencies": { - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - } + "minimatch": "^3.0.5" } }, "regenerate": { @@ -20250,15 +20202,15 @@ } }, "serve-handler": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.3.tgz", - "integrity": "sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.5.tgz", + "integrity": "sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==", "requires": { "bytes": "3.0.0", "content-disposition": "0.5.2", "fast-url-parser": "1.1.3", "mime-types": "2.1.18", - "minimatch": "3.0.4", + "minimatch": "3.1.2", "path-is-inside": "1.0.2", "path-to-regexp": "2.2.1", "range-parser": "1.2.0" @@ -20277,14 +20229,6 @@ "mime-db": "~1.33.0" } }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, "path-to-regexp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", @@ -20819,9 +20763,9 @@ "peer": true }, "ua-parser-js": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", - "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==" + "version": "0.7.33", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", + "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==" }, "unherit": { "version": "1.1.3", @@ -21188,9 +21132,9 @@ } }, "watchpack": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", - "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", "requires": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -21215,33 +21159,33 @@ "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" }, "webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.76.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", + "integrity": "sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==", "requires": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^0.0.51", "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/wasm-edit": "1.11.1", "@webassemblyjs/wasm-parser": "1.11.1", - "acorn": "^8.4.1", + "acorn": "^8.7.1", "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.9.2", + "enhanced-resolve": "^5.10.0", "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.9", - "json-parse-better-errors": "^1.0.2", + "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.1.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.3.1", + "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" } }, diff --git a/website/package.json b/website/package.json index a36f11ee..c305fc34 100644 --- a/website/package.json +++ b/website/package.json @@ -1,6 +1,6 @@ { "name": "hoaryfox-website", - "version": "2.3.0", + "version": "2.4.0", "private": true, "scripts": { "docusaurus": "docusaurus",