From d7d4ba5f1b3ed20ff5123fb6af8154189bfa112b Mon Sep 17 00:00:00 2001 From: hiron Date: Mon, 23 Aug 2021 22:45:56 +0900 Subject: [PATCH 01/12] Add WallNameTag --- HoaryFox/Component/Tag/Name/WallNameTag.cs | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 HoaryFox/Component/Tag/Name/WallNameTag.cs diff --git a/HoaryFox/Component/Tag/Name/WallNameTag.cs b/HoaryFox/Component/Tag/Name/WallNameTag.cs new file mode 100644 index 00000000..938d270c --- /dev/null +++ b/HoaryFox/Component/Tag/Name/WallNameTag.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Grasshopper.Kernel; +using Rhino.Geometry; +using STBDotNet.v202; + +namespace HoaryFox.Component.Tag.Name +{ + public class WallNameTag : GH_Component + { + private ST_BRIDGE _stBridge; + private int _size; + + private readonly List _frameName = new List(); + private readonly List _framePos = new List(); + + public override bool IsPreviewCapable => true; + public WallNameTag() + : base("Wall Name Tag", "WallTag", + "Display Wall Name Tag", + "HoaryFox", "NameTag") + { + } + + public override void ClearData() + { + base.ClearData(); + _frameName.Clear(); + _framePos.Clear(); + } + + protected override void RegisterInputParams(GH_InputParamManager pManager) + { + pManager.AddGenericParameter("Data", "D", "input ST-Bridge file data", GH_ParamAccess.item); + pManager.AddIntegerParameter("Size", "S", "Tag size", GH_ParamAccess.item, 12); + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) + { + pManager.AddTextParameter("NameTag", "NTag", "output name tag", GH_ParamAccess.list); + } + + protected override void SolveInstance(IGH_DataAccess dataAccess) + { + if (!dataAccess.GetData("Data", ref _stBridge)) { return; } + if (!dataAccess.GetData("Size", ref _size)) { return; } + + StbNode[] nodes = _stBridge.StbModel.StbNodes; + StbWall[] walls = _stBridge.StbModel.StbMembers.StbWalls; + foreach (StbWall wall in walls) + { + _frameName.Add(wall.name); + + string[] nodeIds = wall.StbNodeIdOrder.Split(' '); + var pts = new Point3d[nodeIds.Length]; + for (int i = 0; i < nodeIds.Length; i++) + { + string nodeId = nodeIds[i]; + StbNode node = nodes.First(n => n.id == nodeId); + pts[i] = new Point3d(node.X, node.Y, node.Z); + } + _framePos.Add(new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z))); + } + dataAccess.SetDataList(0, _frameName); + } + + public override void DrawViewportWires(IGH_PreviewArgs args) + { + for (var i = 0; i < _frameName.Count; i++) + { + args.Display.Draw2dText(_frameName[i], Color.Black, _framePos[i], true, _size); + } + } + + protected override Bitmap Icon => null; + + public override Guid ComponentGuid => new Guid("713d1503-eebd-4504-83f0-ddd072a11188"); + } +} From b96423a7d8d03ed3038a719d1662654751a1b079 Mon Sep 17 00:00:00 2001 From: hiron Date: Tue, 24 Aug 2021 22:48:26 +0900 Subject: [PATCH 02/12] Add SlabNameTag --- HoaryFox/Component/Tag/Name/SlabNameTag.cs | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 HoaryFox/Component/Tag/Name/SlabNameTag.cs diff --git a/HoaryFox/Component/Tag/Name/SlabNameTag.cs b/HoaryFox/Component/Tag/Name/SlabNameTag.cs new file mode 100644 index 00000000..fc810a42 --- /dev/null +++ b/HoaryFox/Component/Tag/Name/SlabNameTag.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Grasshopper.Kernel; +using Rhino.Geometry; +using STBDotNet.v202; + +namespace HoaryFox.Component.Tag.Name +{ + public class SlabNameTag : GH_Component + { + private ST_BRIDGE _stBridge; + private int _size; + + private readonly List _plateName = new List(); + private readonly List _platePos = new List(); + + public override bool IsPreviewCapable => true; + public SlabNameTag() + : base("Slab Name Tag", "SlabTag", + "Display Slab Name Tag", + "HoaryFox", "NameTag") + { + } + + public override void ClearData() + { + base.ClearData(); + _plateName.Clear(); + _platePos.Clear(); + } + + protected override void RegisterInputParams(GH_InputParamManager pManager) + { + pManager.AddGenericParameter("Data", "D", "input ST-Bridge file data", GH_ParamAccess.item); + pManager.AddIntegerParameter("Size", "S", "Tag size", GH_ParamAccess.item, 12); + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) + { + pManager.AddTextParameter("NameTag", "NTag", "output name tag", GH_ParamAccess.list); + } + + protected override void SolveInstance(IGH_DataAccess dataAccess) + { + if (!dataAccess.GetData("Data", ref _stBridge)) { return; } + if (!dataAccess.GetData("Size", ref _size)) { return; } + + StbNode[] nodes = _stBridge.StbModel.StbNodes; + StbSlab[] slabs = _stBridge.StbModel.StbMembers.StbSlabs; + foreach (StbSlab slab in slabs) + { + _plateName.Add(slab.name); + StbSlabOffset[] offsets = slab.StbSlabOffsetList; + + string[] nodeIds = slab.StbNodeIdOrder.Split(' '); + var pts = new Point3d[nodeIds.Length]; + for (int i = 0; i < nodeIds.Length; i++) + { + string nodeId = nodeIds[i]; + StbNode node = nodes.First(n => n.id == nodeId); + var offsetVec = new Vector3d(); + if (offsets != null) + { + foreach (var offset in offsets.Where(offset => nodeId == offset.id_node)) + { + offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); + } + } + pts[i] = new Point3d(node.X, node.Y, node.Z) + offsetVec; + } + _platePos.Add(new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z))); + } + dataAccess.SetDataList(0, _plateName); + } + public override void DrawViewportWires(IGH_PreviewArgs args) + { + for (var i = 0; i < _plateName.Count; i++) + { + args.Display.Draw2dText(_plateName[i], Color.Black, _platePos[i], true, _size); + } + } + + protected override Bitmap Icon => null; + + public override Guid ComponentGuid => new Guid("9ee6efbb-20b5-49bb-aae9-02ca6031c09d"); + } +} From 58dee3ff8bcd365bf79dcd3ef9509e1de4877d70 Mon Sep 17 00:00:00 2001 From: hiron Date: Tue, 24 Aug 2021 22:48:34 +0900 Subject: [PATCH 03/12] Clean code --- HoaryFox/Component/Tag/Name/WallNameTag.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/HoaryFox/Component/Tag/Name/WallNameTag.cs b/HoaryFox/Component/Tag/Name/WallNameTag.cs index 938d270c..319d5987 100644 --- a/HoaryFox/Component/Tag/Name/WallNameTag.cs +++ b/HoaryFox/Component/Tag/Name/WallNameTag.cs @@ -13,8 +13,8 @@ public class WallNameTag : GH_Component private ST_BRIDGE _stBridge; private int _size; - private readonly List _frameName = new List(); - private readonly List _framePos = new List(); + private readonly List _plateName = new List(); + private readonly List _platePos = new List(); public override bool IsPreviewCapable => true; public WallNameTag() @@ -27,8 +27,8 @@ public WallNameTag() public override void ClearData() { base.ClearData(); - _frameName.Clear(); - _framePos.Clear(); + _plateName.Clear(); + _platePos.Clear(); } protected override void RegisterInputParams(GH_InputParamManager pManager) @@ -51,7 +51,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) StbWall[] walls = _stBridge.StbModel.StbMembers.StbWalls; foreach (StbWall wall in walls) { - _frameName.Add(wall.name); + _plateName.Add(wall.name); string[] nodeIds = wall.StbNodeIdOrder.Split(' '); var pts = new Point3d[nodeIds.Length]; @@ -61,16 +61,16 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) StbNode node = nodes.First(n => n.id == nodeId); pts[i] = new Point3d(node.X, node.Y, node.Z); } - _framePos.Add(new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z))); + _platePos.Add(new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z))); } - dataAccess.SetDataList(0, _frameName); + dataAccess.SetDataList(0, _plateName); } public override void DrawViewportWires(IGH_PreviewArgs args) { - for (var i = 0; i < _frameName.Count; i++) + for (var i = 0; i < _plateName.Count; i++) { - args.Display.Draw2dText(_frameName[i], Color.Black, _framePos[i], true, _size); + args.Display.Draw2dText(_plateName[i], Color.Black, _platePos[i], true, _size); } } From 1ef4268f2a1e6f7846e12bc52104c57ffa965dca Mon Sep 17 00:00:00 2001 From: hiron Date: Wed, 25 Aug 2021 21:36:36 +0900 Subject: [PATCH 04/12] Add SlabSecTag --- HoaryFox/Component/Tag/Name/BeamNameTag.cs | 2 +- HoaryFox/Component/Tag/Name/BraceNameTag.cs | 2 +- HoaryFox/Component/Tag/Name/ColumnNameTag.cs | 2 +- HoaryFox/Component/Tag/Name/GirderNameTag.cs | 2 +- HoaryFox/Component/Tag/Name/PostNameTag.cs | 2 +- HoaryFox/Component/Tag/Section/BeamSecTag.cs | 2 +- HoaryFox/Component/Tag/Section/BraceSecTag.cs | 2 +- .../Component/Tag/Section/ColumnSecTag.cs | 2 +- .../Component/Tag/Section/GirderSecTag.cs | 2 +- HoaryFox/Component/Tag/Section/PostSecTag.cs | 2 +- HoaryFox/Component/Tag/Section/SlabSecTag.cs | 117 ++++++++++++++++++ HoaryFox/Component/Utils/TagUtils.cs | 45 ++++++- 12 files changed, 167 insertions(+), 15 deletions(-) create mode 100644 HoaryFox/Component/Tag/Section/SlabSecTag.cs diff --git a/HoaryFox/Component/Tag/Name/BeamNameTag.cs b/HoaryFox/Component/Tag/Name/BeamNameTag.cs index aa6ed27e..0fab015e 100644 --- a/HoaryFox/Component/Tag/Name/BeamNameTag.cs +++ b/HoaryFox/Component/Tag/Name/BeamNameTag.cs @@ -55,7 +55,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) string idNodeStart = beam.id_node_start; string idNodeEnd = beam.id_node_end; - _framePos.Add(TagUtils.GetTagPosition(idNodeStart, idNodeEnd, nodes)); + _framePos.Add(TagUtils.GetFrameTagPosition(idNodeStart, idNodeEnd, nodes)); } dataAccess.SetDataList(0, _frameName); } diff --git a/HoaryFox/Component/Tag/Name/BraceNameTag.cs b/HoaryFox/Component/Tag/Name/BraceNameTag.cs index 9b27cc9f..277ea33a 100644 --- a/HoaryFox/Component/Tag/Name/BraceNameTag.cs +++ b/HoaryFox/Component/Tag/Name/BraceNameTag.cs @@ -55,7 +55,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) string idNodeStart = brace.id_node_start; string idNodeEnd = brace.id_node_end; - _framePos.Add(TagUtils.GetTagPosition(idNodeStart, idNodeEnd, nodes)); + _framePos.Add(TagUtils.GetFrameTagPosition(idNodeStart, idNodeEnd, nodes)); } dataAccess.SetDataList(0, _frameName); } diff --git a/HoaryFox/Component/Tag/Name/ColumnNameTag.cs b/HoaryFox/Component/Tag/Name/ColumnNameTag.cs index 92df7a97..c729a15e 100644 --- a/HoaryFox/Component/Tag/Name/ColumnNameTag.cs +++ b/HoaryFox/Component/Tag/Name/ColumnNameTag.cs @@ -55,7 +55,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) string idNodeStart = column.id_node_bottom; string idNodeEnd = column.id_node_top; - _framePos.Add(TagUtils.GetTagPosition(idNodeStart, idNodeEnd, nodes)); + _framePos.Add(TagUtils.GetFrameTagPosition(idNodeStart, idNodeEnd, nodes)); } dataAccess.SetDataList(0, _frameName); } diff --git a/HoaryFox/Component/Tag/Name/GirderNameTag.cs b/HoaryFox/Component/Tag/Name/GirderNameTag.cs index e193ebcf..fc127a97 100644 --- a/HoaryFox/Component/Tag/Name/GirderNameTag.cs +++ b/HoaryFox/Component/Tag/Name/GirderNameTag.cs @@ -55,7 +55,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) string idNodeStart = girder.id_node_start; string idNodeEnd = girder.id_node_end; - _framePos.Add(TagUtils.GetTagPosition(idNodeStart, idNodeEnd, nodes)); + _framePos.Add(TagUtils.GetFrameTagPosition(idNodeStart, idNodeEnd, nodes)); } dataAccess.SetDataList(0, _frameName); } diff --git a/HoaryFox/Component/Tag/Name/PostNameTag.cs b/HoaryFox/Component/Tag/Name/PostNameTag.cs index 90403466..1cd324b9 100644 --- a/HoaryFox/Component/Tag/Name/PostNameTag.cs +++ b/HoaryFox/Component/Tag/Name/PostNameTag.cs @@ -55,7 +55,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) string idNodeStart = post.id_node_bottom; string idNodeEnd = post.id_node_top; - _framePos.Add(TagUtils.GetTagPosition(idNodeStart, idNodeEnd, nodes)); + _framePos.Add(TagUtils.GetFrameTagPosition(idNodeStart, idNodeEnd, nodes)); } dataAccess.SetDataList(0, _frameName); } diff --git a/HoaryFox/Component/Tag/Section/BeamSecTag.cs b/HoaryFox/Component/Tag/Section/BeamSecTag.cs index 8865b96b..092783f7 100644 --- a/HoaryFox/Component/Tag/Section/BeamSecTag.cs +++ b/HoaryFox/Component/Tag/Section/BeamSecTag.cs @@ -105,7 +105,7 @@ private static GH_Structure GetTagStrings(IEnumerable beams, private static List GetTagPosition(IEnumerable beams, IEnumerable nodes) { - return beams.Select(beam => TagUtils.GetTagPosition(beam.id_node_start, beam.id_node_end, nodes)).ToList(); + return beams.Select(beam => TagUtils.GetFrameTagPosition(beam.id_node_start, beam.id_node_end, nodes)).ToList(); } public override void DrawViewportWires(IGH_PreviewArgs args) diff --git a/HoaryFox/Component/Tag/Section/BraceSecTag.cs b/HoaryFox/Component/Tag/Section/BraceSecTag.cs index 01ec62cf..1decddf3 100644 --- a/HoaryFox/Component/Tag/Section/BraceSecTag.cs +++ b/HoaryFox/Component/Tag/Section/BraceSecTag.cs @@ -95,7 +95,7 @@ private static List GetTagPosition(IEnumerable braces, IEnume { return braces == null ? new List() - : braces.Select(beam => TagUtils.GetTagPosition(beam.id_node_start, beam.id_node_end, nodes)).ToList(); + : braces.Select(beam => TagUtils.GetFrameTagPosition(beam.id_node_start, beam.id_node_end, nodes)).ToList(); } public override void DrawViewportWires(IGH_PreviewArgs args) diff --git a/HoaryFox/Component/Tag/Section/ColumnSecTag.cs b/HoaryFox/Component/Tag/Section/ColumnSecTag.cs index 0f5a7fad..0c33e222 100644 --- a/HoaryFox/Component/Tag/Section/ColumnSecTag.cs +++ b/HoaryFox/Component/Tag/Section/ColumnSecTag.cs @@ -100,7 +100,7 @@ private static GH_Structure GetTagStrings(IEnumerable colu private static List GetTagPosition(IEnumerable columns, IEnumerable nodes) { - return columns.Select(beam => TagUtils.GetTagPosition(beam.id_node_bottom, beam.id_node_top, nodes)).ToList(); + return columns.Select(beam => TagUtils.GetFrameTagPosition(beam.id_node_bottom, beam.id_node_top, nodes)).ToList(); } public override void DrawViewportWires(IGH_PreviewArgs args) diff --git a/HoaryFox/Component/Tag/Section/GirderSecTag.cs b/HoaryFox/Component/Tag/Section/GirderSecTag.cs index 1a3e75e3..54141567 100644 --- a/HoaryFox/Component/Tag/Section/GirderSecTag.cs +++ b/HoaryFox/Component/Tag/Section/GirderSecTag.cs @@ -105,7 +105,7 @@ private static GH_Structure GetTagStrings(IEnumerable beam private static List GetTagPosition(IEnumerable girders, IEnumerable nodes) { - return girders.Select(girder => TagUtils.GetTagPosition(girder.id_node_start, girder.id_node_end, nodes)).ToList(); + return girders.Select(girder => TagUtils.GetFrameTagPosition(girder.id_node_start, girder.id_node_end, nodes)).ToList(); } public override void DrawViewportWires(IGH_PreviewArgs args) diff --git a/HoaryFox/Component/Tag/Section/PostSecTag.cs b/HoaryFox/Component/Tag/Section/PostSecTag.cs index e449b485..055e899f 100644 --- a/HoaryFox/Component/Tag/Section/PostSecTag.cs +++ b/HoaryFox/Component/Tag/Section/PostSecTag.cs @@ -100,7 +100,7 @@ private static GH_Structure GetTagStrings(IEnumerable column private static List GetTagPosition(IEnumerable columns, IEnumerable nodes) { - return columns.Select(beam => TagUtils.GetTagPosition(beam.id_node_bottom, beam.id_node_top, nodes)).ToList(); + return columns.Select(beam => TagUtils.GetFrameTagPosition(beam.id_node_bottom, beam.id_node_top, nodes)).ToList(); } public override void DrawViewportWires(IGH_PreviewArgs args) diff --git a/HoaryFox/Component/Tag/Section/SlabSecTag.cs b/HoaryFox/Component/Tag/Section/SlabSecTag.cs new file mode 100644 index 00000000..e4abf19d --- /dev/null +++ b/HoaryFox/Component/Tag/Section/SlabSecTag.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Grasshopper.Kernel; +using Grasshopper.Kernel.Data; +using Grasshopper.Kernel.Types; +using HoaryFox.Component.Utils; +using Rhino.Geometry; +using STBDotNet.v202; + +namespace HoaryFox.Component.Tag.Section +{ + public class SlabSecTag : GH_Component + { + private ST_BRIDGE _stBridge; + private int _size; + private GH_Structure _plateTags = new GH_Structure(); + private List _tagPos = new List(); + + public SlabSecTag() + : base("Slab Section Tag", "BeamSec", + "Display Slab Section Tag", + "HoaryFox", "SectionTag") + { + } + + public override void ClearData() + { + base.ClearData(); + _plateTags.Clear(); + _tagPos.Clear(); + } + + public override bool IsPreviewCapable => true; + + protected override void RegisterInputParams(GH_InputParamManager pManager) + { + pManager.AddGenericParameter("Data", "D", "input ST-Bridge file data", GH_ParamAccess.item); + pManager.AddIntegerParameter("Size", "S", "Tag size", GH_ParamAccess.item, 12); + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) + { + pManager.AddTextParameter("SecTag", "STag", "output section tag", GH_ParamAccess.tree); + } + + protected override void SolveInstance(IGH_DataAccess dataAccess) + { + if (!dataAccess.GetData("Data", ref _stBridge)) { return; } + if (!dataAccess.GetData("Size", ref _size)) { return; } + + _plateTags = GetTagStrings(_stBridge.StbModel.StbMembers.StbSlabs, _stBridge.StbModel.StbSections); + _tagPos = GetTagPosition(_stBridge.StbModel.StbMembers.StbSlabs, _stBridge.StbModel.StbNodes); + + dataAccess.SetDataTree(0, _plateTags); + } + private static GH_Structure GetTagStrings(IEnumerable slabs, StbSections sections) + { + var ghSecStrings = new GH_Structure(); + + foreach (var item in slabs.Select((slab, index) => new { slab, index })) + { + string secId = item.slab.id_section; + var ghPath = new GH_Path(0, item.index); + StbSlabKind_structure kindStruct = item.slab.kind_structure; + + switch (kindStruct) + { + case StbSlabKind_structure.RC: + StbSecSlab_RC secRc = sections.StbSecSlab_RC.First(i => i.id == secId); + foreach (object figure in secRc.StbSecFigureSlab_RC.Items) + { + ghSecStrings.AppendRange(TagUtils.GetSlabRcSection(figure, secRc.strength_concrete), ghPath); + } + break; + case StbSlabKind_structure.DECK: + StbSecSlabDeck secDeck = sections.StbSecSlabDeck.First(i => i.id == secId); + ghSecStrings.AppendRange(TagUtils.GetSlabDeckSection(secDeck.StbSecFigureSlabDeck.StbSecSlabDeckStraight, secDeck.strength_concrete), ghPath); + break; + case StbSlabKind_structure.PRECAST: + StbSecSlabPrecast secPrecast = sections.StbSecSlabPrecast.First(i => i.id == secId); + ghSecStrings.AppendRange(TagUtils.GetSlabPrecastSection(secPrecast.precast_type, secPrecast.StbSecProductSlabPrecast, secPrecast.strength_concrete), ghPath); + break; + default: + throw new ArgumentOutOfRangeException(nameof(kindStruct), kindStruct, null); + } + } + + return ghSecStrings; + } + + private static List GetTagPosition(IEnumerable slabs, IEnumerable nodes) + { + return slabs.Select(slab => TagUtils.GetPlateTagPosition(slab.StbNodeIdOrder, slab.StbSlabOffsetList, nodes)).ToList(); + } + + public override void DrawViewportWires(IGH_PreviewArgs args) + { + if (_plateTags.DataCount == 0) + { + return; + } + + for (var i = 0; i < _plateTags.PathCount; i++) + { + List tags = _plateTags.Branches[i]; + string tag = tags.Aggregate(string.Empty, (current, tagString) => current + tagString + "\n"); + args.Display.Draw2dText(tag, Color.Black, _tagPos[i], true, _size); + } + } + + protected override Bitmap Icon => null; + public override Guid ComponentGuid => new Guid("90b847fd-4bac-4ea1-bab9-6ed6cc7541ed"); + + } +} diff --git a/HoaryFox/Component/Utils/TagUtils.cs b/HoaryFox/Component/Utils/TagUtils.cs index f91eb1c2..9e753f7b 100644 --- a/HoaryFox/Component/Utils/TagUtils.cs +++ b/HoaryFox/Component/Utils/TagUtils.cs @@ -12,18 +12,37 @@ namespace HoaryFox.Component.Utils { internal static class TagUtils { - internal static Point3d GetTagPosition(string idStart, string idEnd, IEnumerable nodes) + internal static Point3d GetFrameTagPosition(string idStart, string idEnd, IEnumerable nodes) { StbNode startNode = nodes.First(node => node.id == idStart); StbNode endNode = nodes.First(node => node.id == idEnd); - return new Point3d( - (startNode.X + endNode.X) / 2.0, - (startNode.Y + endNode.Y) / 2.0, - (startNode.Z + endNode.Z) / 2.0 + return new Point3d((startNode.X + endNode.X) / 2.0, (startNode.Y + endNode.Y) / 2.0, (startNode.Z + endNode.Z) / 2.0 ); } + internal static Point3d GetPlateTagPosition(string idOrder, StbSlabOffset[] offsets, IEnumerable nodes) + { + string[] nodeIds = idOrder.Split(' '); + var pts = new Point3d[nodeIds.Length]; + for (int i = 0; i < nodeIds.Length; i++) + { + string nodeId = nodeIds[i]; + StbNode node = nodes.First(n => n.id == nodeId); + var offsetVec = new Vector3d(); + if (offsets != null) + { + foreach (var offset in offsets.Where(offset => nodeId == offset.id_node)) + { + offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); + } + } + pts[i] = new Point3d(node.X, node.Y, node.Z) + offsetVec; + } + + return new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z)); + } + internal static IEnumerable GetBeamRcSection(object rcFigure, string strength) { var ghSecStrings = new GH_Structure(); @@ -218,6 +237,22 @@ internal static IEnumerable GetSlabRcSection(object slabFigure, strin return ghSecString; } + internal static IEnumerable GetSlabDeckSection(StbSecSlabDeckStraight figure, string strength) + { + var ghSecString = new GH_Structure(); + ghSecString.Append(new GH_String("t=" + figure.depth + "(" + strength + ")")); + + return ghSecString; + } + + internal static IEnumerable GetSlabPrecastSection(StbSecSlabPrecastPrecast_type type, StbSecProductSlabPrecast figure, string strength) + { + var ghSecString = new GH_Structure(); + ghSecString.Append(new GH_String("t=" + figure.depth + "(" + strength + ", type:" + type + ")")); + + return ghSecString; + } + internal static IEnumerable GetWallSection(StbSecWall_RC_Straight figure, string strength) { var ghSecString = new GH_Structure(); From c2cd62e85578be417d33efc9ae486851e51b87ae Mon Sep 17 00:00:00 2001 From: hiron Date: Thu, 26 Aug 2021 22:30:21 +0900 Subject: [PATCH 05/12] Add WallSecTag --- HoaryFox/Component/Tag/Section/WallSecTag.cs | 99 ++++++++++++++++++++ HoaryFox/Component/Utils/TagUtils.cs | 28 +++++- 2 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 HoaryFox/Component/Tag/Section/WallSecTag.cs diff --git a/HoaryFox/Component/Tag/Section/WallSecTag.cs b/HoaryFox/Component/Tag/Section/WallSecTag.cs new file mode 100644 index 00000000..eece75ac --- /dev/null +++ b/HoaryFox/Component/Tag/Section/WallSecTag.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Grasshopper.Kernel; +using Grasshopper.Kernel.Data; +using Grasshopper.Kernel.Types; +using HoaryFox.Component.Utils; +using Rhino.Geometry; +using STBDotNet.v202; + +namespace HoaryFox.Component.Tag.Section +{ + public class WallSecTag : GH_Component + { + private ST_BRIDGE _stBridge; + private int _size; + private GH_Structure _plateTags = new GH_Structure(); + private List _tagPos = new List(); + + public WallSecTag() + : base("Wall Section Tag", "WallSec", + "Display Wall Section Tag", + "HoaryFox", "SectionTag") + { + } + + public override void ClearData() + { + base.ClearData(); + _plateTags.Clear(); + _tagPos.Clear(); + } + + public override bool IsPreviewCapable => true; + + protected override void RegisterInputParams(GH_InputParamManager pManager) + { + pManager.AddGenericParameter("Data", "D", "input ST-Bridge file data", GH_ParamAccess.item); + pManager.AddIntegerParameter("Size", "S", "Tag size", GH_ParamAccess.item, 12); + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) + { + pManager.AddTextParameter("SecTag", "STag", "output section tag", GH_ParamAccess.tree); + } + + protected override void SolveInstance(IGH_DataAccess dataAccess) + { + if (!dataAccess.GetData("Data", ref _stBridge)) { return; } + if (!dataAccess.GetData("Size", ref _size)) { return; } + + _plateTags = GetTagStrings(_stBridge.StbModel.StbMembers.StbWalls, _stBridge.StbModel.StbSections); + _tagPos = GetTagPosition(_stBridge.StbModel.StbMembers.StbWalls, _stBridge.StbModel.StbNodes); + + dataAccess.SetDataTree(0, _plateTags); + } + private static GH_Structure GetTagStrings(IEnumerable walls, StbSections sections) + { + var ghSecStrings = new GH_Structure(); + + foreach (var item in walls.Select((wall, index) => new { wall, index })) + { + string secId = item.wall.id_section; + var ghPath = new GH_Path(0, item.index); + + StbSecWall_RC secRc = sections.StbSecWall_RC.First(i => i.id == secId); + StbSecWall_RC_Straight figure = secRc.StbSecFigureWall_RC.StbSecWall_RC_Straight; + ghSecStrings.AppendRange(TagUtils.GetWallRcSection(figure, secRc.strength_concrete), ghPath); + } + + return ghSecStrings; + } + + private static List GetTagPosition(IEnumerable walls, IEnumerable nodes) + { + return walls.Select(wall => TagUtils.GetWallTagPosition(wall.StbNodeIdOrder, wall.StbWallOffsetList, nodes)).ToList(); + } + + public override void DrawViewportWires(IGH_PreviewArgs args) + { + if (_plateTags.DataCount == 0) + { + return; + } + + for (var i = 0; i < _plateTags.PathCount; i++) + { + List tags = _plateTags.Branches[i]; + string tag = tags.Aggregate(string.Empty, (current, tagString) => current + tagString + "\n"); + args.Display.Draw2dText(tag, Color.Black, _tagPos[i], true, _size); + } + } + + protected override Bitmap Icon => null; + public override Guid ComponentGuid => new Guid("fcb8d572-732a-473f-a807-7c2e8bc6f64f"); + + } +} diff --git a/HoaryFox/Component/Utils/TagUtils.cs b/HoaryFox/Component/Utils/TagUtils.cs index 9e753f7b..4f2a1ffa 100644 --- a/HoaryFox/Component/Utils/TagUtils.cs +++ b/HoaryFox/Component/Utils/TagUtils.cs @@ -21,7 +21,29 @@ internal static Point3d GetFrameTagPosition(string idStart, string idEnd, IEnume ); } - internal static Point3d GetPlateTagPosition(string idOrder, StbSlabOffset[] offsets, IEnumerable nodes) + internal static Point3d GetSlabTagPosition(string idOrder, StbSlabOffset[] offsets, IEnumerable nodes) + { + string[] nodeIds = idOrder.Split(' '); + var pts = new Point3d[nodeIds.Length]; + for (int i = 0; i < nodeIds.Length; i++) + { + string nodeId = nodeIds[i]; + StbNode node = nodes.First(n => n.id == nodeId); + var offsetVec = new Vector3d(); + if (offsets != null) + { + foreach (var offset in offsets.Where(offset => nodeId == offset.id_node)) + { + offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); + } + } + pts[i] = new Point3d(node.X, node.Y, node.Z) + offsetVec; + } + + return new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z)); + } + + internal static Point3d GetWallTagPosition(string idOrder, StbWallOffset[] offsets, IEnumerable nodes) { string[] nodeIds = idOrder.Split(' '); var pts = new Point3d[nodeIds.Length]; @@ -253,7 +275,7 @@ internal static IEnumerable GetSlabPrecastSection(StbSecSlabPrecastPr return ghSecString; } - internal static IEnumerable GetWallSection(StbSecWall_RC_Straight figure, string strength) + internal static IEnumerable GetWallRcSection(StbSecWall_RC_Straight figure, string strength) { var ghSecString = new GH_Structure(); ghSecString.Append(new GH_String("t=" + figure.t + "(" + strength + ")")); @@ -404,7 +426,7 @@ private static void AppendSectionInfos(IDictionary pDict, StbSec break; case "StbWall": // RC しかない StbSecWall_RC wallRc = sections.StbSecWall_RC.First(sec => sec.id == pDict["id_section"]); - sectionInfo = GetWallSection(wallRc.StbSecFigureWall_RC.StbSecWall_RC_Straight, wallRc.strength_concrete).ToList(); + sectionInfo = GetWallRcSection(wallRc.StbSecFigureWall_RC.StbSecWall_RC_Straight, wallRc.strength_concrete).ToList(); break; } From f7637fa162388e4d401c4cbc759b08b7deae2750 Mon Sep 17 00:00:00 2001 From: hiron Date: Thu, 26 Aug 2021 22:30:32 +0900 Subject: [PATCH 06/12] Fix typo --- HoaryFox/Component/Tag/Section/SlabSecTag.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HoaryFox/Component/Tag/Section/SlabSecTag.cs b/HoaryFox/Component/Tag/Section/SlabSecTag.cs index e4abf19d..53530306 100644 --- a/HoaryFox/Component/Tag/Section/SlabSecTag.cs +++ b/HoaryFox/Component/Tag/Section/SlabSecTag.cs @@ -19,7 +19,7 @@ public class SlabSecTag : GH_Component private List _tagPos = new List(); public SlabSecTag() - : base("Slab Section Tag", "BeamSec", + : base("Slab Section Tag", "SlabSec", "Display Slab Section Tag", "HoaryFox", "SectionTag") { @@ -92,7 +92,7 @@ private static GH_Structure GetTagStrings(IEnumerable slabs, private static List GetTagPosition(IEnumerable slabs, IEnumerable nodes) { - return slabs.Select(slab => TagUtils.GetPlateTagPosition(slab.StbNodeIdOrder, slab.StbSlabOffsetList, nodes)).ToList(); + return slabs.Select(slab => TagUtils.GetSlabTagPosition(slab.StbNodeIdOrder, slab.StbSlabOffsetList, nodes)).ToList(); } public override void DrawViewportWires(IGH_PreviewArgs args) From c36d4d71aa8a47bfe076678fc0ad54780e013137 Mon Sep 17 00:00:00 2001 From: hiron Date: Fri, 27 Aug 2021 23:59:23 +0900 Subject: [PATCH 07/12] Add non-planar slab support --- .../Geometry/CreateMemberBrepListFromStb.cs | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs index 30175dc8..92c53570 100644 --- a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs +++ b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs @@ -253,10 +253,30 @@ public List Slab(IEnumerable slabs) topPts.Add(topPts[0]); curveList[0] = new PolylineCurve(topPts); - Vector3d normal = Vector3d.CrossProduct(curveList[0].TangentAtEnd, curveList[0].TangentAtStart); - curveList[1] = new PolylineCurve(topPts.Select(pt => pt - normal * depth)); - brepList.Add(Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0] - .CapPlanarHoles(_tolerance[0])); + if (depth > 0) + { + Vector3d normal = Vector3d.CrossProduct(curveList[0].TangentAtEnd, curveList[0].TangentAtStart); + curveList[1] = new PolylineCurve(topPts.Select(pt => pt - normal * depth)); + Brep loftBrep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0]; + Brep capedBrep = loftBrep.CapPlanarHoles(_tolerance[0]); + + if (capedBrep == null) + { + //TODO: 厚さのある Planar ではないスラブを closed で生成する方法を考える。現状は一枚の trimmed surface + brepList.Add(Brep.CreatePatch(new[] { curveList[0] }, 20, 20, _tolerance[0])); + } + else + { + brepList.Add(capedBrep); + } + } + else + { + Brep[] planarBrep = Brep.CreatePlanarBreps(new[] { curveList[0] }, _tolerance[0]); + brepList.Add(planarBrep != null + ? planarBrep[0] + : Brep.CreatePatch(new[] { curveList[0] }, 20, 20, _tolerance[0])); + } } return brepList; From b59462cfc53b2158818f7ffeb83aac567143757a Mon Sep 17 00:00:00 2001 From: hiron Date: Sat, 28 Aug 2021 21:56:11 +0900 Subject: [PATCH 08/12] Update non-planar slab brep to always closed --- .../Geometry/CreateMemberBrepListFromStb.cs | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs index 92c53570..6b577dc9 100644 --- a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs +++ b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs @@ -262,8 +262,25 @@ public List Slab(IEnumerable slabs) if (capedBrep == null) { - //TODO: 厚さのある Planar ではないスラブを closed で生成する方法を考える。現状は一枚の trimmed surface - brepList.Add(Brep.CreatePatch(new[] { curveList[0] }, 20, 20, _tolerance[0])); + var nonPlanarBrep = new List(); + Brep topBrep = Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0]); + nonPlanarBrep.Add(topBrep); + + BrepFace face = topBrep.Faces[0]; + Vector3d faceNormal = face.NormalAt(face.Domain(0).Mid, face.Domain(1).Mid); + if (Vector3d.VectorAngle(faceNormal, Vector3d.ZAxis) < Vector3d.VectorAngle(faceNormal, -Vector3d.ZAxis)) + { + faceNormal = -faceNormal; + } + Brep bottomBrep = topBrep.DuplicateBrep(); + bottomBrep.Translate(faceNormal * depth); + nonPlanarBrep.Add(bottomBrep); + + IEnumerable edgeCurveList = topBrep.Edges.Select(edge => edge.DuplicateCurve()); + nonPlanarBrep.AddRange(edgeCurveList.Select(edgeCurve => + Surface.CreateExtrusion(edgeCurve, faceNormal * depth).ToBrep())); + + brepList.Add(Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep); } else { @@ -275,7 +292,7 @@ public List Slab(IEnumerable slabs) Brep[] planarBrep = Brep.CreatePlanarBreps(new[] { curveList[0] }, _tolerance[0]); brepList.Add(planarBrep != null ? planarBrep[0] - : Brep.CreatePatch(new[] { curveList[0] }, 20, 20, _tolerance[0])); + : Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0])); } } From fda34c5cfc7b412e6346146c558f7594a6133229 Mon Sep 17 00:00:00 2001 From: hiron Date: Sun, 29 Aug 2021 12:19:18 +0900 Subject: [PATCH 09/12] Clean code --- HoaryFox/Component/Tag/Name/SlabNameTag.cs | 36 ++++++---- HoaryFox/Component/Tag/Section/SlabSecTag.cs | 52 +++++++------- .../Geometry/CreateMemberBrepListFromStb.cs | 72 ++++++++++--------- 3 files changed, 89 insertions(+), 71 deletions(-) diff --git a/HoaryFox/Component/Tag/Name/SlabNameTag.cs b/HoaryFox/Component/Tag/Name/SlabNameTag.cs index fc810a42..2b146e76 100644 --- a/HoaryFox/Component/Tag/Name/SlabNameTag.cs +++ b/HoaryFox/Component/Tag/Name/SlabNameTag.cs @@ -53,27 +53,35 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) { _plateName.Add(slab.name); StbSlabOffset[] offsets = slab.StbSlabOffsetList; - string[] nodeIds = slab.StbNodeIdOrder.Split(' '); - var pts = new Point3d[nodeIds.Length]; - for (int i = 0; i < nodeIds.Length; i++) + Point3d[] pts = SlabNodeToPoint3ds(nodeIds, nodes, offsets); + _platePos.Add(new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z))); + } + dataAccess.SetDataList(0, _plateName); + } + + private static Point3d[] SlabNodeToPoint3ds(IReadOnlyList nodeIds, StbNode[] nodes, StbSlabOffset[] offsets) + { + var pts = new Point3d[nodeIds.Count]; + for (var i = 0; i < nodeIds.Count; i++) + { + string nodeId = nodeIds[i]; + StbNode node = nodes.First(n => n.id == nodeId); + var offsetVec = new Vector3d(); + if (offsets != null) { - string nodeId = nodeIds[i]; - StbNode node = nodes.First(n => n.id == nodeId); - var offsetVec = new Vector3d(); - if (offsets != null) + foreach (StbSlabOffset offset in offsets.Where(offset => nodeId == offset.id_node)) { - foreach (var offset in offsets.Where(offset => nodeId == offset.id_node)) - { - offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); - } + offsetVec = new Vector3d(offset.offset_X, offset.offset_Y, offset.offset_Z); } - pts[i] = new Point3d(node.X, node.Y, node.Z) + offsetVec; } - _platePos.Add(new Point3d(pts.Average(n => n.X), pts.Average(n => n.Y), pts.Average(n => n.Z))); + + pts[i] = new Point3d(node.X, node.Y, node.Z) + offsetVec; } - dataAccess.SetDataList(0, _plateName); + + return pts; } + public override void DrawViewportWires(IGH_PreviewArgs args) { for (var i = 0; i < _plateName.Count; i++) diff --git a/HoaryFox/Component/Tag/Section/SlabSecTag.cs b/HoaryFox/Component/Tag/Section/SlabSecTag.cs index 53530306..80d459a5 100644 --- a/HoaryFox/Component/Tag/Section/SlabSecTag.cs +++ b/HoaryFox/Component/Tag/Section/SlabSecTag.cs @@ -61,35 +61,39 @@ private static GH_Structure GetTagStrings(IEnumerable slabs, foreach (var item in slabs.Select((slab, index) => new { slab, index })) { - string secId = item.slab.id_section; - var ghPath = new GH_Path(0, item.index); - StbSlabKind_structure kindStruct = item.slab.kind_structure; - - switch (kindStruct) - { - case StbSlabKind_structure.RC: - StbSecSlab_RC secRc = sections.StbSecSlab_RC.First(i => i.id == secId); - foreach (object figure in secRc.StbSecFigureSlab_RC.Items) - { - ghSecStrings.AppendRange(TagUtils.GetSlabRcSection(figure, secRc.strength_concrete), ghPath); - } - break; - case StbSlabKind_structure.DECK: - StbSecSlabDeck secDeck = sections.StbSecSlabDeck.First(i => i.id == secId); - ghSecStrings.AppendRange(TagUtils.GetSlabDeckSection(secDeck.StbSecFigureSlabDeck.StbSecSlabDeckStraight, secDeck.strength_concrete), ghPath); - break; - case StbSlabKind_structure.PRECAST: - StbSecSlabPrecast secPrecast = sections.StbSecSlabPrecast.First(i => i.id == secId); - ghSecStrings.AppendRange(TagUtils.GetSlabPrecastSection(secPrecast.precast_type, secPrecast.StbSecProductSlabPrecast, secPrecast.strength_concrete), ghPath); - break; - default: - throw new ArgumentOutOfRangeException(nameof(kindStruct), kindStruct, null); - } + SetSectionInfo(sections, ghSecStrings, item.slab, item.index); } return ghSecStrings; } + private static void SetSectionInfo(StbSections sections, GH_Structure ghSecStrings, StbSlab slab, int index) + { + string secId = slab.id_section; + var ghPath = new GH_Path(0, index); + StbSlabKind_structure kindStruct = slab.kind_structure; + switch (kindStruct) + { + case StbSlabKind_structure.RC: + StbSecSlab_RC secRc = sections.StbSecSlab_RC.First(i => i.id == secId); + foreach (object figure in secRc.StbSecFigureSlab_RC.Items) + { + ghSecStrings.AppendRange(TagUtils.GetSlabRcSection(figure, secRc.strength_concrete), ghPath); + } + break; + case StbSlabKind_structure.DECK: + StbSecSlabDeck secDeck = sections.StbSecSlabDeck.First(i => i.id == secId); + ghSecStrings.AppendRange(TagUtils.GetSlabDeckSection(secDeck.StbSecFigureSlabDeck.StbSecSlabDeckStraight, secDeck.strength_concrete), ghPath); + break; + case StbSlabKind_structure.PRECAST: + StbSecSlabPrecast secPrecast = sections.StbSecSlabPrecast.First(i => i.id == secId); + ghSecStrings.AppendRange(TagUtils.GetSlabPrecastSection(secPrecast.precast_type, secPrecast.StbSecProductSlabPrecast, secPrecast.strength_concrete), ghPath); + break; + default: + throw new ArgumentOutOfRangeException(nameof(kindStruct), kindStruct, null); + } + } + private static List GetTagPosition(IEnumerable slabs, IEnumerable nodes) { return slabs.Select(slab => TagUtils.GetSlabTagPosition(slab.StbNodeIdOrder, slab.StbSlabOffsetList, nodes)).ToList(); diff --git a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs index 6b577dc9..b8a07b15 100644 --- a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs +++ b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs @@ -253,50 +253,56 @@ public List Slab(IEnumerable slabs) topPts.Add(topPts[0]); curveList[0] = new PolylineCurve(topPts); - if (depth > 0) - { - Vector3d normal = Vector3d.CrossProduct(curveList[0].TangentAtEnd, curveList[0].TangentAtStart); - curveList[1] = new PolylineCurve(topPts.Select(pt => pt - normal * depth)); - Brep loftBrep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0]; - Brep capedBrep = loftBrep.CapPlanarHoles(_tolerance[0]); + CreateSlabBrep(depth, curveList, topPts, brepList); + } - if (capedBrep == null) - { - var nonPlanarBrep = new List(); - Brep topBrep = Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0]); - nonPlanarBrep.Add(topBrep); + return brepList; + } - BrepFace face = topBrep.Faces[0]; - Vector3d faceNormal = face.NormalAt(face.Domain(0).Mid, face.Domain(1).Mid); - if (Vector3d.VectorAngle(faceNormal, Vector3d.ZAxis) < Vector3d.VectorAngle(faceNormal, -Vector3d.ZAxis)) - { - faceNormal = -faceNormal; - } - Brep bottomBrep = topBrep.DuplicateBrep(); - bottomBrep.Translate(faceNormal * depth); - nonPlanarBrep.Add(bottomBrep); + private void CreateSlabBrep(double depth, IList curveList, IEnumerable topPts, ICollection brepList) + { + if (depth > 0) + { + Vector3d normal = Vector3d.CrossProduct(curveList[0].TangentAtEnd, curveList[0].TangentAtStart); + curveList[1] = new PolylineCurve(topPts.Select(pt => pt - normal * depth)); + Brep loftBrep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0]; + Brep capedBrep = loftBrep.CapPlanarHoles(_tolerance[0]); - IEnumerable edgeCurveList = topBrep.Edges.Select(edge => edge.DuplicateCurve()); - nonPlanarBrep.AddRange(edgeCurveList.Select(edgeCurve => - Surface.CreateExtrusion(edgeCurve, faceNormal * depth).ToBrep())); + if (capedBrep == null) + { + var nonPlanarBrep = new List(); + var topBrep = Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0]); + nonPlanarBrep.Add(topBrep); - brepList.Add(Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep); - } - else + BrepFace face = topBrep.Faces[0]; + Vector3d faceNormal = face.NormalAt(face.Domain(0).Mid, face.Domain(1).Mid); + if (Vector3d.VectorAngle(faceNormal, Vector3d.ZAxis) < Vector3d.VectorAngle(faceNormal, -Vector3d.ZAxis)) { - brepList.Add(capedBrep); + faceNormal = -faceNormal; } + + Brep bottomBrep = topBrep.DuplicateBrep(); + bottomBrep.Translate(faceNormal * depth); + nonPlanarBrep.Add(bottomBrep); + + IEnumerable edgeCurveList = topBrep.Edges.Select(edge => edge.DuplicateCurve()); + nonPlanarBrep.AddRange(edgeCurveList.Select(edgeCurve => + Surface.CreateExtrusion(edgeCurve, faceNormal * depth).ToBrep())); + + brepList.Add(Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep); } else { - Brep[] planarBrep = Brep.CreatePlanarBreps(new[] { curveList[0] }, _tolerance[0]); - brepList.Add(planarBrep != null - ? planarBrep[0] - : Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0])); + brepList.Add(capedBrep); } } - - return brepList; + else + { + Brep[] planarBrep = Brep.CreatePlanarBreps(new[] { curveList[0] }, _tolerance[0]); + brepList.Add(planarBrep != null + ? planarBrep[0] + : Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0])); + } } public List Wall(IEnumerable walls) From a819bebd96d82c89a18e2fec9bbc665551304f44 Mon Sep 17 00:00:00 2001 From: hiron Date: Sun, 29 Aug 2021 12:34:50 +0900 Subject: [PATCH 10/12] Clean CreateSlabBrep method --- .../Geometry/CreateMemberBrepListFromStb.cs | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs index b8a07b15..bd540abf 100644 --- a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs +++ b/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs @@ -268,33 +268,7 @@ private void CreateSlabBrep(double depth, IList curveList, IEnume Brep loftBrep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0]; Brep capedBrep = loftBrep.CapPlanarHoles(_tolerance[0]); - if (capedBrep == null) - { - var nonPlanarBrep = new List(); - var topBrep = Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0]); - nonPlanarBrep.Add(topBrep); - - BrepFace face = topBrep.Faces[0]; - Vector3d faceNormal = face.NormalAt(face.Domain(0).Mid, face.Domain(1).Mid); - if (Vector3d.VectorAngle(faceNormal, Vector3d.ZAxis) < Vector3d.VectorAngle(faceNormal, -Vector3d.ZAxis)) - { - faceNormal = -faceNormal; - } - - Brep bottomBrep = topBrep.DuplicateBrep(); - bottomBrep.Translate(faceNormal * depth); - nonPlanarBrep.Add(bottomBrep); - - IEnumerable edgeCurveList = topBrep.Edges.Select(edge => edge.DuplicateCurve()); - nonPlanarBrep.AddRange(edgeCurveList.Select(edgeCurve => - Surface.CreateExtrusion(edgeCurve, faceNormal * depth).ToBrep())); - - brepList.Add(Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep); - } - else - { - brepList.Add(capedBrep); - } + brepList.Add(capedBrep ?? NonPlanarBrep(depth, curveList)); } else { @@ -305,6 +279,29 @@ private void CreateSlabBrep(double depth, IList curveList, IEnume } } + private Brep NonPlanarBrep(double depth, IList curveList) + { + var nonPlanarBrep = new List(); + var topBrep = Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0]); + nonPlanarBrep.Add(topBrep); + + BrepFace face = topBrep.Faces[0]; + Vector3d faceNormal = face.NormalAt(face.Domain(0).Mid, face.Domain(1).Mid); + if (Vector3d.VectorAngle(faceNormal, Vector3d.ZAxis) < Vector3d.VectorAngle(faceNormal, -Vector3d.ZAxis)) + { + faceNormal = -faceNormal; + } + + Brep bottomBrep = topBrep.DuplicateBrep(); + bottomBrep.Translate(faceNormal * depth); + nonPlanarBrep.Add(bottomBrep); + + IEnumerable edgeCurveList = topBrep.Edges.Select(edge => edge.DuplicateCurve()); + nonPlanarBrep.AddRange(edgeCurveList.Select(edgeCurve => + Surface.CreateExtrusion(edgeCurve, faceNormal * depth).ToBrep())); + return Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep; + } + public List Wall(IEnumerable walls) { var brepList = new List(); From a7f57211ba7894f45e7bf20c60b2ebd2b9430a97 Mon Sep 17 00:00:00 2001 From: hiron Date: Sun, 29 Aug 2021 13:39:48 +0900 Subject: [PATCH 11/12] Add slabTag and wallTag icon --- HoaryFox/Component/Tag/Name/SlabNameTag.cs | 3 +- HoaryFox/Component/Tag/Name/WallNameTag.cs | 3 +- HoaryFox/Component/Tag/Section/SlabSecTag.cs | 3 +- HoaryFox/Component/Tag/Section/WallSecTag.cs | 3 +- HoaryFox/Properties/Resource.Designer.cs | 40 ++++ HoaryFox/Properties/Resource.resx | 12 + HoaryFox/Resources/Slab - Copy.svg | 229 +++++++++++++++++++ HoaryFox/Resources/SlabName.png | Bin 0 -> 500 bytes HoaryFox/Resources/SlabSection.png | Bin 0 -> 526 bytes HoaryFox/Resources/Wall.svg | 229 +++++++++++++++++++ HoaryFox/Resources/WallName.png | Bin 0 -> 631 bytes HoaryFox/Resources/WallSection.png | Bin 0 -> 708 bytes 12 files changed, 518 insertions(+), 4 deletions(-) create mode 100644 HoaryFox/Resources/Slab - Copy.svg create mode 100644 HoaryFox/Resources/SlabName.png create mode 100644 HoaryFox/Resources/SlabSection.png create mode 100644 HoaryFox/Resources/Wall.svg create mode 100644 HoaryFox/Resources/WallName.png create mode 100644 HoaryFox/Resources/WallSection.png diff --git a/HoaryFox/Component/Tag/Name/SlabNameTag.cs b/HoaryFox/Component/Tag/Name/SlabNameTag.cs index 2b146e76..40664d71 100644 --- a/HoaryFox/Component/Tag/Name/SlabNameTag.cs +++ b/HoaryFox/Component/Tag/Name/SlabNameTag.cs @@ -3,6 +3,7 @@ using System.Drawing; using System.Linq; using Grasshopper.Kernel; +using HoaryFox.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -90,7 +91,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => null; + protected override Bitmap Icon => Resource.SlabName; public override Guid ComponentGuid => new Guid("9ee6efbb-20b5-49bb-aae9-02ca6031c09d"); } diff --git a/HoaryFox/Component/Tag/Name/WallNameTag.cs b/HoaryFox/Component/Tag/Name/WallNameTag.cs index 319d5987..fea4e609 100644 --- a/HoaryFox/Component/Tag/Name/WallNameTag.cs +++ b/HoaryFox/Component/Tag/Name/WallNameTag.cs @@ -3,6 +3,7 @@ using System.Drawing; using System.Linq; using Grasshopper.Kernel; +using HoaryFox.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -74,7 +75,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => null; + protected override Bitmap Icon => Resource.WallName; public override Guid ComponentGuid => new Guid("713d1503-eebd-4504-83f0-ddd072a11188"); } diff --git a/HoaryFox/Component/Tag/Section/SlabSecTag.cs b/HoaryFox/Component/Tag/Section/SlabSecTag.cs index 80d459a5..56f40705 100644 --- a/HoaryFox/Component/Tag/Section/SlabSecTag.cs +++ b/HoaryFox/Component/Tag/Section/SlabSecTag.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; +using HoaryFox.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -114,7 +115,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => null; + protected override Bitmap Icon => Resource.SlabSection; public override Guid ComponentGuid => new Guid("90b847fd-4bac-4ea1-bab9-6ed6cc7541ed"); } diff --git a/HoaryFox/Component/Tag/Section/WallSecTag.cs b/HoaryFox/Component/Tag/Section/WallSecTag.cs index eece75ac..27f4adc0 100644 --- a/HoaryFox/Component/Tag/Section/WallSecTag.cs +++ b/HoaryFox/Component/Tag/Section/WallSecTag.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; +using HoaryFox.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -92,7 +93,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => null; + protected override Bitmap Icon => Resource.WallSection; public override Guid ComponentGuid => new Guid("fcb8d572-732a-473f-a807-7c2e8bc6f64f"); } diff --git a/HoaryFox/Properties/Resource.Designer.cs b/HoaryFox/Properties/Resource.Designer.cs index 549f9d1e..cd44ba29 100644 --- a/HoaryFox/Properties/Resource.Designer.cs +++ b/HoaryFox/Properties/Resource.Designer.cs @@ -209,5 +209,45 @@ internal static System.Drawing.Bitmap PostSection { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap SlabName { + get { + object obj = ResourceManager.GetObject("SlabName", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap SlabSection { + get { + object obj = ResourceManager.GetObject("SlabSection", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap WallName { + get { + object obj = ResourceManager.GetObject("WallName", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap WallSection { + get { + object obj = ResourceManager.GetObject("WallSection", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/HoaryFox/Properties/Resource.resx b/HoaryFox/Properties/Resource.resx index 19717845..82592480 100644 --- a/HoaryFox/Properties/Resource.resx +++ b/HoaryFox/Properties/Resource.resx @@ -163,4 +163,16 @@ ..\Resources\PostSection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SlabName.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SlabSection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\WallName.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\WallSection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/HoaryFox/Resources/Slab - Copy.svg b/HoaryFox/Resources/Slab - Copy.svg new file mode 100644 index 00000000..bbabce39 --- /dev/null +++ b/HoaryFox/Resources/Slab - Copy.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/HoaryFox/Resources/SlabName.png b/HoaryFox/Resources/SlabName.png new file mode 100644 index 0000000000000000000000000000000000000000..ef669dfd13778cf9ad0d32efb04300fc6d3d4fcf GIT binary patch literal 500 zcmV*VAjZcgIRW&$8oj++yPij2p&jE$&nq{w!O*BF94?h3kUE;L>oLR+iW&xnE4?k97J?# zn&x}Z!76|j06j41y1uMw+FZD(SS+Gitse7`-4sp>;=5l=(`fVriPTGOW5#D8wCb zE`(@>13#vyUawyh(Pb1NLQke??h%n64i2WM(P(TDkw^*uR21d-H+*n_<2bXv@81JZ zQotoMAJuBLk6}p$03vDwSV{p0fTm#>&!duT+xD98`v)n&l8A0R&%1~+W%~VoM^#k| qz(P_o5xG*zMug zK~zYI?US)$eZ+Rm$aZ68_K_^ATXf zDn0>r0Wz7)W)K8B*h970f@*DD69bo7_{5%^C(mG zdcD2*eExO~a3~@t)9JJmcWEOCf-A>yd|*2%SwybGFg!EHT&^+LgYKLD0lwT=jwrT` QZ~y=R07*qoM6N<$f?K2R`~Uy| literal 0 HcmV?d00001 diff --git a/HoaryFox/Resources/Wall.svg b/HoaryFox/Resources/Wall.svg new file mode 100644 index 00000000..29d8bef8 --- /dev/null +++ b/HoaryFox/Resources/Wall.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/HoaryFox/Resources/WallName.png b/HoaryFox/Resources/WallName.png new file mode 100644 index 0000000000000000000000000000000000000000..83c7284bce42b17df6aad1587225012c22fb9bfd GIT binary patch literal 631 zcmV--0*L*IP)FKhGsiG>R{z#m%MY(y@ymDrqMX5dt9LL@B{Jx*(p67UkHk5I+ zM<9KAg&Erx-;@*Isi|$NHPyvM@fie8C@|g0UEp3@fb+weDp$DrPRWVVjr@x#Txc0^ zDz9A~LbmLY1v&%L4h5YL1oY*#TPRrMGw5hu)UU@mZiY@I2_S7E)AmgYD<{{O!`gw}Q*%7o_F~*CZUcIciYb9W;c5MR` zfx}TtG-%<>3dc+vwf^s#Cl^gB%I%GOJ zlh>utEHMtC!bU{@FRD139wT!(iPY9OfP~LrR+NY7BaDw;mTI(G8UQFILyM{i;}#4} zX65}(O#cHY%n6*Uz54|`i&;E)b4?anHQolGz#q%&ER Rq4NL$002ovPDHLkV1g7o5PARr literal 0 HcmV?d00001 diff --git a/HoaryFox/Resources/WallSection.png b/HoaryFox/Resources/WallSection.png new file mode 100644 index 0000000000000000000000000000000000000000..c50960bc7f8616db1aaa6a0fc152f43914a657a9 GIT binary patch literal 708 zcmV;#0z3VQP)s0B~p z$ch2Gd!%uVqJ7$?9SD?})=+MJSwLHlG>L}};EX_Bl{#u&1A@1u1*0-D_XU!IQ@mSwe$NX&qHW2?u-hWfpSv92G04hl| zo1-1-TTxLp^<*sDU5I1;;p@vAXvZq@5+nUxz%RfAuFZcjTE3GR3?NYWHcQJ&CrG|~ zfM}=4v(rBg0v3=3?g5kJLxT~?06uqpl$Lne56*hG z(Cy#Az@rl?=dP9l07AON7UfV3cp&_uUAdKa literal 0 HcmV?d00001 From 7aa43513769ade7845114daaa513b6fa676ec7c7 Mon Sep 17 00:00:00 2001 From: hiron Date: Sun, 29 Aug 2021 13:51:59 +0900 Subject: [PATCH 12/12] Update component icon position in ribon --- HoaryFox/Component/Geometry/Axes.cs | 2 ++ HoaryFox/Component/Geometry/Stb2Brep.cs | 2 ++ HoaryFox/Component/Geometry/Stb2Line.cs | 2 ++ HoaryFox/Component/Tag/Name/BeamNameTag.cs | 2 ++ HoaryFox/Component/Tag/Name/BraceNameTag.cs | 2 ++ HoaryFox/Component/Tag/Name/ColumnNameTag.cs | 2 ++ HoaryFox/Component/Tag/Name/GirderNameTag.cs | 2 ++ HoaryFox/Component/Tag/Name/PostNameTag.cs | 2 ++ HoaryFox/Component/Tag/Name/SlabNameTag.cs | 2 ++ HoaryFox/Component/Tag/Name/WallNameTag.cs | 2 ++ HoaryFox/Component/Tag/Section/BeamSecTag.cs | 1 + HoaryFox/Component/Tag/Section/BraceSecTag.cs | 1 + HoaryFox/Component/Tag/Section/ColumnSecTag.cs | 2 ++ HoaryFox/Component/Tag/Section/GirderSecTag.cs | 1 + HoaryFox/Component/Tag/Section/PostSecTag.cs | 1 + HoaryFox/Component/Tag/Section/SlabSecTag.cs | 2 ++ HoaryFox/Component/Tag/Section/WallSecTag.cs | 2 ++ 17 files changed, 30 insertions(+) diff --git a/HoaryFox/Component/Geometry/Axes.cs b/HoaryFox/Component/Geometry/Axes.cs index 4e3da5fe..d94556c9 100644 --- a/HoaryFox/Component/Geometry/Axes.cs +++ b/HoaryFox/Component/Geometry/Axes.cs @@ -21,6 +21,8 @@ public class Axis : GH_Component private readonly List _storyStr = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.secondary; + public Axis() : base("Axis", "Axis", "Description", diff --git a/HoaryFox/Component/Geometry/Stb2Brep.cs b/HoaryFox/Component/Geometry/Stb2Brep.cs index c2343813..9da02140 100644 --- a/HoaryFox/Component/Geometry/Stb2Brep.cs +++ b/HoaryFox/Component/Geometry/Stb2Brep.cs @@ -17,6 +17,8 @@ public class Stb2Brep : GH_Component private ST_BRIDGE _stBridge; private readonly List> _brepList = new List>(); + public override GH_Exposure Exposure => GH_Exposure.primary; + public Stb2Brep() : base("Stb to Brep", "S2B", "Display ST-Bridge model in Brep", diff --git a/HoaryFox/Component/Geometry/Stb2Line.cs b/HoaryFox/Component/Geometry/Stb2Line.cs index 44cc4c7a..2c60d1d1 100644 --- a/HoaryFox/Component/Geometry/Stb2Line.cs +++ b/HoaryFox/Component/Geometry/Stb2Line.cs @@ -18,6 +18,8 @@ public class Stb2Line : GH_Component private List _nodes = new List(); private readonly List> _lineList = new List>(); + public override GH_Exposure Exposure => GH_Exposure.primary; + public Stb2Line() : base("Stb to Line", "S2L", "Display ST-Bridge model in line", diff --git a/HoaryFox/Component/Tag/Name/BeamNameTag.cs b/HoaryFox/Component/Tag/Name/BeamNameTag.cs index 0fab015e..b98fbe8e 100644 --- a/HoaryFox/Component/Tag/Name/BeamNameTag.cs +++ b/HoaryFox/Component/Tag/Name/BeamNameTag.cs @@ -17,6 +17,8 @@ public class BeamNameTag : GH_Component private readonly List _framePos = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.secondary; + public BeamNameTag() : base("Beam Name Tag", "BeamTag", "Display Beam Name Tag", diff --git a/HoaryFox/Component/Tag/Name/BraceNameTag.cs b/HoaryFox/Component/Tag/Name/BraceNameTag.cs index 277ea33a..da857bbb 100644 --- a/HoaryFox/Component/Tag/Name/BraceNameTag.cs +++ b/HoaryFox/Component/Tag/Name/BraceNameTag.cs @@ -17,6 +17,8 @@ public class BraceNameTag : GH_Component private readonly List _framePos = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.tertiary; + public BraceNameTag() : base("Brace Name Tag", "BraceTag", "Display Brace Name Tag", diff --git a/HoaryFox/Component/Tag/Name/ColumnNameTag.cs b/HoaryFox/Component/Tag/Name/ColumnNameTag.cs index c729a15e..b138a79d 100644 --- a/HoaryFox/Component/Tag/Name/ColumnNameTag.cs +++ b/HoaryFox/Component/Tag/Name/ColumnNameTag.cs @@ -17,6 +17,8 @@ public class ColumnNameTag : GH_Component private readonly List _framePos = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.primary; + public ColumnNameTag() : base("Column Name Tag", "ColumnTag", "Display Column Name Tag", diff --git a/HoaryFox/Component/Tag/Name/GirderNameTag.cs b/HoaryFox/Component/Tag/Name/GirderNameTag.cs index fc127a97..1e4d7130 100644 --- a/HoaryFox/Component/Tag/Name/GirderNameTag.cs +++ b/HoaryFox/Component/Tag/Name/GirderNameTag.cs @@ -17,6 +17,8 @@ public class GirderNameTag : GH_Component private readonly List _framePos = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.secondary; + public GirderNameTag() : base("Girder Name Tag", "GirderTag", "Display Girder Name Tag", diff --git a/HoaryFox/Component/Tag/Name/PostNameTag.cs b/HoaryFox/Component/Tag/Name/PostNameTag.cs index 1cd324b9..fdd117b6 100644 --- a/HoaryFox/Component/Tag/Name/PostNameTag.cs +++ b/HoaryFox/Component/Tag/Name/PostNameTag.cs @@ -17,6 +17,8 @@ public class PostNameTag : GH_Component private readonly List _framePos = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.primary; + public PostNameTag() : base("Post Name Tag", "PostTag", "Display Post Name Tag", diff --git a/HoaryFox/Component/Tag/Name/SlabNameTag.cs b/HoaryFox/Component/Tag/Name/SlabNameTag.cs index 40664d71..c8804370 100644 --- a/HoaryFox/Component/Tag/Name/SlabNameTag.cs +++ b/HoaryFox/Component/Tag/Name/SlabNameTag.cs @@ -18,6 +18,8 @@ public class SlabNameTag : GH_Component private readonly List _platePos = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.quarternary; + public SlabNameTag() : base("Slab Name Tag", "SlabTag", "Display Slab Name Tag", diff --git a/HoaryFox/Component/Tag/Name/WallNameTag.cs b/HoaryFox/Component/Tag/Name/WallNameTag.cs index fea4e609..10c25769 100644 --- a/HoaryFox/Component/Tag/Name/WallNameTag.cs +++ b/HoaryFox/Component/Tag/Name/WallNameTag.cs @@ -18,6 +18,8 @@ public class WallNameTag : GH_Component private readonly List _platePos = new List(); public override bool IsPreviewCapable => true; + public override GH_Exposure Exposure => GH_Exposure.quarternary; + public WallNameTag() : base("Wall Name Tag", "WallTag", "Display Wall Name Tag", diff --git a/HoaryFox/Component/Tag/Section/BeamSecTag.cs b/HoaryFox/Component/Tag/Section/BeamSecTag.cs index 092783f7..3acd383a 100644 --- a/HoaryFox/Component/Tag/Section/BeamSecTag.cs +++ b/HoaryFox/Component/Tag/Section/BeamSecTag.cs @@ -18,6 +18,7 @@ public class BeamSecTag : GH_Component private int _size; private GH_Structure _frameTags = new GH_Structure(); private List _tagPos = new List(); + public override GH_Exposure Exposure => GH_Exposure.secondary; public BeamSecTag() : base("Beam Section Tag", "BeamSec", diff --git a/HoaryFox/Component/Tag/Section/BraceSecTag.cs b/HoaryFox/Component/Tag/Section/BraceSecTag.cs index 1decddf3..88333ac1 100644 --- a/HoaryFox/Component/Tag/Section/BraceSecTag.cs +++ b/HoaryFox/Component/Tag/Section/BraceSecTag.cs @@ -18,6 +18,7 @@ public class BraceSecTag : GH_Component private int _size; private GH_Structure _frameTags = new GH_Structure(); private List _tagPos = new List(); + public override GH_Exposure Exposure => GH_Exposure.tertiary; public BraceSecTag() : base("Brace Section Tag", "BraceSec", diff --git a/HoaryFox/Component/Tag/Section/ColumnSecTag.cs b/HoaryFox/Component/Tag/Section/ColumnSecTag.cs index 0c33e222..7f21153d 100644 --- a/HoaryFox/Component/Tag/Section/ColumnSecTag.cs +++ b/HoaryFox/Component/Tag/Section/ColumnSecTag.cs @@ -18,6 +18,8 @@ public class ColumnSecTag : GH_Component private int _size; private GH_Structure _frameTags = new GH_Structure(); private List _tagPos = new List(); + public override GH_Exposure Exposure => GH_Exposure.primary; + public ColumnSecTag() : base("Column Section Tag", "ColumnSec", diff --git a/HoaryFox/Component/Tag/Section/GirderSecTag.cs b/HoaryFox/Component/Tag/Section/GirderSecTag.cs index 54141567..a77e88ba 100644 --- a/HoaryFox/Component/Tag/Section/GirderSecTag.cs +++ b/HoaryFox/Component/Tag/Section/GirderSecTag.cs @@ -18,6 +18,7 @@ public class GirderSecTag : GH_Component private int _size; private GH_Structure _frameTags = new GH_Structure(); private List _tagPos = new List(); + public override GH_Exposure Exposure => GH_Exposure.secondary; public GirderSecTag() : base("Girder Section Tag", "GirderSec", diff --git a/HoaryFox/Component/Tag/Section/PostSecTag.cs b/HoaryFox/Component/Tag/Section/PostSecTag.cs index 055e899f..e306e0e1 100644 --- a/HoaryFox/Component/Tag/Section/PostSecTag.cs +++ b/HoaryFox/Component/Tag/Section/PostSecTag.cs @@ -18,6 +18,7 @@ public class PostSecTag : GH_Component private int _size; private GH_Structure _frameTags = new GH_Structure(); private List _tagPos = new List(); + public override GH_Exposure Exposure => GH_Exposure.primary; public PostSecTag() : base("Post Section Tag", "PostSec", diff --git a/HoaryFox/Component/Tag/Section/SlabSecTag.cs b/HoaryFox/Component/Tag/Section/SlabSecTag.cs index 56f40705..43827818 100644 --- a/HoaryFox/Component/Tag/Section/SlabSecTag.cs +++ b/HoaryFox/Component/Tag/Section/SlabSecTag.cs @@ -19,6 +19,8 @@ public class SlabSecTag : GH_Component private GH_Structure _plateTags = new GH_Structure(); private List _tagPos = new List(); + public override GH_Exposure Exposure => GH_Exposure.quarternary; + public SlabSecTag() : base("Slab Section Tag", "SlabSec", "Display Slab Section Tag", diff --git a/HoaryFox/Component/Tag/Section/WallSecTag.cs b/HoaryFox/Component/Tag/Section/WallSecTag.cs index 27f4adc0..3c22c802 100644 --- a/HoaryFox/Component/Tag/Section/WallSecTag.cs +++ b/HoaryFox/Component/Tag/Section/WallSecTag.cs @@ -19,6 +19,8 @@ public class WallSecTag : GH_Component private GH_Structure _plateTags = new GH_Structure(); private List _tagPos = new List(); + public override GH_Exposure Exposure => GH_Exposure.quarternary; + public WallSecTag() : base("Wall Section Tag", "WallSec", "Display Wall Section Tag",