diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 2a523a93..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ develop, main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ develop ] - schedule: - - cron: '16 22 * * 3' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'csharp', 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/dotnet-grasshopper.yml b/.github/workflows/dotnet-grasshopper.yml index 11c28f92..d13fdfa5 100644 --- a/.github/workflows/dotnet-grasshopper.yml +++ b/.github/workflows/dotnet-grasshopper.yml @@ -21,8 +21,6 @@ jobs: env: Solution_Name: HoaryFox.sln Plugin_File_Name: HoaryFox - Debug_File_Path: '.\HoaryFox\bin\' - Release_File_Path: '.\HoaryFox\release\' steps: - name: Checkout @@ -46,13 +44,12 @@ jobs: env: Configuration: ${{ matrix.configuration }} - - name: Copy karambaConnect and samples to /HoaryFox/bin dir + - name: Copy Samples & License to /HoaryFox/bin dir if: ${{ matrix.configuration == 'Release' }} # Only upload gha from a release build shell: powershell run: | - cp ./KarambaConnect/bin/Release/net48/KarambaConnect.gha ./HoaryFox/bin/Release/net48/KarambaConnect.gha - cp ./Samples ./HoaryFox/bin/Release/net48/Samples -recurse - cp ./LICENSE ./HoaryFox/bin/Release/net48/LICENSE + cp ./Samples ./Release/Samples -recurse + cp ./LICENSE ./Release/LICENSE - name: Upload release build of plugin as artefact if: ${{ matrix.configuration == 'Release' }} # Only upload gha from a release build @@ -60,8 +57,4 @@ jobs: with: name: HoaryFox path: | - ./HoaryFox/bin/Release/net48/HoaryFox.gha - ./HoaryFox/bin/Release/net48/KarambaConnect.gha - ./HoaryFox/bin/Release/net48/STBDotNet.dll - ./HoaryFox/bin/Release/net48/Samples/ - ./HoaryFox/bin/Release/net48/LICENSE + ./Release diff --git a/HoaryFox.sln b/HoaryFox.sln index 35de60ed..83739a2d 100644 --- a/HoaryFox.sln +++ b/HoaryFox.sln @@ -3,33 +3,83 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30711.63 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HoaryFox", "HoaryFox\HoaryFox.csproj", "{9637855D-D144-4448-9F56-A391A3575DAC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "karambaConnect", "KarambaConnect\karambaConnect.csproj", "{CD5D3228-2B3E-4112-9B42-C82615673DFE}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A6D8895B-AD85-4160-A082-039DB8766CC9}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HoaryFox", "HoaryFox", "{B4279383-2C6A-4302-BA63-68D496644360}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HoaryFoxCommon", "HoaryFox\Common\HoaryFoxCommon.csproj", "{5BDAF6C4-1471-4C20-B3EF-52E07023D63D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HoaryFoxRH6", "HoaryFox\RH6\HoaryFoxRH6.csproj", "{A583EA84-5964-4BBA-9DC8-55E620233807}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HoaryFoxRH7", "HoaryFox\RH7\HoaryFoxRH7.csproj", "{6E000875-7563-4983-A64D-F270D3EC2A17}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KarambaConnect", "KarambaConnect", "{C00C1886-E284-41C6-ACC4-76BC225C9178}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KarambaConnectCommon", "KarambaConnect\Common\KarambaConnectCommon.csproj", "{E6241903-54B8-42A9-BD55-052F1D1B35FD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "karambaConnectRH6K1", "KarambaConnect\RH6K1\karambaConnectRH6K1.csproj", "{D3B3F92E-513B-4C33-82F5-B7F9D3463F16}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "karambaConnectRH6K2", "KarambaConnect\RH6K2\karambaConnectRH6K2.csproj", "{A3A37FBC-B7FC-4F4A-92E7-09F19704E840}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "karambaConnectRH7K1", "KarambaConnect\RH7K1\karambaConnectRH7K1.csproj", "{CE8BFA92-E7F4-48DD-A548-9569ED587A51}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "karambaConnectRH7K2", "KarambaConnect\RH7K2\karambaConnectRH7K2.csproj", "{98FB69EA-C92D-443A-9649-ADF837BC6AB2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9637855D-D144-4448-9F56-A391A3575DAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9637855D-D144-4448-9F56-A391A3575DAC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9637855D-D144-4448-9F56-A391A3575DAC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9637855D-D144-4448-9F56-A391A3575DAC}.Release|Any CPU.Build.0 = Release|Any CPU - {CD5D3228-2B3E-4112-9B42-C82615673DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD5D3228-2B3E-4112-9B42-C82615673DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD5D3228-2B3E-4112-9B42-C82615673DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD5D3228-2B3E-4112-9B42-C82615673DFE}.Release|Any CPU.Build.0 = Release|Any CPU + {5BDAF6C4-1471-4C20-B3EF-52E07023D63D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5BDAF6C4-1471-4C20-B3EF-52E07023D63D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BDAF6C4-1471-4C20-B3EF-52E07023D63D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5BDAF6C4-1471-4C20-B3EF-52E07023D63D}.Release|Any CPU.Build.0 = Release|Any CPU + {A583EA84-5964-4BBA-9DC8-55E620233807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A583EA84-5964-4BBA-9DC8-55E620233807}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A583EA84-5964-4BBA-9DC8-55E620233807}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A583EA84-5964-4BBA-9DC8-55E620233807}.Release|Any CPU.Build.0 = Release|Any CPU + {6E000875-7563-4983-A64D-F270D3EC2A17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E000875-7563-4983-A64D-F270D3EC2A17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E000875-7563-4983-A64D-F270D3EC2A17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E000875-7563-4983-A64D-F270D3EC2A17}.Release|Any CPU.Build.0 = Release|Any CPU + {E6241903-54B8-42A9-BD55-052F1D1B35FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6241903-54B8-42A9-BD55-052F1D1B35FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6241903-54B8-42A9-BD55-052F1D1B35FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6241903-54B8-42A9-BD55-052F1D1B35FD}.Release|Any CPU.Build.0 = Release|Any CPU + {CE8BFA92-E7F4-48DD-A548-9569ED587A51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE8BFA92-E7F4-48DD-A548-9569ED587A51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE8BFA92-E7F4-48DD-A548-9569ED587A51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE8BFA92-E7F4-48DD-A548-9569ED587A51}.Release|Any CPU.Build.0 = Release|Any CPU + {98FB69EA-C92D-443A-9649-ADF837BC6AB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98FB69EA-C92D-443A-9649-ADF837BC6AB2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98FB69EA-C92D-443A-9649-ADF837BC6AB2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98FB69EA-C92D-443A-9649-ADF837BC6AB2}.Release|Any CPU.Build.0 = Release|Any CPU + {D3B3F92E-513B-4C33-82F5-B7F9D3463F16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3B3F92E-513B-4C33-82F5-B7F9D3463F16}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3B3F92E-513B-4C33-82F5-B7F9D3463F16}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3B3F92E-513B-4C33-82F5-B7F9D3463F16}.Release|Any CPU.Build.0 = Release|Any CPU + {A3A37FBC-B7FC-4F4A-92E7-09F19704E840}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3A37FBC-B7FC-4F4A-92E7-09F19704E840}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3A37FBC-B7FC-4F4A-92E7-09F19704E840}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3A37FBC-B7FC-4F4A-92E7-09F19704E840}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5BDAF6C4-1471-4C20-B3EF-52E07023D63D} = {B4279383-2C6A-4302-BA63-68D496644360} + {A583EA84-5964-4BBA-9DC8-55E620233807} = {B4279383-2C6A-4302-BA63-68D496644360} + {6E000875-7563-4983-A64D-F270D3EC2A17} = {B4279383-2C6A-4302-BA63-68D496644360} + {E6241903-54B8-42A9-BD55-052F1D1B35FD} = {C00C1886-E284-41C6-ACC4-76BC225C9178} + {CE8BFA92-E7F4-48DD-A548-9569ED587A51} = {C00C1886-E284-41C6-ACC4-76BC225C9178} + {98FB69EA-C92D-443A-9649-ADF837BC6AB2} = {C00C1886-E284-41C6-ACC4-76BC225C9178} + {D3B3F92E-513B-4C33-82F5-B7F9D3463F16} = {C00C1886-E284-41C6-ACC4-76BC225C9178} + {A3A37FBC-B7FC-4F4A-92E7-09F19704E840} = {C00C1886-E284-41C6-ACC4-76BC225C9178} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F686E206-FA27-4450-9506-1707B276FCF0} EndGlobalSection diff --git a/HoaryFox/Common/HoaryFoxCommon.csproj b/HoaryFox/Common/HoaryFoxCommon.csproj new file mode 100644 index 00000000..b6b98f05 --- /dev/null +++ b/HoaryFox/Common/HoaryFoxCommon.csproj @@ -0,0 +1,27 @@ + + + + net48 + + + + + True + True + Resource.resx + + + + + + PublicResXFileCodeGenerator + Resource.Designer.cs + + + + + none + false + + + diff --git a/HoaryFox/Properties/Resource.Designer.cs b/HoaryFox/Common/Properties/Resource.Designer.cs similarity index 78% rename from HoaryFox/Properties/Resource.Designer.cs rename to HoaryFox/Common/Properties/Resource.Designer.cs index cd44ba29..b0d5a84c 100644 --- a/HoaryFox/Properties/Resource.Designer.cs +++ b/HoaryFox/Common/Properties/Resource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace HoaryFox.Properties { +namespace HoaryFoxCommon.Properties { using System; @@ -22,7 +22,7 @@ namespace HoaryFox.Properties { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resource { + public class Resource { private static global::System.Resources.ResourceManager resourceMan; @@ -36,10 +36,10 @@ internal Resource() { /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HoaryFox.Properties.Resource", typeof(Resource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HoaryFoxCommon.Properties.Resource", typeof(Resource).Assembly); resourceMan = temp; } return resourceMan; @@ -51,7 +51,7 @@ internal Resource() { /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Resource() { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap Axis { + public static System.Drawing.Bitmap Axis { get { object obj = ResourceManager.GetObject("Axis", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -73,7 +73,7 @@ internal static System.Drawing.Bitmap Axis { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap BeamName { + public static System.Drawing.Bitmap BeamName { get { object obj = ResourceManager.GetObject("BeamName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -83,7 +83,7 @@ internal static System.Drawing.Bitmap BeamName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap BeamSection { + public static System.Drawing.Bitmap BeamSection { get { object obj = ResourceManager.GetObject("BeamSection", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -93,7 +93,7 @@ internal static System.Drawing.Bitmap BeamSection { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap BraceName { + public static System.Drawing.Bitmap BraceName { get { object obj = ResourceManager.GetObject("BraceName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -103,7 +103,7 @@ internal static System.Drawing.Bitmap BraceName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap BraceSection { + public static System.Drawing.Bitmap BraceSection { get { object obj = ResourceManager.GetObject("BraceSection", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -113,7 +113,7 @@ internal static System.Drawing.Bitmap BraceSection { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap Brep { + public static System.Drawing.Bitmap Brep { get { object obj = ResourceManager.GetObject("Brep", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -123,7 +123,7 @@ internal static System.Drawing.Bitmap Brep { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap ColumnName { + public static System.Drawing.Bitmap ColumnName { get { object obj = ResourceManager.GetObject("ColumnName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -133,7 +133,7 @@ internal static System.Drawing.Bitmap ColumnName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap ColumnSection { + public static System.Drawing.Bitmap ColumnSection { get { object obj = ResourceManager.GetObject("ColumnSection", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -143,7 +143,17 @@ internal static System.Drawing.Bitmap ColumnSection { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap GirderName { + public static System.Drawing.Bitmap FilterByMaterial { + get { + object obj = ResourceManager.GetObject("FilterByMaterial", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + public static System.Drawing.Bitmap GirderName { get { object obj = ResourceManager.GetObject("GirderName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -153,7 +163,7 @@ internal static System.Drawing.Bitmap GirderName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap GirderSection { + public static System.Drawing.Bitmap GirderSection { get { object obj = ResourceManager.GetObject("GirderSection", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -163,7 +173,7 @@ internal static System.Drawing.Bitmap GirderSection { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap InfoIcon { + public static System.Drawing.Bitmap InfoIcon { get { object obj = ResourceManager.GetObject("InfoIcon", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -173,7 +183,7 @@ internal static System.Drawing.Bitmap InfoIcon { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap Line { + public static System.Drawing.Bitmap Line { get { object obj = ResourceManager.GetObject("Line", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -183,7 +193,7 @@ internal static System.Drawing.Bitmap Line { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap LoadStb { + public static System.Drawing.Bitmap LoadStb { get { object obj = ResourceManager.GetObject("LoadStb", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -193,7 +203,17 @@ internal static System.Drawing.Bitmap LoadStb { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap PostName { + public static System.Drawing.Bitmap MaterialType { + get { + object obj = ResourceManager.GetObject("MaterialType", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + public static System.Drawing.Bitmap PostName { get { object obj = ResourceManager.GetObject("PostName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -203,7 +223,7 @@ internal static System.Drawing.Bitmap PostName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap PostSection { + public static System.Drawing.Bitmap PostSection { get { object obj = ResourceManager.GetObject("PostSection", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -213,7 +233,7 @@ internal static System.Drawing.Bitmap PostSection { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap SlabName { + public static System.Drawing.Bitmap SlabName { get { object obj = ResourceManager.GetObject("SlabName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -223,7 +243,7 @@ internal static System.Drawing.Bitmap SlabName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap SlabSection { + public static System.Drawing.Bitmap SlabSection { get { object obj = ResourceManager.GetObject("SlabSection", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -233,7 +253,17 @@ internal static System.Drawing.Bitmap SlabSection { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap WallName { + public static System.Drawing.Bitmap Story { + get { + object obj = ResourceManager.GetObject("Story", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + public static System.Drawing.Bitmap WallName { get { object obj = ResourceManager.GetObject("WallName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -243,7 +273,7 @@ internal static System.Drawing.Bitmap WallName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap WallSection { + public 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/Common/Properties/Resource.resx similarity index 93% rename from HoaryFox/Properties/Resource.resx rename to HoaryFox/Common/Properties/Resource.resx index 82592480..febd7663 100644 --- a/HoaryFox/Properties/Resource.resx +++ b/HoaryFox/Common/Properties/Resource.resx @@ -142,6 +142,9 @@ ..\Resources\ColumnSection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\FilterByMaterial.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\GirderName.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -157,6 +160,9 @@ ..\Resources\LoadStb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\MaterialType.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\PostName.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -169,6 +175,9 @@ ..\Resources\SlabSection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Story.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 diff --git a/HoaryFox/Properties/launchSettings.json b/HoaryFox/Common/Properties/launchSettings.json similarity index 100% rename from HoaryFox/Properties/launchSettings.json rename to HoaryFox/Common/Properties/launchSettings.json diff --git a/HoaryFox/Resources/Axis.png b/HoaryFox/Common/Resources/Axis.png similarity index 100% rename from HoaryFox/Resources/Axis.png rename to HoaryFox/Common/Resources/Axis.png diff --git a/HoaryFox/Resources/Axis.svg b/HoaryFox/Common/Resources/Axis.svg similarity index 100% rename from HoaryFox/Resources/Axis.svg rename to HoaryFox/Common/Resources/Axis.svg diff --git a/HoaryFox/Resources/BeamName.png b/HoaryFox/Common/Resources/BeamName.png similarity index 100% rename from HoaryFox/Resources/BeamName.png rename to HoaryFox/Common/Resources/BeamName.png diff --git a/HoaryFox/Resources/BeamSection.png b/HoaryFox/Common/Resources/BeamSection.png similarity index 100% rename from HoaryFox/Resources/BeamSection.png rename to HoaryFox/Common/Resources/BeamSection.png diff --git a/HoaryFox/Resources/BraceName.png b/HoaryFox/Common/Resources/BraceName.png similarity index 100% rename from HoaryFox/Resources/BraceName.png rename to HoaryFox/Common/Resources/BraceName.png diff --git a/HoaryFox/Resources/BraceSection.png b/HoaryFox/Common/Resources/BraceSection.png similarity index 100% rename from HoaryFox/Resources/BraceSection.png rename to HoaryFox/Common/Resources/BraceSection.png diff --git a/HoaryFox/Resources/Brep.afdesign b/HoaryFox/Common/Resources/Brep.afdesign similarity index 100% rename from HoaryFox/Resources/Brep.afdesign rename to HoaryFox/Common/Resources/Brep.afdesign diff --git a/HoaryFox/Resources/Brep.png b/HoaryFox/Common/Resources/Brep.png similarity index 100% rename from HoaryFox/Resources/Brep.png rename to HoaryFox/Common/Resources/Brep.png diff --git a/HoaryFox/Resources/ColumnName.png b/HoaryFox/Common/Resources/ColumnName.png similarity index 100% rename from HoaryFox/Resources/ColumnName.png rename to HoaryFox/Common/Resources/ColumnName.png diff --git a/HoaryFox/Resources/ColumnSection.png b/HoaryFox/Common/Resources/ColumnSection.png similarity index 100% rename from HoaryFox/Resources/ColumnSection.png rename to HoaryFox/Common/Resources/ColumnSection.png diff --git a/HoaryFox/Common/Resources/FilterByMaterial.png b/HoaryFox/Common/Resources/FilterByMaterial.png new file mode 100644 index 00000000..f98925f5 Binary files /dev/null and b/HoaryFox/Common/Resources/FilterByMaterial.png differ diff --git a/HoaryFox/Common/Resources/FilterByMaterial.svg b/HoaryFox/Common/Resources/FilterByMaterial.svg new file mode 100644 index 00000000..14f87c0f --- /dev/null +++ b/HoaryFox/Common/Resources/FilterByMaterial.svg @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/HoaryFox/Resources/GirderName.png b/HoaryFox/Common/Resources/GirderName.png similarity index 100% rename from HoaryFox/Resources/GirderName.png rename to HoaryFox/Common/Resources/GirderName.png diff --git a/HoaryFox/Resources/GirderSection.png b/HoaryFox/Common/Resources/GirderSection.png similarity index 100% rename from HoaryFox/Resources/GirderSection.png rename to HoaryFox/Common/Resources/GirderSection.png diff --git a/HoaryFox/Resources/InfoIcon.afdesign b/HoaryFox/Common/Resources/InfoIcon.afdesign similarity index 100% rename from HoaryFox/Resources/InfoIcon.afdesign rename to HoaryFox/Common/Resources/InfoIcon.afdesign diff --git a/HoaryFox/Resources/InfoIcon.png b/HoaryFox/Common/Resources/InfoIcon.png similarity index 100% rename from HoaryFox/Resources/InfoIcon.png rename to HoaryFox/Common/Resources/InfoIcon.png diff --git a/HoaryFox/Resources/InfoIcon_Info.txt b/HoaryFox/Common/Resources/InfoIcon_Info.txt similarity index 100% rename from HoaryFox/Resources/InfoIcon_Info.txt rename to HoaryFox/Common/Resources/InfoIcon_Info.txt diff --git a/HoaryFox/Resources/Line.afdesign b/HoaryFox/Common/Resources/Line.afdesign similarity index 100% rename from HoaryFox/Resources/Line.afdesign rename to HoaryFox/Common/Resources/Line.afdesign diff --git a/HoaryFox/Resources/Line.png b/HoaryFox/Common/Resources/Line.png similarity index 100% rename from HoaryFox/Resources/Line.png rename to HoaryFox/Common/Resources/Line.png diff --git a/HoaryFox/Resources/LoadStb.png b/HoaryFox/Common/Resources/LoadStb.png similarity index 100% rename from HoaryFox/Resources/LoadStb.png rename to HoaryFox/Common/Resources/LoadStb.png diff --git a/HoaryFox/Resources/LoadStb.xcf b/HoaryFox/Common/Resources/LoadStb.xcf similarity index 100% rename from HoaryFox/Resources/LoadStb.xcf rename to HoaryFox/Common/Resources/LoadStb.xcf diff --git a/HoaryFox/Common/Resources/MaterialType.png b/HoaryFox/Common/Resources/MaterialType.png new file mode 100644 index 00000000..683ae6a3 Binary files /dev/null and b/HoaryFox/Common/Resources/MaterialType.png differ diff --git a/HoaryFox/Common/Resources/MaterialType.svg b/HoaryFox/Common/Resources/MaterialType.svg new file mode 100644 index 00000000..97bd0da7 --- /dev/null +++ b/HoaryFox/Common/Resources/MaterialType.svg @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/HoaryFox/Resources/Name.afdesign b/HoaryFox/Common/Resources/Name.afdesign similarity index 100% rename from HoaryFox/Resources/Name.afdesign rename to HoaryFox/Common/Resources/Name.afdesign diff --git a/HoaryFox/Resources/PostName.png b/HoaryFox/Common/Resources/PostName.png similarity index 100% rename from HoaryFox/Resources/PostName.png rename to HoaryFox/Common/Resources/PostName.png diff --git a/HoaryFox/Resources/PostSection.png b/HoaryFox/Common/Resources/PostSection.png similarity index 100% rename from HoaryFox/Resources/PostSection.png rename to HoaryFox/Common/Resources/PostSection.png diff --git a/HoaryFox/Resources/Section.afdesign b/HoaryFox/Common/Resources/Section.afdesign similarity index 100% rename from HoaryFox/Resources/Section.afdesign rename to HoaryFox/Common/Resources/Section.afdesign diff --git a/HoaryFox/Resources/Slab - Copy.svg b/HoaryFox/Common/Resources/Slab.svg similarity index 100% rename from HoaryFox/Resources/Slab - Copy.svg rename to HoaryFox/Common/Resources/Slab.svg diff --git a/HoaryFox/Resources/SlabName.png b/HoaryFox/Common/Resources/SlabName.png similarity index 100% rename from HoaryFox/Resources/SlabName.png rename to HoaryFox/Common/Resources/SlabName.png diff --git a/HoaryFox/Resources/SlabSection.png b/HoaryFox/Common/Resources/SlabSection.png similarity index 100% rename from HoaryFox/Resources/SlabSection.png rename to HoaryFox/Common/Resources/SlabSection.png diff --git a/HoaryFox/Common/Resources/Story.png b/HoaryFox/Common/Resources/Story.png new file mode 100644 index 00000000..34fe8047 Binary files /dev/null and b/HoaryFox/Common/Resources/Story.png differ diff --git a/HoaryFox/Common/Resources/Story.svg b/HoaryFox/Common/Resources/Story.svg new file mode 100644 index 00000000..dcc3267d --- /dev/null +++ b/HoaryFox/Common/Resources/Story.svg @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/HoaryFox/Resources/Wall.svg b/HoaryFox/Common/Resources/Wall.svg similarity index 100% rename from HoaryFox/Resources/Wall.svg rename to HoaryFox/Common/Resources/Wall.svg diff --git a/HoaryFox/Resources/WallName.png b/HoaryFox/Common/Resources/WallName.png similarity index 100% rename from HoaryFox/Resources/WallName.png rename to HoaryFox/Common/Resources/WallName.png diff --git a/HoaryFox/Resources/WallSection.png b/HoaryFox/Common/Resources/WallSection.png similarity index 100% rename from HoaryFox/Resources/WallSection.png rename to HoaryFox/Common/Resources/WallSection.png diff --git a/HoaryFox/HoaryFox.csproj b/HoaryFox/HoaryFox.csproj deleted file mode 100644 index e123cd2d..00000000 --- a/HoaryFox/HoaryFox.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - net48 - 1.0 - HoaryFox - Description of HoaryFox - .gha - hrntsm - true - true - true - - - - - - - - - - - True - True - Resource.resx - - - - - - ResXFileCodeGenerator - Resource.Designer.cs - - - - - C:\Program Files\Rhino 6\System\Rhino.exe - - Program - - - \ No newline at end of file diff --git a/HoaryFox/RH6/HoaryFoxRH6.csproj b/HoaryFox/RH6/HoaryFoxRH6.csproj new file mode 100644 index 00000000..383d571d --- /dev/null +++ b/HoaryFox/RH6/HoaryFoxRH6.csproj @@ -0,0 +1,44 @@ + + + net48 + 2.0.2 + HoaryFox + This Component read ST-Bridge file(.stb) and display its model data. + .gha + hrntsm + true + HoaryFox + false + HoaryFox + + + + + + + + + + + + + + + + + + C:\Program Files\Rhino 6\System\Rhino.exe + + Program + + + + none + false + + + + + + + \ No newline at end of file diff --git a/HoaryFox/HoaryFoxInfo.cs b/HoaryFox/RH6/HoaryFoxRH6Info.cs similarity index 78% rename from HoaryFox/HoaryFoxInfo.cs rename to HoaryFox/RH6/HoaryFoxRH6Info.cs index e08a08ac..5994fe53 100644 --- a/HoaryFox/HoaryFoxInfo.cs +++ b/HoaryFox/RH6/HoaryFoxRH6Info.cs @@ -4,11 +4,11 @@ namespace HoaryFox { - public class HoaryFoxInfo : GH_AssemblyInfo + public class HoaryFoxRH6Info : GH_AssemblyInfo { public override string Name => "HoaryFox"; - public override Bitmap Icon => Properties.Resource.InfoIcon; + public override Bitmap Icon => HoaryFoxCommon.Properties.Resource.InfoIcon; public override string Description => "This Component read ST-Bridge file(.stb) and display its model data."; diff --git a/HoaryFox/RH7/Component/Check/FilterByMaterials.cs b/HoaryFox/RH7/Component/Check/FilterByMaterials.cs new file mode 100644 index 00000000..57472c7d --- /dev/null +++ b/HoaryFox/RH7/Component/Check/FilterByMaterials.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using Grasshopper.Kernel; +using Grasshopper.Kernel.Data; +using Grasshopper.Kernel.Types; +using HoaryFoxCommon.Properties; + +namespace HoaryFox.Component.Check +{ + public class FilterByMaterials : GH_Component + { + public override GH_Exposure Exposure => GH_Exposure.secondary; + + public FilterByMaterials() + : base("Filter by materials", "FilterByMat", + "Filter geometry by material", + "HoaryFox", "Filter") + { + } + + protected override void RegisterInputParams(GH_InputParamManager pManager) + { + pManager.AddBrepParameter("Geometry", "Geo", "Geometry", GH_ParamAccess.tree); + pManager.AddTextParameter("Materials", "Mats", "Geometry material info", GH_ParamAccess.tree); + pManager.AddIntegerParameter("Stories", "Sts", "Geometry story info", GH_ParamAccess.tree); + pManager[2].Optional = true; + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) + { + pManager.AddBrepParameter("RC", "RC", "output RC geometry", GH_ParamAccess.tree); + pManager.AddBrepParameter("S", "S", "output S geometry", GH_ParamAccess.tree); + pManager.AddBrepParameter("SRC", "SRC", "output SRC geometry", GH_ParamAccess.tree); + pManager.AddBrepParameter("CFT", "CFT", "output CFT geometry", GH_ParamAccess.tree); + } + + protected override void SolveInstance(IGH_DataAccess dataAccess) + { + if (!dataAccess.GetDataTree(0, out GH_Structure breps)) { return; } + if (!dataAccess.GetDataTree(1, out GH_Structure materials)) { return; } + if (!dataAccess.GetDataTree(2, out GH_Structure stories)) { return; } + + if (breps.Paths.Count != materials.Paths.Count || (breps.Paths.Count != stories.Paths.Count && !stories.IsEmpty)) + { + AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Geometries, materials and stories must have the same number of items"); + return; + } + + var filteredBreps = new GH_Structure[4]; + for (var i = 0; i < 4; i++) + { + filteredBreps[i] = new GH_Structure(); + } + + FilterValue(breps, stories, materials, filteredBreps); + + for (var i = 0; i < 4; i++) + { + dataAccess.SetDataTree(i, filteredBreps[i]); + } + } + + private void FilterValue(GH_Structure breps, GH_Structure stories, GH_Structure materials, IReadOnlyList> filteredBreps) + { + for (var i = 0; i < breps.PathCount; i++) + { + GH_Path path = stories.IsEmpty ? breps.Paths[i] : new GH_Path(stories.Branches[i][0].Value, i); + GH_Brep brep = breps.Branches[i][0]; + var materialType = materials.Branches[i][0].ToString(); + + SetMaterialFilteredBrep(filteredBreps, brep, materialType, path); + } + } + + private bool SetMaterialFilteredBrep(IReadOnlyList> results, GH_Brep brep, string materialType, GH_Path path) + { + if (brep != null) + { + switch (materialType) + { + case "RC": + results[0].Append(brep.DuplicateBrep(), path); + break; + case "S": + results[1].Append(brep.DuplicateBrep(), path); + break; + case "SRC": + results[2].Append(brep.DuplicateBrep(), path); + break; + case "CFT": + results[3].Append(brep.DuplicateBrep(), path); + break; + default: + AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Unknown material type"); + return true; + } + } + + return false; + } + + protected override Bitmap Icon => Resource.FilterByMaterial; + public override Guid ComponentGuid => new Guid("a4bcebdb-2c9c-41e4-8328-e270ea70ed7b"); + } +} diff --git a/HoaryFox/RH7/Component/Check/MaterialType.cs b/HoaryFox/RH7/Component/Check/MaterialType.cs new file mode 100644 index 00000000..7eadabf2 --- /dev/null +++ b/HoaryFox/RH7/Component/Check/MaterialType.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Grasshopper.Kernel; +using Grasshopper.Kernel.Data; +using Grasshopper.Kernel.Types; +using HoaryFoxCommon.Properties; +using STBDotNet.v202; + +namespace HoaryFox.Component.Check +{ + public class MaterialType : GH_Component + { + private ST_BRIDGE _stBridge; + private readonly GH_Structure[] _materialTypeList = new GH_Structure[7]; + + public override GH_Exposure Exposure => GH_Exposure.primary; + + public MaterialType() + : base("Material Type", "MatType", + "Get material type", + "HoaryFox", "Filter") + { + } + + protected override void RegisterInputParams(GH_InputParamManager pManager) + { + pManager.AddGenericParameter("Data", "D", "input ST-Bridge Data", GH_ParamAccess.item); + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) + { + pManager.AddTextParameter("Columns", "Col", "output StbColumn material types", GH_ParamAccess.tree); + pManager.AddTextParameter("Girders", "Gird", "output StbGirder material types", GH_ParamAccess.tree); + pManager.AddTextParameter("Posts", "Pst", "output StbPost material types", GH_ParamAccess.tree); + pManager.AddTextParameter("Beams", "Bm", "output StbBeam material types", GH_ParamAccess.tree); + pManager.AddTextParameter("Braces", "Brc", "output StbBrace material types", GH_ParamAccess.tree); + pManager.AddTextParameter("Slabs", "Slb", "output StbSlab material types", GH_ParamAccess.tree); + pManager.AddTextParameter("Walls", "Wl", "output StbWall material types", GH_ParamAccess.tree); + } + + protected override void SolveInstance(IGH_DataAccess dataAccess) + { + if (!dataAccess.GetData("Data", ref _stBridge)) { return; } + + Dictionary[][] infoArray = Utils.TagUtils.GetAllSectionInfoArray(_stBridge.StbModel.StbMembers, _stBridge.StbModel.StbSections); + + foreach ((Dictionary[] infoDict, int index) in infoArray.Select((dict, index) => (dict, index))) + { + var materialTypes = new GH_Structure(); + foreach ((Dictionary info, int itemIndex) in infoDict.Select((dict, itemIndex) => (dict, itemIndex))) + { + materialTypes.Append(new GH_String(info["kind_structure"]), new GH_Path(0, itemIndex)); + } + _materialTypeList[index] = materialTypes; + } + + for (var i = 0; i < 7; i++) + { + dataAccess.SetDataTree(i, _materialTypeList[i]); + } + } + + protected override Bitmap Icon => Resource.MaterialType; + public override Guid ComponentGuid => new Guid("b6fde031-3532-40bb-a276-f61c36cdee90"); + } +} diff --git a/HoaryFox/RH7/Component/Check/Story.cs b/HoaryFox/RH7/Component/Check/Story.cs new file mode 100644 index 00000000..456ae000 --- /dev/null +++ b/HoaryFox/RH7/Component/Check/Story.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Grasshopper.Kernel; +using Grasshopper.Kernel.Data; +using Grasshopper.Kernel.Types; +using HoaryFoxCommon.Properties; +using STBDotNet.v202; + +namespace HoaryFox.Component.Check +{ + public class Story : GH_Component + { + private ST_BRIDGE _stBridge; + public override GH_Exposure Exposure => GH_Exposure.primary; + + public Story() + : base("Story", "St", + "Get story info", + "HoaryFox", "Filter") + { + } + + protected override void RegisterInputParams(GH_InputParamManager pManager) + { + pManager.AddGenericParameter("Data", "D", "input ST-Bridge Data", GH_ParamAccess.item); + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) + { + pManager.AddIntegerParameter("Columns", "Col", "Output the story to which the StbColumn belongs", GH_ParamAccess.tree); + pManager.AddIntegerParameter("Girders", "Gird", "Output the story to which the StbGirder belongs", GH_ParamAccess.tree); + pManager.AddIntegerParameter("Posts", "Pst", "Output the story to which the StbPost belongs", GH_ParamAccess.tree); + pManager.AddIntegerParameter("Beams", "Bm", "Output the story to which the StbBeam belongs", GH_ParamAccess.tree); + pManager.AddIntegerParameter("Braces", "Brc", "Output the story to which the StbBrace belongs", GH_ParamAccess.tree); + pManager.AddIntegerParameter("Slabs", "Slb", "Output the story to which the StbSlab belongs", GH_ParamAccess.tree); + pManager.AddIntegerParameter("Walls", "Wl", "Output the story to which the StbWall belongs", GH_ParamAccess.tree); + pManager.AddTextParameter("StoryName", "Name", "output each index story name", GH_ParamAccess.list); + } + + protected override void SolveInstance(IGH_DataAccess dataAccess) + { + if (!dataAccess.GetData("Data", ref _stBridge)) { return; } + + var floorList = new GH_Structure[7]; + Dictionary[][] infoArray = Utils.TagUtils.GetAllSectionInfoArray(_stBridge.StbModel.StbMembers, _stBridge.StbModel.StbSections); + + foreach ((Dictionary[] infoDict, int index) in infoArray.Select((dict, index) => (dict, index))) + { + var decisionNode = new List(); + var result = new GH_Structure(); + GetFloorDecisionNode(infoDict, decisionNode); + SetStoryIndex(decisionNode, result); + + floorList[index] = result; + } + + List storyName = _stBridge.StbModel.StbStories.Select(story => story.name).ToList(); + + for (var i = 0; i < 7; i++) + { + dataAccess.SetDataTree(i, floorList[i]); + } + dataAccess.SetDataList("StoryName", storyName); + } + + private void SetStoryIndex(IEnumerable decisionNode, GH_Structure result) + { + foreach ((string node, int itemIndex) in decisionNode.Select((node, itemIndex) => (node, itemIndex))) + { + foreach ((StbStory story, int storyIndex) in _stBridge.StbModel.StbStories.Select((story, storyIndex) => + (story, storyIndex))) + { + IEnumerable storyNodes = story.StbNodeIdList.Select(i => i.id); + if (storyNodes.Contains(node)) + { + result.Append(new GH_Integer(storyIndex), new GH_Path(0, itemIndex)); + break; + } + } + } + } + + private void GetFloorDecisionNode(IEnumerable> infoDict, ICollection decisionNode) + { + foreach (Dictionary info in infoDict) + { + switch (info["stb_element_type"]) + { + case "StbColumn": + case "StbPost": + decisionNode.Add(info["id_node_top"]); + break; + case "StbGirder": + case "StbBeam": + case "StbBrace": + decisionNode.Add(info["id_node_end"]); + break; + case "StbSlab": + case "StbWall": + decisionNode.Add(info["StbNodeIdOrder"].Split(' ')[2]); + break; + default: + AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Unknown stb element type"); + break; + } + } + } + + protected override Bitmap Icon => Resource.Story; + public override Guid ComponentGuid => new Guid("5cc64205-b80e-48ba-b813-01c70110f02f"); + } +} diff --git a/HoaryFox/Component/Geometry/Axes.cs b/HoaryFox/RH7/Component/Geometry/Axes.cs similarity index 99% rename from HoaryFox/Component/Geometry/Axes.cs rename to HoaryFox/RH7/Component/Geometry/Axes.cs index d94556c9..9d067b89 100644 --- a/HoaryFox/Component/Geometry/Axes.cs +++ b/HoaryFox/RH7/Component/Geometry/Axes.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.Linq; using Grasshopper.Kernel; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Geometry/Stb2Brep.cs b/HoaryFox/RH7/Component/Geometry/Stb2Brep.cs similarity index 97% rename from HoaryFox/Component/Geometry/Stb2Brep.cs rename to HoaryFox/RH7/Component/Geometry/Stb2Brep.cs index fcdbc6f6..7df079e9 100644 --- a/HoaryFox/Component/Geometry/Stb2Brep.cs +++ b/HoaryFox/RH7/Component/Geometry/Stb2Brep.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils.Geometry; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino; using Rhino.DocObjects; using Rhino.Geometry; @@ -28,11 +28,6 @@ public Stb2Brep() { } - public override void ClearData() - { - base.ClearData(); - } - protected override void RegisterInputParams(GH_InputParamManager pManager) { pManager.AddGenericParameter("Data", "D", "input ST-Bridge Data", GH_ParamAccess.item); diff --git a/HoaryFox/Component/Geometry/Stb2Line.cs b/HoaryFox/RH7/Component/Geometry/Stb2Line.cs similarity index 99% rename from HoaryFox/Component/Geometry/Stb2Line.cs rename to HoaryFox/RH7/Component/Geometry/Stb2Line.cs index 37ee7279..eb69c6ed 100644 --- a/HoaryFox/Component/Geometry/Stb2Line.cs +++ b/HoaryFox/RH7/Component/Geometry/Stb2Line.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils.Geometry; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino; using Rhino.DocObjects; using Rhino.Geometry; diff --git a/HoaryFox/Component/IO/StbLoader.cs b/HoaryFox/RH7/Component/IO/StbLoader.cs similarity index 92% rename from HoaryFox/Component/IO/StbLoader.cs rename to HoaryFox/RH7/Component/IO/StbLoader.cs index aeb0d718..324083ef 100644 --- a/HoaryFox/Component/IO/StbLoader.cs +++ b/HoaryFox/RH7/Component/IO/StbLoader.cs @@ -1,5 +1,6 @@ using System; using Grasshopper.Kernel; +using HoaryFoxCommon.Properties; using STBDotNet.v202; namespace HoaryFox.Component.IO @@ -35,7 +36,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) dataAccess.SetData(0, stbData); } - protected override System.Drawing.Bitmap Icon => Properties.Resource.LoadStb; + protected override System.Drawing.Bitmap Icon => Resource.LoadStb; public override Guid ComponentGuid => new Guid("C1E1CD82-9AC0-479C-A22F-DB7C44F3C77D"); } } diff --git a/HoaryFox/Component/Tag/Name/BeamNameTag.cs b/HoaryFox/RH7/Component/Tag/Name/BeamNameTag.cs similarity index 96% rename from HoaryFox/Component/Tag/Name/BeamNameTag.cs rename to HoaryFox/RH7/Component/Tag/Name/BeamNameTag.cs index b7fdb77b..ccd8435f 100644 --- a/HoaryFox/Component/Tag/Name/BeamNameTag.cs +++ b/HoaryFox/RH7/Component/Tag/Name/BeamNameTag.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -73,7 +74,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => Properties.Resource.BeamName; + protected override Bitmap Icon => Resource.BeamName; public override Guid ComponentGuid => new Guid("FDC62C6D-7C03-412D-8FF8-B76439197730"); } diff --git a/HoaryFox/Component/Tag/Name/BraceNameTag.cs b/HoaryFox/RH7/Component/Tag/Name/BraceNameTag.cs similarity index 96% rename from HoaryFox/Component/Tag/Name/BraceNameTag.cs rename to HoaryFox/RH7/Component/Tag/Name/BraceNameTag.cs index 483663c5..591e1954 100644 --- a/HoaryFox/Component/Tag/Name/BraceNameTag.cs +++ b/HoaryFox/RH7/Component/Tag/Name/BraceNameTag.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -73,7 +74,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => Properties.Resource.BraceName; + protected override Bitmap Icon => Resource.BraceName; public override Guid ComponentGuid => new Guid("21F7885E-6321-4C0D-8974-BC40769AAEAE"); } diff --git a/HoaryFox/Component/Tag/Name/ColumnNameTag.cs b/HoaryFox/RH7/Component/Tag/Name/ColumnNameTag.cs similarity index 96% rename from HoaryFox/Component/Tag/Name/ColumnNameTag.cs rename to HoaryFox/RH7/Component/Tag/Name/ColumnNameTag.cs index 6770c20a..c841e6b2 100644 --- a/HoaryFox/Component/Tag/Name/ColumnNameTag.cs +++ b/HoaryFox/RH7/Component/Tag/Name/ColumnNameTag.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -72,7 +73,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => Properties.Resource.ColumnName; + protected override Bitmap Icon => Resource.ColumnName; public override Guid ComponentGuid => new Guid("AB439AE1-A56F-4764-BC36-F3752D30461A"); } diff --git a/HoaryFox/Component/Tag/Name/GirderNameTag.cs b/HoaryFox/RH7/Component/Tag/Name/GirderNameTag.cs similarity index 96% rename from HoaryFox/Component/Tag/Name/GirderNameTag.cs rename to HoaryFox/RH7/Component/Tag/Name/GirderNameTag.cs index 0d83da4f..94a0dedd 100644 --- a/HoaryFox/Component/Tag/Name/GirderNameTag.cs +++ b/HoaryFox/RH7/Component/Tag/Name/GirderNameTag.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -73,7 +74,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => Properties.Resource.GirderName; + protected override Bitmap Icon => Resource.GirderName; public override Guid ComponentGuid => new Guid("31664B98-E1F0-4635-A718-18C8FDE14A14"); } diff --git a/HoaryFox/Component/Tag/Name/PostNameTag.cs b/HoaryFox/RH7/Component/Tag/Name/PostNameTag.cs similarity index 96% rename from HoaryFox/Component/Tag/Name/PostNameTag.cs rename to HoaryFox/RH7/Component/Tag/Name/PostNameTag.cs index 45078822..01927e98 100644 --- a/HoaryFox/Component/Tag/Name/PostNameTag.cs +++ b/HoaryFox/RH7/Component/Tag/Name/PostNameTag.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; @@ -73,7 +74,7 @@ public override void DrawViewportWires(IGH_PreviewArgs args) } } - protected override Bitmap Icon => Properties.Resource.PostName; + protected override Bitmap Icon => Resource.PostName; public override Guid ComponentGuid => new Guid("AD517629-4CD1-4109-B071-653D80DC6B70"); } diff --git a/HoaryFox/Component/Tag/Name/SlabNameTag.cs b/HoaryFox/RH7/Component/Tag/Name/SlabNameTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Name/SlabNameTag.cs rename to HoaryFox/RH7/Component/Tag/Name/SlabNameTag.cs index cdff54ef..e1fdd296 100644 --- a/HoaryFox/Component/Tag/Name/SlabNameTag.cs +++ b/HoaryFox/RH7/Component/Tag/Name/SlabNameTag.cs @@ -5,7 +5,7 @@ using Grasshopper.Kernel; using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Name/WallNameTag.cs b/HoaryFox/RH7/Component/Tag/Name/WallNameTag.cs similarity index 98% rename from HoaryFox/Component/Tag/Name/WallNameTag.cs rename to HoaryFox/RH7/Component/Tag/Name/WallNameTag.cs index dfecd3b4..8f0f6d99 100644 --- a/HoaryFox/Component/Tag/Name/WallNameTag.cs +++ b/HoaryFox/RH7/Component/Tag/Name/WallNameTag.cs @@ -5,7 +5,7 @@ using Grasshopper.Kernel; using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Section/BeamSecTag.cs b/HoaryFox/RH7/Component/Tag/Section/BeamSecTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Section/BeamSecTag.cs rename to HoaryFox/RH7/Component/Tag/Section/BeamSecTag.cs index 3acd383a..109ab056 100644 --- a/HoaryFox/Component/Tag/Section/BeamSecTag.cs +++ b/HoaryFox/RH7/Component/Tag/Section/BeamSecTag.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Section/BraceSecTag.cs b/HoaryFox/RH7/Component/Tag/Section/BraceSecTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Section/BraceSecTag.cs rename to HoaryFox/RH7/Component/Tag/Section/BraceSecTag.cs index 88333ac1..76a61ae8 100644 --- a/HoaryFox/Component/Tag/Section/BraceSecTag.cs +++ b/HoaryFox/RH7/Component/Tag/Section/BraceSecTag.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Section/ColumnSecTag.cs b/HoaryFox/RH7/Component/Tag/Section/ColumnSecTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Section/ColumnSecTag.cs rename to HoaryFox/RH7/Component/Tag/Section/ColumnSecTag.cs index 7f21153d..215f1464 100644 --- a/HoaryFox/Component/Tag/Section/ColumnSecTag.cs +++ b/HoaryFox/RH7/Component/Tag/Section/ColumnSecTag.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Section/GirderSecTag.cs b/HoaryFox/RH7/Component/Tag/Section/GirderSecTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Section/GirderSecTag.cs rename to HoaryFox/RH7/Component/Tag/Section/GirderSecTag.cs index a77e88ba..1ecadc73 100644 --- a/HoaryFox/Component/Tag/Section/GirderSecTag.cs +++ b/HoaryFox/RH7/Component/Tag/Section/GirderSecTag.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Section/PostSecTag.cs b/HoaryFox/RH7/Component/Tag/Section/PostSecTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Section/PostSecTag.cs rename to HoaryFox/RH7/Component/Tag/Section/PostSecTag.cs index e306e0e1..0dd1a4d6 100644 --- a/HoaryFox/Component/Tag/Section/PostSecTag.cs +++ b/HoaryFox/RH7/Component/Tag/Section/PostSecTag.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Section/SlabSecTag.cs b/HoaryFox/RH7/Component/Tag/Section/SlabSecTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Section/SlabSecTag.cs rename to HoaryFox/RH7/Component/Tag/Section/SlabSecTag.cs index 43827818..ca3d3ec1 100644 --- a/HoaryFox/Component/Tag/Section/SlabSecTag.cs +++ b/HoaryFox/RH7/Component/Tag/Section/SlabSecTag.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Tag/Section/WallSecTag.cs b/HoaryFox/RH7/Component/Tag/Section/WallSecTag.cs similarity index 99% rename from HoaryFox/Component/Tag/Section/WallSecTag.cs rename to HoaryFox/RH7/Component/Tag/Section/WallSecTag.cs index 3c22c802..2df4f829 100644 --- a/HoaryFox/Component/Tag/Section/WallSecTag.cs +++ b/HoaryFox/RH7/Component/Tag/Section/WallSecTag.cs @@ -6,7 +6,7 @@ using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using HoaryFox.Component.Utils; -using HoaryFox.Properties; +using HoaryFoxCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/Brace.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs similarity index 92% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/Brace.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs index f3637fd6..4e75c7be 100644 --- a/HoaryFox/Component/Utils/Geometry/BrepMaker/Brace.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Brace.cs @@ -19,8 +19,14 @@ public Brace(StbSections sections, IReadOnlyList tolerance) public Brep CreateBraceBrep(string idSection, double rotate, StbBraceKind_structure kind, IReadOnlyList sectionPoints, Vector3d memberAxis) { - var curveList = new List(); + List curveList = CreateFromEachBraceKind(idSection, kind, sectionPoints); + Utils.RotateCurveList(memberAxis, curveList, rotate, sectionPoints); + return Utils.CreateCapedBrepFromLoft(curveList, _tolerance[0]); + } + private List CreateFromEachBraceKind(string idSection, StbBraceKind_structure kind, IReadOnlyList sectionPoints) + { + List curveList; switch (kind) { case StbBraceKind_structure.S: @@ -35,10 +41,7 @@ public Brep CreateBraceBrep(string idSection, double rotate, StbBraceKind_struct throw new ArgumentOutOfRangeException(); } - Utils.RotateCurveList(memberAxis, curveList, rotate, sectionPoints); - Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0] - .CapPlanarHoles(_tolerance[0]); - return brep; + return curveList; } private List SecSteelBraceToCurves(IReadOnlyList figures, IReadOnlyList sectionPoints) diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/Column.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs similarity index 89% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/Column.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs index 1d289886..e95b6460 100644 --- a/HoaryFox/Component/Utils/Geometry/BrepMaker/Column.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Column.cs @@ -18,36 +18,36 @@ public Column(StbSections sections, IReadOnlyList tolerance) public Brep CreateColumnBrep(string idSection, double rotate, StbColumnKind_structure kind, IReadOnlyList sectionPoints, Vector3d memberAxis) { - var curveList = new List(); + List curveList = CreateFromEachColumnKind(idSection, kind, sectionPoints); + Utils.RotateCurveList(memberAxis, curveList, rotate, sectionPoints); + return Utils.CreateCapedBrepFromLoft(curveList, _tolerance[0]); + } + private List CreateFromEachColumnKind(string idSection, StbColumnKind_structure kind, IReadOnlyList sectionPoints) + { + List curveList; switch (kind) { case StbColumnKind_structure.RC: StbSecColumn_RC rcSec = _sections.StbSecColumn_RC.First(sec => sec.id == idSection); - object rcFigure = rcSec.StbSecFigureColumn_RC.Item; - curveList = SecRcColumnToCurves(rcFigure, sectionPoints); + curveList = SecRcColumnToCurves(rcSec.StbSecFigureColumn_RC.Item, sectionPoints); break; case StbColumnKind_structure.S: StbSecColumn_S sSec = _sections.StbSecColumn_S.First(sec => sec.id == idSection); - object[] sFigures = sSec.StbSecSteelFigureColumn_S.Items; - curveList = SecSteelColumnToCurves(sFigures, sectionPoints); + curveList = SecSteelColumnToCurves(sSec.StbSecSteelFigureColumn_S.Items, sectionPoints); break; case StbColumnKind_structure.SRC: StbSecColumn_SRC srcSec = _sections.StbSecColumn_SRC.First(sec => sec.id == idSection); - object srcFigure = srcSec.StbSecFigureColumn_SRC.Item; - curveList = SecRcColumnToCurves(srcFigure, sectionPoints); + curveList = SecRcColumnToCurves(srcSec.StbSecFigureColumn_SRC.Item, sectionPoints); break; case StbColumnKind_structure.CFT: case StbColumnKind_structure.UNDEFINED: - break; + throw new ArgumentException("Unsupported StbColumnKind"); default: throw new ArgumentOutOfRangeException(); } - Utils.RotateCurveList(memberAxis, curveList, rotate, sectionPoints); - Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0] - .CapPlanarHoles(_tolerance[0]); - return brep; + return curveList; } private static List SecRcColumnToCurves(object figure, IReadOnlyList sectionPoints) diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/Girder.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Girder.cs similarity index 95% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/Girder.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Girder.cs index c4aff3df..bb48bec1 100644 --- a/HoaryFox/Component/Utils/Geometry/BrepMaker/Girder.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Girder.cs @@ -17,7 +17,14 @@ public Girder(StbSections sections, IReadOnlyList tolerance) } public Brep CreateGirderBrep(string idSection, double rotate, StbGirderKind_structure kind, IReadOnlyList sectionPoints, Vector3d memberAxis) { - var curveList = new List(); + List curveList = CreateFromEachGirderKind(idSection, kind, sectionPoints); + Utils.RotateCurveList(memberAxis, curveList, rotate, sectionPoints); + return Utils.CreateCapedBrepFromLoft(curveList, _tolerance[0]); + } + + private List CreateFromEachGirderKind(string idSection, StbGirderKind_structure kind, IReadOnlyList sectionPoints) + { + List curveList; switch (kind) { case StbGirderKind_structure.RC: @@ -40,10 +47,7 @@ public Brep CreateGirderBrep(string idSection, double rotate, StbGirderKind_stru throw new ArgumentOutOfRangeException(); } - Utils.RotateCurveList(memberAxis, curveList, rotate, sectionPoints); - Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0] - .CapPlanarHoles(_tolerance[0]); - return brep; + return curveList; } diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs similarity index 100% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/GirderFigureToCurveList.cs diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/Slab.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Slab.cs similarity index 100% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/Slab.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Slab.cs diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/SteelSections.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/SteelSections.cs similarity index 100% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/SteelSections.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/SteelSections.cs diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/Utils.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs similarity index 82% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/Utils.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs index b0a4aab3..eaf830c2 100644 --- a/HoaryFox/Component/Utils/Geometry/BrepMaker/Utils.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Utils.cs @@ -53,6 +53,18 @@ public static void RotateCurveList(Vector3d rotateAxis, IReadOnlyList cur } } + public static Brep CreateCapedBrepFromLoft(List curveList, double tolerance) + { + Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0] + .CapPlanarHoles(tolerance); + if (brep.SolidOrientation == BrepSolidOrientation.Inward) + { + brep.Flip(); + } + brep.Faces.SplitKinkyFaces(); + return brep; + } + public enum SectionType { Column, diff --git a/HoaryFox/Component/Utils/Geometry/BrepMaker/Wall.cs b/HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Wall.cs similarity index 100% rename from HoaryFox/Component/Utils/Geometry/BrepMaker/Wall.cs rename to HoaryFox/RH7/Component/Utils/Geometry/BrepMaker/Wall.cs diff --git a/HoaryFox/Component/Utils/Geometry/CreateLineFromStb.cs b/HoaryFox/RH7/Component/Utils/Geometry/CreateLineFromStb.cs similarity index 100% rename from HoaryFox/Component/Utils/Geometry/CreateLineFromStb.cs rename to HoaryFox/RH7/Component/Utils/Geometry/CreateLineFromStb.cs diff --git a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs b/HoaryFox/RH7/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs similarity index 93% rename from HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs rename to HoaryFox/RH7/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs index c4a63c51..f740bf41 100644 --- a/HoaryFox/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs +++ b/HoaryFox/RH7/Component/Utils/Geometry/CreateMemberBrepListFromStb.cs @@ -270,15 +270,23 @@ private GH_Brep CreateSlabBrep(double depth, IList curveList, IEn Brep loftBrep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0]; Brep capedBrep = loftBrep.CapPlanarHoles(_tolerance[0]); - return capedBrep == null ? NonPlanarBrep(depth, curveList) : new GH_Brep(capedBrep); - } - else - { - Brep[] planarBrep = Brep.CreatePlanarBreps(new[] { curveList[0] }, _tolerance[0]); - return new GH_Brep(planarBrep != null - ? planarBrep[0] - : Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0])); + if (capedBrep == null) + { + return NonPlanarBrep(depth, curveList); + } + + if (capedBrep.SolidOrientation == BrepSolidOrientation.Inward) + { + capedBrep.Flip(); + } + capedBrep.Faces.SplitKinkyFaces(); + + return new GH_Brep(capedBrep); } + + return new GH_Brep(curveList[0].IsPlanar() + ? Brep.CreatePlanarBreps(curveList[0], _tolerance[0])[0] + : Brep.CreatePatch(new[] { curveList[0] }, 5, 5, _tolerance[0])); } private GH_Brep NonPlanarBrep(double depth, IList curveList) @@ -343,7 +351,17 @@ public GH_Structure Wall(IEnumerable walls) Vector3d normal = Vector3d.CrossProduct(centerCurve.TangentAtEnd, centerCurve.TangentAtStart); curveList[0] = new PolylineCurve(topPts.Select(pt => pt + normal * thickness / 2)); curveList[1] = new PolylineCurve(topPts.Select(pt => pt - normal * thickness / 2)); - brepList.Append(new GH_Brep(Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0])), new GH_Path(0, i)); + Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0]); + if (brep != null) + { + if (brep.SolidOrientation == BrepSolidOrientation.Inward) + { + brep.Flip(); + } + brep.Faces.SplitKinkyFaces(); + } + + brepList.Append(new GH_Brep(brep), new GH_Path(0, i)); } return brepList; diff --git a/HoaryFox/Component/Utils/Geometry/GeometryBaker.cs b/HoaryFox/RH7/Component/Utils/Geometry/GeometryBaker.cs similarity index 100% rename from HoaryFox/Component/Utils/Geometry/GeometryBaker.cs rename to HoaryFox/RH7/Component/Utils/Geometry/GeometryBaker.cs diff --git a/HoaryFox/Component/Utils/Geometry/SectionCornerPoints.cs b/HoaryFox/RH7/Component/Utils/Geometry/SectionCornerPoints.cs similarity index 100% rename from HoaryFox/Component/Utils/Geometry/SectionCornerPoints.cs rename to HoaryFox/RH7/Component/Utils/Geometry/SectionCornerPoints.cs diff --git a/HoaryFox/Component/Utils/TagUtils.cs b/HoaryFox/RH7/Component/Utils/TagUtils.cs similarity index 100% rename from HoaryFox/Component/Utils/TagUtils.cs rename to HoaryFox/RH7/Component/Utils/TagUtils.cs diff --git a/HoaryFox/RH7/HoaryFoxRH7.csproj b/HoaryFox/RH7/HoaryFoxRH7.csproj new file mode 100644 index 00000000..b93428f6 --- /dev/null +++ b/HoaryFox/RH7/HoaryFoxRH7.csproj @@ -0,0 +1,39 @@ + + + net48 + 2.0.2 + HoaryFox + This Component read ST-Bridge file(.stb) and display its model data. + .gha + hrntsm + true + HoaryFox + false + HoaryFox + + + + + + + + + + + + + C:\Program Files\Rhino 7\System\Rhino.exe + + Program + + + + none + false + + + + + + + \ No newline at end of file diff --git a/HoaryFox/RH7/HoaryFoxRH7Info.cs b/HoaryFox/RH7/HoaryFoxRH7Info.cs new file mode 100644 index 00000000..52f2d184 --- /dev/null +++ b/HoaryFox/RH7/HoaryFoxRH7Info.cs @@ -0,0 +1,21 @@ +using System; +using System.Drawing; +using Grasshopper.Kernel; + +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"; + } +} diff --git a/KarambaConnect/Common/KarambaConnectCommon.csproj b/KarambaConnect/Common/KarambaConnectCommon.csproj new file mode 100644 index 00000000..86dbe8b4 --- /dev/null +++ b/KarambaConnect/Common/KarambaConnectCommon.csproj @@ -0,0 +1,26 @@ + + + + net48 + + + + + True + True + Resource.resx + + + + + + PublicResXFileCodeGenerator + Resource.Designer.cs + + + + + none + false + + diff --git a/KarambaConnect/Common/Library/RH6_Karamba1/karamba.gha b/KarambaConnect/Common/Library/RH6_Karamba1/karamba.gha new file mode 100644 index 00000000..102beb4e Binary files /dev/null and b/KarambaConnect/Common/Library/RH6_Karamba1/karamba.gha differ diff --git a/KarambaConnect/Common/Library/RH6_Karamba1/karambaCommon.dll b/KarambaConnect/Common/Library/RH6_Karamba1/karambaCommon.dll new file mode 100644 index 00000000..6055ae47 Binary files /dev/null and b/KarambaConnect/Common/Library/RH6_Karamba1/karambaCommon.dll differ diff --git a/KarambaConnect/Common/Library/RH6_Karamba2/GH_IO.dll b/KarambaConnect/Common/Library/RH6_Karamba2/GH_IO.dll new file mode 100644 index 00000000..87145a31 Binary files /dev/null and b/KarambaConnect/Common/Library/RH6_Karamba2/GH_IO.dll differ diff --git a/KarambaConnect/Common/Library/RH6_Karamba2/Grasshopper.dll b/KarambaConnect/Common/Library/RH6_Karamba2/Grasshopper.dll new file mode 100644 index 00000000..e44427e0 Binary files /dev/null and b/KarambaConnect/Common/Library/RH6_Karamba2/Grasshopper.dll differ diff --git a/KarambaConnect/Common/Library/RH6_Karamba2/RhinoCommon.dll b/KarambaConnect/Common/Library/RH6_Karamba2/RhinoCommon.dll new file mode 100644 index 00000000..f29ca579 Binary files /dev/null and b/KarambaConnect/Common/Library/RH6_Karamba2/RhinoCommon.dll differ diff --git a/KarambaConnect/Common/Library/RH6_Karamba2/karamba.gha b/KarambaConnect/Common/Library/RH6_Karamba2/karamba.gha new file mode 100644 index 00000000..b9ba3219 Binary files /dev/null and b/KarambaConnect/Common/Library/RH6_Karamba2/karamba.gha differ diff --git a/KarambaConnect/Common/Library/RH6_Karamba2/karambaCommon.dll b/KarambaConnect/Common/Library/RH6_Karamba2/karambaCommon.dll new file mode 100644 index 00000000..4c6c9826 Binary files /dev/null and b/KarambaConnect/Common/Library/RH6_Karamba2/karambaCommon.dll differ diff --git a/KarambaConnect/Common/Library/RH7_Karamba1/karamba.gha b/KarambaConnect/Common/Library/RH7_Karamba1/karamba.gha new file mode 100644 index 00000000..5f80363e Binary files /dev/null and b/KarambaConnect/Common/Library/RH7_Karamba1/karamba.gha differ diff --git a/KarambaConnect/Common/Library/RH7_Karamba1/karambaCommon.dll b/KarambaConnect/Common/Library/RH7_Karamba1/karambaCommon.dll new file mode 100644 index 00000000..6055ae47 Binary files /dev/null and b/KarambaConnect/Common/Library/RH7_Karamba1/karambaCommon.dll differ diff --git a/KarambaConnect/Common/Library/RH7_Karamba2/karamba.gha b/KarambaConnect/Common/Library/RH7_Karamba2/karamba.gha new file mode 100644 index 00000000..67aeb1a7 Binary files /dev/null and b/KarambaConnect/Common/Library/RH7_Karamba2/karamba.gha differ diff --git a/KarambaConnect/Common/Library/RH7_Karamba2/karambaCommon.dll b/KarambaConnect/Common/Library/RH7_Karamba2/karambaCommon.dll new file mode 100644 index 00000000..4c6c9826 Binary files /dev/null and b/KarambaConnect/Common/Library/RH7_Karamba2/karambaCommon.dll differ diff --git a/KarambaConnect/Properties/Resource.Designer.cs b/KarambaConnect/Common/Properties/Resource.Designer.cs similarity index 88% rename from KarambaConnect/Properties/Resource.Designer.cs rename to KarambaConnect/Common/Properties/Resource.Designer.cs index 2b3479cd..84e589c7 100644 --- a/KarambaConnect/Properties/Resource.Designer.cs +++ b/KarambaConnect/Common/Properties/Resource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace KarambaConnect.Properties { +namespace KarambaConnectCommon.Properties { using System; @@ -22,7 +22,7 @@ namespace KarambaConnect.Properties { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resource { + public class Resource { private static global::System.Resources.ResourceManager resourceMan; @@ -36,10 +36,10 @@ internal Resource() { /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KarambaConnect.Properties.Resource", typeof(Resource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KarambaConnectCommon.Properties.Resource", typeof(Resource).Assembly); resourceMan = temp; } return resourceMan; @@ -51,7 +51,7 @@ internal Resource() { /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Resource() { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap AxisBuilder { + public static System.Drawing.Bitmap AxisBuilder { get { object obj = ResourceManager.GetObject("AxisBuilder", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -73,7 +73,7 @@ internal static System.Drawing.Bitmap AxisBuilder { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap ExportStb { + public static System.Drawing.Bitmap ExportStb { get { object obj = ResourceManager.GetObject("ExportStb", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -83,7 +83,7 @@ internal static System.Drawing.Bitmap ExportStb { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap FrameBuilder { + public static System.Drawing.Bitmap FrameBuilder { get { object obj = ResourceManager.GetObject("FrameBuilder", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -93,7 +93,7 @@ internal static System.Drawing.Bitmap FrameBuilder { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap NodeBuilder { + public static System.Drawing.Bitmap NodeBuilder { get { object obj = ResourceManager.GetObject("NodeBuilder", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -103,7 +103,7 @@ internal static System.Drawing.Bitmap NodeBuilder { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap SetFamilyName { + public static System.Drawing.Bitmap SetFamilyName { get { object obj = ResourceManager.GetObject("SetFamilyName", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -113,7 +113,7 @@ internal static System.Drawing.Bitmap SetFamilyName { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap StoryBuilder { + public static System.Drawing.Bitmap StoryBuilder { get { object obj = ResourceManager.GetObject("StoryBuilder", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -123,7 +123,7 @@ internal static System.Drawing.Bitmap StoryBuilder { /// /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 /// - internal static System.Drawing.Bitmap ToKaramba { + public static System.Drawing.Bitmap ToKaramba { get { object obj = ResourceManager.GetObject("ToKaramba", resourceCulture); return ((System.Drawing.Bitmap)(obj)); diff --git a/KarambaConnect/Properties/Resource.resx b/KarambaConnect/Common/Properties/Resource.resx similarity index 100% rename from KarambaConnect/Properties/Resource.resx rename to KarambaConnect/Common/Properties/Resource.resx diff --git a/KarambaConnect/Properties/launchSettings.json b/KarambaConnect/Common/Properties/launchSettings.json similarity index 100% rename from KarambaConnect/Properties/launchSettings.json rename to KarambaConnect/Common/Properties/launchSettings.json diff --git a/KarambaConnect/Resources/AxisBuilder.png b/KarambaConnect/Common/Resources/AxisBuilder.png similarity index 100% rename from KarambaConnect/Resources/AxisBuilder.png rename to KarambaConnect/Common/Resources/AxisBuilder.png diff --git a/KarambaConnect/Resources/AxisBuilder.svg b/KarambaConnect/Common/Resources/AxisBuilder.svg similarity index 100% rename from KarambaConnect/Resources/AxisBuilder.svg rename to KarambaConnect/Common/Resources/AxisBuilder.svg diff --git a/KarambaConnect/Resources/ExportStb.png b/KarambaConnect/Common/Resources/ExportStb.png similarity index 100% rename from KarambaConnect/Resources/ExportStb.png rename to KarambaConnect/Common/Resources/ExportStb.png diff --git a/KarambaConnect/Resources/ExportStb.xcf b/KarambaConnect/Common/Resources/ExportStb.xcf similarity index 100% rename from KarambaConnect/Resources/ExportStb.xcf rename to KarambaConnect/Common/Resources/ExportStb.xcf diff --git a/KarambaConnect/Resources/FrameBuilder.png b/KarambaConnect/Common/Resources/FrameBuilder.png similarity index 100% rename from KarambaConnect/Resources/FrameBuilder.png rename to KarambaConnect/Common/Resources/FrameBuilder.png diff --git a/KarambaConnect/Resources/FrameBuilder.svg b/KarambaConnect/Common/Resources/FrameBuilder.svg similarity index 100% rename from KarambaConnect/Resources/FrameBuilder.svg rename to KarambaConnect/Common/Resources/FrameBuilder.svg diff --git a/KarambaConnect/Resources/NodeBuilder.png b/KarambaConnect/Common/Resources/NodeBuilder.png similarity index 100% rename from KarambaConnect/Resources/NodeBuilder.png rename to KarambaConnect/Common/Resources/NodeBuilder.png diff --git a/KarambaConnect/Resources/NodeBuilder.svg b/KarambaConnect/Common/Resources/NodeBuilder.svg similarity index 100% rename from KarambaConnect/Resources/NodeBuilder.svg rename to KarambaConnect/Common/Resources/NodeBuilder.svg diff --git a/KarambaConnect/Resources/SetFamilyName.png b/KarambaConnect/Common/Resources/SetFamilyName.png similarity index 100% rename from KarambaConnect/Resources/SetFamilyName.png rename to KarambaConnect/Common/Resources/SetFamilyName.png diff --git a/KarambaConnect/Resources/SetFamilyName.svg b/KarambaConnect/Common/Resources/SetFamilyName.svg similarity index 100% rename from KarambaConnect/Resources/SetFamilyName.svg rename to KarambaConnect/Common/Resources/SetFamilyName.svg diff --git a/KarambaConnect/Resources/StoryBuilder.png b/KarambaConnect/Common/Resources/StoryBuilder.png similarity index 100% rename from KarambaConnect/Resources/StoryBuilder.png rename to KarambaConnect/Common/Resources/StoryBuilder.png diff --git a/KarambaConnect/Resources/StoryBuilder.svg b/KarambaConnect/Common/Resources/StoryBuilder.svg similarity index 100% rename from KarambaConnect/Resources/StoryBuilder.svg rename to KarambaConnect/Common/Resources/StoryBuilder.svg diff --git a/KarambaConnect/Resources/ToKaramba.png b/KarambaConnect/Common/Resources/ToKaramba.png similarity index 100% rename from KarambaConnect/Resources/ToKaramba.png rename to KarambaConnect/Common/Resources/ToKaramba.png diff --git a/KarambaConnect/Library/karamba132/karamba.gha b/KarambaConnect/Library/karamba132/karamba.gha deleted file mode 100644 index 4d64f821..00000000 Binary files a/KarambaConnect/Library/karamba132/karamba.gha and /dev/null differ diff --git a/KarambaConnect/Library/karamba132/karambaCommon.dll b/KarambaConnect/Library/karamba132/karambaCommon.dll deleted file mode 100644 index 007a79a0..00000000 Binary files a/KarambaConnect/Library/karamba132/karambaCommon.dll and /dev/null differ diff --git a/KarambaConnect/RH6K1/karambaConnectRH6K1.csproj b/KarambaConnect/RH6K1/karambaConnectRH6K1.csproj new file mode 100644 index 00000000..9261b7f6 --- /dev/null +++ b/KarambaConnect/RH6K1/karambaConnectRH6K1.csproj @@ -0,0 +1,60 @@ + + + + net48 + 2.0.2 + karambaConnect + HoaryFox karamba connect extension + .gha + hrntsm + false + false + true + false + karambaConnect + karambaConnect + karambaConnect + TRACE;karamba1 + + + + + + + + + + + + + + ..\Common\Library\RH6_Karamba1\karambaCommon.dll + false + + + ..\Common\Library\RH6_Karamba1\karamba.gha + false + + + + + + + + + + C:\Program Files\Rhino 6\System\Rhino.exe + + Program + + + + none + false + + + + + + + diff --git a/KarambaConnect/karambaConnectInfo.cs b/KarambaConnect/RH6K1/karambaConnectRHK1Info.cs similarity index 89% rename from KarambaConnect/karambaConnectInfo.cs rename to KarambaConnect/RH6K1/karambaConnectRHK1Info.cs index dfdd6b18..38114ee0 100644 --- a/KarambaConnect/karambaConnectInfo.cs +++ b/KarambaConnect/RH6K1/karambaConnectRHK1Info.cs @@ -4,7 +4,7 @@ namespace KarambaConnect { - public class KarambaConnectInfo : GH_AssemblyInfo + public class KarambaConnectRH7K1Info : GH_AssemblyInfo { public override string Name => "HoaryFox(karambaConnect)"; diff --git a/KarambaConnect/RH6K2/karambaConnectRH6K2.csproj b/KarambaConnect/RH6K2/karambaConnectRH6K2.csproj new file mode 100644 index 00000000..e6070165 --- /dev/null +++ b/KarambaConnect/RH6K2/karambaConnectRH6K2.csproj @@ -0,0 +1,76 @@ + + + + net48 + 2.0.2 + karambaConnect + HoaryFox karamba connect extension + .gha + hrntsm + false + false + true + false + karambaConnect + karambaConnect + karambaConnect + TRACE;karamba2 + + + + + + + + + + + + + ..\Common\Library\RH6_Karamba2\karambaCommon.dll + false + + + ..\Common\Library\RH6_Karamba2\karamba.gha + false + + + ..\Common\Library\RH6_Karamba2\GH_IO.dll + false + + + ..\Common\Library\RH6_Karamba2\Grasshopper.dll + false + + + ..\Common\Library\RH6_Karamba2\RhinoCommon.dll + false + + + + + + + + + + C:\Program Files\Rhino 6\System\Rhino.exe + + Program + + + + x64 + + + + x64 + none + false + + + + + + + diff --git a/KarambaConnect/RH6K2/karambaConnectRH6K2Info.cs b/KarambaConnect/RH6K2/karambaConnectRH6K2Info.cs new file mode 100644 index 00000000..38114ee0 --- /dev/null +++ b/KarambaConnect/RH6K2/karambaConnectRH6K2Info.cs @@ -0,0 +1,21 @@ +using System; +using System.Drawing; +using Grasshopper.Kernel; + +namespace KarambaConnect +{ + public class KarambaConnectRH7K1Info : GH_AssemblyInfo + { + public override string Name => "HoaryFox(karambaConnect)"; + + public override Bitmap Icon => null; + + public override string Description => "HoaryFox karamba connect extension"; + + public override Guid Id => new Guid("ffa60c17-4050-4232-96db-011eccbd402d"); + + public override string AuthorName => "hrntsm"; + + public override string AuthorContact => "contact@hrntsm.com"; + } +} diff --git a/KarambaConnect/RH7K1/karambaConnectRH7K1.csproj b/KarambaConnect/RH7K1/karambaConnectRH7K1.csproj new file mode 100644 index 00000000..dd36c1a8 --- /dev/null +++ b/KarambaConnect/RH7K1/karambaConnectRH7K1.csproj @@ -0,0 +1,60 @@ + + + + net48 + 2.0.2 + karambaConnect + HoaryFox karamba connect extension + .gha + hrntsm + false + false + true + false + karambaConnect + karambaConnect + karambaConnect + TRACE;karamba1 + + + + + + + + + + + + + + ..\Common\Library\RH7_Karamba1\karambaCommon.dll + false + + + ..\Common\Library\RH7_Karamba1\karamba.gha + false + + + + + + + + + + C:\Program Files\Rhino 7\System\Rhino.exe + + Program + + + + none + false + + + + + + + diff --git a/KarambaConnect/RH7K1/karambaConnectRH7K1Info.cs b/KarambaConnect/RH7K1/karambaConnectRH7K1Info.cs new file mode 100644 index 00000000..38114ee0 --- /dev/null +++ b/KarambaConnect/RH7K1/karambaConnectRH7K1Info.cs @@ -0,0 +1,21 @@ +using System; +using System.Drawing; +using Grasshopper.Kernel; + +namespace KarambaConnect +{ + public class KarambaConnectRH7K1Info : GH_AssemblyInfo + { + public override string Name => "HoaryFox(karambaConnect)"; + + public override Bitmap Icon => null; + + public override string Description => "HoaryFox karamba connect extension"; + + public override Guid Id => new Guid("ffa60c17-4050-4232-96db-011eccbd402d"); + + public override string AuthorName => "hrntsm"; + + public override string AuthorContact => "contact@hrntsm.com"; + } +} diff --git a/KarambaConnect/Component/IO/Convert2Karamba.cs b/KarambaConnect/RH7K2/Component/IO/Convert2Karamba.cs similarity index 98% rename from KarambaConnect/Component/IO/Convert2Karamba.cs rename to KarambaConnect/RH7K2/Component/IO/Convert2Karamba.cs index 81d8b1a6..cb6f91e9 100644 --- a/KarambaConnect/Component/IO/Convert2Karamba.cs +++ b/KarambaConnect/RH7K2/Component/IO/Convert2Karamba.cs @@ -7,8 +7,8 @@ using Karamba.Elements; using Karamba.GHopper.CrossSections; using Karamba.GHopper.Elements; -using KarambaConnect.Properties; using KarambaConnect.S2K; +using KarambaConnectCommon.Properties; using STBDotNet.v202; namespace KarambaConnect.Component.IO diff --git a/KarambaConnect/Component/IO/Export.cs b/KarambaConnect/RH7K2/Component/IO/Export.cs similarity index 99% rename from KarambaConnect/Component/IO/Export.cs rename to KarambaConnect/RH7K2/Component/IO/Export.cs index 2c96ed4c..1439b077 100644 --- a/KarambaConnect/Component/IO/Export.cs +++ b/KarambaConnect/RH7K2/Component/IO/Export.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Drawing; using Grasshopper.Kernel; -using KarambaConnect.Properties; +using KarambaConnectCommon.Properties; using STBDotNet.Serialization; using STBDotNet.v202; diff --git a/KarambaConnect/Component/IO/SetFamilyName.cs b/KarambaConnect/RH7K2/Component/IO/SetFamilyName.cs similarity index 98% rename from KarambaConnect/Component/IO/SetFamilyName.cs rename to KarambaConnect/RH7K2/Component/IO/SetFamilyName.cs index a5a60775..07e5e91e 100644 --- a/KarambaConnect/Component/IO/SetFamilyName.cs +++ b/KarambaConnect/RH7K2/Component/IO/SetFamilyName.cs @@ -1,8 +1,8 @@ using System; using System.Drawing; using Grasshopper.Kernel; -using KarambaConnect.Properties; using KarambaConnect.S2K; +using KarambaConnectCommon.Properties; namespace KarambaConnect.Component.IO { diff --git a/KarambaConnect/Component/StbBuilder/AxisBuilder.cs b/KarambaConnect/RH7K2/Component/StbBuilder/AxisBuilder.cs similarity index 97% rename from KarambaConnect/Component/StbBuilder/AxisBuilder.cs rename to KarambaConnect/RH7K2/Component/StbBuilder/AxisBuilder.cs index 17619046..bf785069 100644 --- a/KarambaConnect/Component/StbBuilder/AxisBuilder.cs +++ b/KarambaConnect/RH7K2/Component/StbBuilder/AxisBuilder.cs @@ -3,6 +3,7 @@ using System.Drawing; using System.Linq; using Grasshopper.Kernel; +using KarambaConnectCommon.Properties; using STBDotNet.v202; namespace KarambaConnect.Component.StbBuilder @@ -104,7 +105,7 @@ private static StbParallelAxis CreateParallelAxis(int count, IReadOnlyList Properties.Resource.AxisBuilder; + protected override Bitmap Icon => Resource.AxisBuilder; public override Guid ComponentGuid => new Guid("A09E1BF4-90FD-436D-8142-092894CE5D86"); } } diff --git a/KarambaConnect/Component/StbBuilder/FrameBuilderByAngle.cs b/KarambaConnect/RH7K2/Component/StbBuilder/FrameBuilderByAngle.cs similarity index 97% rename from KarambaConnect/Component/StbBuilder/FrameBuilderByAngle.cs rename to KarambaConnect/RH7K2/Component/StbBuilder/FrameBuilderByAngle.cs index 275474f8..b47b2843 100644 --- a/KarambaConnect/Component/StbBuilder/FrameBuilderByAngle.cs +++ b/KarambaConnect/RH7K2/Component/StbBuilder/FrameBuilderByAngle.cs @@ -3,6 +3,7 @@ using System.Linq; using Grasshopper.Kernel; using Karamba.GHopper.Models; +using KarambaConnectCommon.Properties; using Rhino.Geometry; using STBDotNet.v202; using Model = Karamba.Models.Model; @@ -51,7 +52,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) dataAccess.SetData(1, _sModel.StbSections); } - protected override Bitmap Icon => Properties.Resource.FrameBuilder; + protected override Bitmap Icon => Resource.FrameBuilder; public override Guid ComponentGuid => new Guid("38296D06-E47A-403F-BFE8-00E873A99CF8"); public override void DrawViewportWires(IGH_PreviewArgs args) diff --git a/KarambaConnect/Component/StbBuilder/NodeBuilder.cs b/KarambaConnect/RH7K2/Component/StbBuilder/NodeBuilder.cs similarity index 93% rename from KarambaConnect/Component/StbBuilder/NodeBuilder.cs rename to KarambaConnect/RH7K2/Component/StbBuilder/NodeBuilder.cs index 0de98099..4602d89b 100644 --- a/KarambaConnect/Component/StbBuilder/NodeBuilder.cs +++ b/KarambaConnect/RH7K2/Component/StbBuilder/NodeBuilder.cs @@ -2,6 +2,7 @@ using System.Drawing; using Grasshopper.Kernel; using Karamba.GHopper.Models; +using KarambaConnectCommon.Properties; using Model = Karamba.Models.Model; namespace KarambaConnect.Component.StbBuilder @@ -39,7 +40,7 @@ protected override void SolveInstance(IGH_DataAccess dataAccess) dataAccess.SetDataList(0, kModel.nodes.ToStb()); } - protected override Bitmap Icon => Properties.Resource.NodeBuilder; + protected override Bitmap Icon => Resource.NodeBuilder; public override Guid ComponentGuid => new Guid("D3FCFB17-E6C4-47D4-852A-24D92EC1EFEE"); } } diff --git a/KarambaConnect/Component/StbBuilder/StoryBuilder.cs b/KarambaConnect/RH7K2/Component/StbBuilder/StoryBuilder.cs similarity index 96% rename from KarambaConnect/Component/StbBuilder/StoryBuilder.cs rename to KarambaConnect/RH7K2/Component/StbBuilder/StoryBuilder.cs index f059d881..55ee6f7b 100644 --- a/KarambaConnect/Component/StbBuilder/StoryBuilder.cs +++ b/KarambaConnect/RH7K2/Component/StbBuilder/StoryBuilder.cs @@ -3,6 +3,7 @@ using System.Drawing; using System.Linq; using Grasshopper.Kernel; +using KarambaConnectCommon.Properties; using STBDotNet.v202; namespace KarambaConnect.Component.StbBuilder @@ -82,7 +83,7 @@ private static void CheckNodeIdsNull(StbNodeId[] nodeIds) } } - protected override Bitmap Icon => Properties.Resource.StoryBuilder; + protected override Bitmap Icon => Resource.StoryBuilder; public override Guid ComponentGuid => new Guid("438FB2A2-5EA8-474C-8897-5244AD00A188"); } } diff --git a/KarambaConnect/Convert.cs b/KarambaConnect/RH7K2/Convert.cs similarity index 100% rename from KarambaConnect/Convert.cs rename to KarambaConnect/RH7K2/Convert.cs diff --git a/KarambaConnect/K2S/K2SSecSteelItems.cs b/KarambaConnect/RH7K2/K2S/K2SSecSteelItems.cs similarity index 100% rename from KarambaConnect/K2S/K2SSecSteelItems.cs rename to KarambaConnect/RH7K2/K2S/K2SSecSteelItems.cs diff --git a/KarambaConnect/K2S/K2StbMemberItems.cs b/KarambaConnect/RH7K2/K2S/K2StbMemberItems.cs similarity index 100% rename from KarambaConnect/K2S/K2StbMemberItems.cs rename to KarambaConnect/RH7K2/K2S/K2StbMemberItems.cs diff --git a/KarambaConnect/K2S/K2StbModel.cs b/KarambaConnect/RH7K2/K2S/K2StbModel.cs similarity index 97% rename from KarambaConnect/K2S/K2StbModel.cs rename to KarambaConnect/RH7K2/K2S/K2StbModel.cs index 0cada688..3c6216d3 100644 --- a/KarambaConnect/K2S/K2StbModel.cs +++ b/KarambaConnect/RH7K2/K2S/K2StbModel.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using Karamba.Elements; -using Karamba.GHopper.Geometry; using Rhino.Geometry; using STBDotNet.v202; @@ -48,7 +47,9 @@ public StbModel SetByAngle(double colMaxAngle) { continue; } - var elemLine = new Line(_kModel.nodes[elem.node_inds[0]].pos.Convert(), _kModel.nodes[elem.node_inds[1]].pos.Convert()); + Karamba.Geometry.Point3 to = _kModel.nodes[elem.node_inds[0]].pos; + Karamba.Geometry.Point3 from = _kModel.nodes[elem.node_inds[1]].pos; + var elemLine = new Line(new Point3d(to.X, to.Y, to.Z), new Point3d(from.X, from.Y, from.Z)); double pAngle = Vector3d.VectorAngle(elemLine.Direction, Vector3d.ZAxis); double nAngle = Vector3d.VectorAngle(elemLine.Direction, -Vector3d.ZAxis); diff --git a/KarambaConnect/K2S/K2StbSecSteel.cs b/KarambaConnect/RH7K2/K2S/K2StbSecSteel.cs similarity index 100% rename from KarambaConnect/K2S/K2StbSecSteel.cs rename to KarambaConnect/RH7K2/K2S/K2StbSecSteel.cs diff --git a/KarambaConnect/K2S/K2StbSections.cs b/KarambaConnect/RH7K2/K2S/K2StbSections.cs similarity index 100% rename from KarambaConnect/K2S/K2StbSections.cs rename to KarambaConnect/RH7K2/K2S/K2StbSections.cs diff --git a/KarambaConnect/S2K/CroSecFamilyName.cs b/KarambaConnect/RH7K2/S2K/CroSecFamilyName.cs similarity index 100% rename from KarambaConnect/S2K/CroSecFamilyName.cs rename to KarambaConnect/RH7K2/S2K/CroSecFamilyName.cs diff --git a/KarambaConnect/S2K/CrossSection.cs b/KarambaConnect/RH7K2/S2K/CrossSection.cs similarity index 96% rename from KarambaConnect/S2K/CrossSection.cs rename to KarambaConnect/RH7K2/S2K/CrossSection.cs index e65575dd..2d9d5fff 100644 --- a/KarambaConnect/S2K/CrossSection.cs +++ b/KarambaConnect/RH7K2/S2K/CrossSection.cs @@ -35,7 +35,11 @@ public static List GetCroSec(StbSections sections, CroSecFamilyName fami { // TODO: 材軸の回転は未設定 var k3dCroSec = new List(); +#if karamba1 var sn400 = new FemMaterial_Isotrop("Steel", "SN400", 20500_0000, 8076_0000, 8076_0000, 78.5, 23_5000, 1.20E-05, Color.Brown); +#elif karamba2 + var sn400 = new FemMaterial_Isotrop("Steel", "SN400", 20500_0000, 8076_0000, 8076_0000, 78.5, 23_5000, 23_5000, FemMaterial.FlowHypothesis.mises, 1.20E-05, Color.Brown); +#endif k3dCroSec.AddRange(StbSecColumnRcToK3dCroSec(sections.StbSecColumn_RC)); k3dCroSec.AddRange(StbSecBeamRcToK3dCroSec(sections.StbSecBeam_RC)); @@ -47,13 +51,17 @@ public static List GetCroSec(StbSections sections, CroSecFamilyName fami private static List StbSecColumnRcToK3dCroSec(IEnumerable columns) { var k3dCroSecList = new List(); + if (columns == null) + { + return k3dCroSecList; + } foreach (StbSecColumn_RC column in columns) { string name; CroSec_Beam k3dCroSec; object figure = column.StbSecFigureColumn_RC.Item; - var material = Material.StbToRcFemMaterial(column.strength_concrete); + FemMaterial_Isotrop material = Material.StbToRcFemMaterial(column.strength_concrete); switch (figure) { case StbSecColumn_RC_Rect rect: @@ -80,11 +88,15 @@ private static List StbSecColumnRcToK3dCroSec(IEnumerable StbSecBeamRcToK3dCroSec(IEnumerable girders) { var k3dCroSecList = new List(); + if (girders == null) + { + return k3dCroSecList; + } foreach (StbSecBeam_RC girder in girders) { double width, depth; - var material = Material.StbToRcFemMaterial(girder.strength_concrete); + FemMaterial_Isotrop material = Material.StbToRcFemMaterial(girder.strength_concrete); object[] figures = girder.StbSecFigureBeam_RC.Items; switch (figures[0]) @@ -121,6 +133,10 @@ private static List StbSecBeamRcToK3dCroSec(IEnumerable g private static List StbSecSteelToK3dCroSec(StbSections sections, FemMaterial material, CroSecFamilyName familyName) { var k3dCroSecList = new List(); + if (sections.StbSecSteel == null) + { + return k3dCroSecList; + } SetRollHSection(sections, material, familyName, k3dCroSecList); SetBuildHSection(sections, material, familyName, k3dCroSecList); diff --git a/KarambaConnect/S2K/ElementBuilder.cs b/KarambaConnect/RH7K2/S2K/ElementBuilder.cs similarity index 100% rename from KarambaConnect/S2K/ElementBuilder.cs rename to KarambaConnect/RH7K2/S2K/ElementBuilder.cs diff --git a/KarambaConnect/RH7K2/S2K/Material.cs b/KarambaConnect/RH7K2/S2K/Material.cs new file mode 100644 index 00000000..23da7307 --- /dev/null +++ b/KarambaConnect/RH7K2/S2K/Material.cs @@ -0,0 +1,147 @@ +using System; +using System.Drawing; +using Karamba.Materials; + +namespace KarambaConnect.S2K +{ + public static class Material + { + public static FemMaterial_Isotrop[] DefaultRcMaterialArray() + { + // TODO: せん断弾性係数あってる? + return new FemMaterial_Isotrop[] + { +#if karamba1 + new FemMaterial_Isotrop("Concrete", "Fc18", RcYoungsModulus(18, 23.0), RcShareModulus(18, 23.0, 0.2), RcShareModulus(18, 23.0, 0.2), 24.0, 18_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc21", RcYoungsModulus(21, 23.0), RcShareModulus(21, 23.0, 0.2), RcShareModulus(21, 23.0, 0.2), 24.0, 21_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc24", RcYoungsModulus(24, 23.0), RcShareModulus(24, 23.0, 0.2), RcShareModulus(24, 23.0, 0.2), 24.0, 24_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc27", RcYoungsModulus(27, 23.0), RcShareModulus(27, 23.0, 0.2), RcShareModulus(27, 23.0, 0.2), 24.0, 27_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc30", RcYoungsModulus(30, 23.0), RcShareModulus(30, 23.0, 0.2), RcShareModulus(30, 23.0, 0.2), 24.0, 30_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc33", RcYoungsModulus(33, 23.0), RcShareModulus(33, 23.0, 0.2), RcShareModulus(33, 23.0, 0.2), 24.0, 33_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc36", RcYoungsModulus(36, 23.0), RcShareModulus(36, 23.0, 0.2), RcShareModulus(36, 23.0, 0.2), 24.0, 36_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc40", RcYoungsModulus(40, 23.5), RcShareModulus(40, 23.5, 0.2), RcShareModulus(40, 23.5, 0.2), 24.5, 40_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc42", RcYoungsModulus(42, 23.5), RcShareModulus(42, 23.5, 0.2), RcShareModulus(42, 23.5, 0.2), 24.5, 42_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc45", RcYoungsModulus(45, 23.5), RcShareModulus(45, 23.5, 0.2), RcShareModulus(45, 23.5, 0.2), 24.5, 45_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc50", RcYoungsModulus(50, 24.0), RcShareModulus(50, 24.0, 0.2), RcShareModulus(50, 24.0, 0.2), 25.0, 50_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc55", RcYoungsModulus(55, 24.0), RcShareModulus(55, 24.0, 0.2), RcShareModulus(55, 24.0, 0.2), 25.0, 55_0000, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc60", RcYoungsModulus(60, 24.0), RcShareModulus(60, 24.0, 0.2), RcShareModulus(60, 24.0, 0.2), 25.0, 60_0000, 1.00E-05, Color.Gray), +#elif karamba2 + new FemMaterial_Isotrop("Concrete", "Fc18", RcYoungsModulus(18, 23.0), RcShareModulus(18, 23.0, 0.2), RcShareModulus(18, 23.0, 0.2), 24.0, 18_0000, 1_8000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc21", RcYoungsModulus(21, 23.0), RcShareModulus(21, 23.0, 0.2), RcShareModulus(21, 23.0, 0.2), 24.0, 21_0000, 2_1000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc24", RcYoungsModulus(24, 23.0), RcShareModulus(24, 23.0, 0.2), RcShareModulus(24, 23.0, 0.2), 24.0, 24_0000, 2_4000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc27", RcYoungsModulus(27, 23.0), RcShareModulus(27, 23.0, 0.2), RcShareModulus(27, 23.0, 0.2), 24.0, 27_0000, 2_7000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc30", RcYoungsModulus(30, 23.0), RcShareModulus(30, 23.0, 0.2), RcShareModulus(30, 23.0, 0.2), 24.0, 30_0000, 3_0000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc33", RcYoungsModulus(33, 23.0), RcShareModulus(33, 23.0, 0.2), RcShareModulus(33, 23.0, 0.2), 24.0, 33_0000, 3_3000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc36", RcYoungsModulus(36, 23.0), RcShareModulus(36, 23.0, 0.2), RcShareModulus(36, 23.0, 0.2), 24.0, 36_0000, 3_6000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc40", RcYoungsModulus(40, 23.5), RcShareModulus(40, 23.5, 0.2), RcShareModulus(40, 23.5, 0.2), 24.5, 40_0000, 4_0000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc42", RcYoungsModulus(42, 23.5), RcShareModulus(42, 23.5, 0.2), RcShareModulus(42, 23.5, 0.2), 24.5, 42_0000, 4_2000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc45", RcYoungsModulus(45, 23.5), RcShareModulus(45, 23.5, 0.2), RcShareModulus(45, 23.5, 0.2), 24.5, 45_0000, 4_5000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc50", RcYoungsModulus(50, 24.0), RcShareModulus(50, 24.0, 0.2), RcShareModulus(50, 24.0, 0.2), 25.0, 50_0000, 5_0000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc55", RcYoungsModulus(55, 24.0), RcShareModulus(55, 24.0, 0.2), RcShareModulus(55, 24.0, 0.2), 25.0, 55_0000, 5_5000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), + new FemMaterial_Isotrop("Concrete", "Fc60", RcYoungsModulus(60, 24.0), RcShareModulus(60, 24.0, 0.2), RcShareModulus(60, 24.0, 0.2), 25.0, 60_0000, 6_0000, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray), +#endif + }; + } + + public static FemMaterial_Isotrop StbToRcFemMaterial(string stbStrengthFc) + { + double fc, gamma; + const double Nu = 0.2d; + + if (stbStrengthFc == null) + { + fc = 21; + gamma = 23; + } + else + { + // マッチしなかった場合は Fc21 相当で返す + switch (stbStrengthFc.ToLower()) + { + case "fc18": + fc = 18; + gamma = 23; + break; + case "fc21": + fc = 21; + gamma = 23; + break; + case "fc24": + fc = 24; + gamma = 23; + break; + case "fc27": + fc = 27; + gamma = 23; + break; + case "fc30": + fc = 30; + gamma = 23; + break; + case "fc33": + fc = 33; + gamma = 23; + break; + case "fc36": + fc = 36; + gamma = 23; + break; + case "fc40": + fc = 40; + gamma = 23.5; + break; + case "fc42": + fc = 42; + gamma = 23.5; + break; + case "fc45": + fc = 45; + gamma = 23.5; + break; + case "fc50": + fc = 50; + gamma = 24; + break; + case "fc55": + fc = 55; + gamma = 24; + break; + case "fc60": + fc = 60; + gamma = 24; + break; + default: + fc = 21; + gamma = 23; + break; + } + } + +#if karamba1 + return new FemMaterial_Isotrop("Concrete", stbStrengthFc, + RcYoungsModulus(fc, gamma), RcShareModulus(fc, gamma, Nu), RcShareModulus(fc, gamma, Nu), + gamma + 1, fc * 1000, 1.00E-05, Color.Gray); +#elif karamba2 + return new FemMaterial_Isotrop("Concrete", stbStrengthFc, + RcYoungsModulus(fc, gamma), RcShareModulus(fc, gamma, Nu), RcShareModulus(fc, gamma, Nu), + gamma + 1, fc * 1000, fc * 100, FemMaterial.FlowHypothesis.mises, 1.00E-05, Color.Gray); +#endif + } + + private static double RcYoungsModulus(double fc, double gamma) + { + // Karamba3D の単位に合わせて kN/cm2 + return 3.34 * Math.Pow(10, 4) * Math.Pow(gamma / 24, 2) * Math.Pow(fc / 60, 1 / 3d) * 1000; + } + + private static double RcShareModulus(double fc, double gamma, double poisson) + { + return RcYoungsModulus(fc, gamma) / (2 * (1 + poisson)); + } + + public static FemMaterial_Isotrop[] DefaultSteelMaterialArray() + { + throw new NotImplementedException(); + } + } +} diff --git a/KarambaConnect/RH7K2/karambaConnectRH7K2.csproj b/KarambaConnect/RH7K2/karambaConnectRH7K2.csproj new file mode 100644 index 00000000..88f55db1 --- /dev/null +++ b/KarambaConnect/RH7K2/karambaConnectRH7K2.csproj @@ -0,0 +1,60 @@ + + + + net48 + 2.0.2 + karambaConnect + HoaryFox karamba connect extension + .gha + hrntsm + false + false + true + false + karambaConnect + karambaConnect + karambaConnect + TRACE;karamba2 + + + + + + + + + + + + + + ..\Common\Library\RH7_Karamba2\karambaCommon.dll + false + + + ..\Common\Library\RH7_Karamba2\karamba.gha + false + + + + + C:\Program Files\Rhino 7\System\Rhino.exe + + Program + + + + x64 + + + + x64 + none + false + + + + + + + diff --git a/KarambaConnect/RH7K2/karambaConnectRH7K2Info.cs b/KarambaConnect/RH7K2/karambaConnectRH7K2Info.cs new file mode 100644 index 00000000..03ef28d9 --- /dev/null +++ b/KarambaConnect/RH7K2/karambaConnectRH7K2Info.cs @@ -0,0 +1,21 @@ +using System; +using System.Drawing; +using Grasshopper.Kernel; + +namespace KarambaConnect +{ + public class KarambaConnectRH7K2Info : GH_AssemblyInfo + { + public override string Name => "HoaryFox(karambaConnect)"; + + public override Bitmap Icon => null; + + public override string Description => "HoaryFox karamba connect extension"; + + public override Guid Id => new Guid("ffa60c17-4050-4232-96db-011eccbd402d"); + + public override string AuthorName => "hrntsm"; + + public override string AuthorContact => "contact@hrntsm.com"; + } +} diff --git a/KarambaConnect/S2K/Material.cs b/KarambaConnect/S2K/Material.cs deleted file mode 100644 index bbf30582..00000000 --- a/KarambaConnect/S2K/Material.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Drawing; -using Karamba.Materials; - -namespace KarambaConnect.S2K -{ - public static class Material - { - public static FemMaterial_Isotrop[] DefaultRcMaterialArray() - { - // TODO: せん断弾性係数あってる? - return new FemMaterial_Isotrop[] - { - new FemMaterial_Isotrop("Concrete", "Fc18", RcYoungsModulus(18, 23.0), RcShareModulus(18, 23.0, 0.2), RcShareModulus(18, 23.0, 0.2), 24.0, 18_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc21", RcYoungsModulus(21, 23.0), RcShareModulus(21, 23.0, 0.2), RcShareModulus(21, 23.0, 0.2), 24.0, 21_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc24", RcYoungsModulus(24, 23.0), RcShareModulus(24, 23.0, 0.2), RcShareModulus(24, 23.0, 0.2), 24.0, 24_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc27", RcYoungsModulus(27, 23.0), RcShareModulus(27, 23.0, 0.2), RcShareModulus(27, 23.0, 0.2), 24.0, 27_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc30", RcYoungsModulus(30, 23.0), RcShareModulus(30, 23.0, 0.2), RcShareModulus(30, 23.0, 0.2), 24.0, 30_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc33", RcYoungsModulus(33, 23.0), RcShareModulus(33, 23.0, 0.2), RcShareModulus(33, 23.0, 0.2), 24.0, 33_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc36", RcYoungsModulus(36, 23.0), RcShareModulus(36, 23.0, 0.2), RcShareModulus(36, 23.0, 0.2), 24.0, 36_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc40", RcYoungsModulus(40, 23.5), RcShareModulus(40, 23.5, 0.2), RcShareModulus(40, 23.5, 0.2), 24.5, 40_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc42", RcYoungsModulus(42, 23.5), RcShareModulus(42, 23.5, 0.2), RcShareModulus(42, 23.5, 0.2), 24.5, 42_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc45", RcYoungsModulus(45, 23.5), RcShareModulus(45, 23.5, 0.2), RcShareModulus(45, 23.5, 0.2), 24.5, 45_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc50", RcYoungsModulus(50, 24.0), RcShareModulus(50, 24.0, 0.2), RcShareModulus(50, 24.0, 0.2), 25.0, 50_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc55", RcYoungsModulus(55, 24.0), RcShareModulus(55, 24.0, 0.2), RcShareModulus(55, 24.0, 0.2), 25.0, 55_0000, 1.00E-05, Color.Gray), - new FemMaterial_Isotrop("Concrete", "Fc60", RcYoungsModulus(60, 24.0), RcShareModulus(60, 24.0, 0.2), RcShareModulus(60, 24.0, 0.2), 25.0, 60_0000, 1.00E-05, Color.Gray), - }; - } - - public static FemMaterial_Isotrop StbToRcFemMaterial(string stbStrengthFc) - { - double fc, gamma; - const double Nu = 0.2d; - // マッチしなかった場合は Fc21 相当で返す - switch (stbStrengthFc.ToLower()) - { - case "fc18": - fc = 18; - gamma = 23; - break; - case "fc21": - fc = 21; - gamma = 23; - break; - case "fc24": - fc = 24; - gamma = 23; - break; - case "fc27": - fc = 27; - gamma = 23; - break; - case "fc30": - fc = 30; - gamma = 23; - break; - case "fc33": - fc = 33; - gamma = 23; - break; - case "fc36": - fc = 36; - gamma = 23; - break; - case "fc40": - fc = 40; - gamma = 23.5; - break; - case "fc42": - fc = 42; - gamma = 23.5; - break; - case "fc45": - fc = 45; - gamma = 23.5; - break; - case "fc50": - fc = 50; - gamma = 24; - break; - case "fc55": - fc = 55; - gamma = 24; - break; - case "fc60": - fc = 60; - gamma = 24; - break; - default: - fc = 21; - gamma = 23; - break; - } - - return new FemMaterial_Isotrop("Concrete", stbStrengthFc, - RcYoungsModulus(fc, gamma), RcShareModulus(fc, gamma, Nu), RcShareModulus(fc, gamma, Nu), - gamma + 1, fc * 1000, 1.00E-05, Color.Gray); - } - - private static double RcYoungsModulus(double fc, double gamma) - { - // Karamba3D の単位に合わせて kN/cm2 - return 3.34 * Math.Pow(10, 4) * Math.Pow(gamma / 24, 2) * Math.Pow(fc / 60, 1 / 3d) * 1000; - } - - private static double RcShareModulus(double fc, double gamma, double poisson) - { - return RcYoungsModulus(fc, gamma) / (2 * (1 + poisson)); - } - - public static FemMaterial_Isotrop[] DefaultSteelMaterialArray() - { - throw new NotImplementedException(); - } - } -} diff --git a/KarambaConnect/karambaConnect.csproj b/KarambaConnect/karambaConnect.csproj deleted file mode 100644 index 9d4a19a4..00000000 --- a/KarambaConnect/karambaConnect.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - net48 - 1.0 - karambaConnect - Description of karambaConnect - .gha - hrntsm - true - true - true - - - - - - - - - - - Library\karamba132\karambaCommon.dll - false - - - Library\karamba132\karamba.gha - false - - - - - C:\Program Files\Rhino 6\System\Rhino.exe - - Program - - - diff --git a/README(JP).md b/README(JP).md index 638d29c3..f8988b5a 100644 --- a/README(JP).md +++ b/README(JP).md @@ -11,23 +11,24 @@ HoaryFox は 建築構造架構の可視化ツールです。 ST-Bridge file(.stb) を読み込んで、表示をします。 対応するデータの形式を一貫構造計算ソフトから出力されてる stb データとすることで、使用しているソフトに限らずモデルの生成ができ、かつ可視化用に別途モデリングする必要がないことが特徴です。 Rhino を使わないスタンドアロンのビューアが必要な場合は [STEVIA](https://github.com/hrntsm/STEVIA-Stb2U/wiki) を使ってみてください。 -試験的な機能としてモデルを Karamba3D へ変換する機能、および Karamba3D のモデルを ST-Bridge データとして出力する機能を追加しました。 +モデルを Karamba3D へ変換する機能、および Karamba3D のモデルを ST-Bridge データとして出力する機能を追加しました。 ## Install 1. Grasshopper 内で, File > Special Folders > Components folder を選択し、HoaryFox のフォルダをそこに保存します。 - - Karamba3D との連携機能を使う場合は、Karamba.gha のデータも上記フォルダに保存することを推奨します。 2. コンポーネントを右クリックし プロパティの中で、ブロックしない に設定する 3. Rhino を再起動する。 -## Usage +詳しいインストール方法は [ドキュメントサイトのインストール](https://hiron.dev/HoaryFox/docs/Usage/HowToInstall) を参照してください。 -詳しい使い方は [ドキュメントサイト](https://hiron.dev/HoaryFox/) を参照してください。 +## Usage STB Loader コンポーネントに ST-Bridge データのパスを入力することデータを Grasshopper 向けに変換し、それを各コンポーネント渡すことでコンポーネントに応じた図化がされます。 HoaryFox ver1.1 より ST-Bridge ver2.0 に対応しました。 Samples のフォルダ内にあるサンプルの Grasshopper データを参照してください。 +詳しい使い方は [ドキュメントサイト](https://hiron.dev/HoaryFox/) を参照してください。 + ## Karamba3D Integration ### Karamba3D への入力 diff --git a/README.md b/README.md index caadc46f..9c85335a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![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) -![CodeQL](https://img.shields.io/github/workflow/status/hrntsm/HoaryFox/CodeQL?label=CodeQL) [![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) @@ -18,14 +17,13 @@ As a experimental function, it creates an analytical model of Karamba from st-br 1. Download HoaryFox.gha file from [food4rhino](https://www.food4rhino.com/app/hoaryfox) or [release page](https://github.com/hrntsm/HoaryFox/releases) 2. In Grasshopper, choose File > Special Folders > Components folder. Save the gha file there. - + If you want to use Karamba3D convert, it is super recommended to save the HoaryFox directory in the same directory as Karamba.gha 3. Right-click the file > Properties > make sure there is no "blocked" text 4. Restart Rhino and Grasshopper -## Usage - Please see [the documentation site](https://hiron.dev/HoaryFox/) for detailed instructions. +## Usage + Input st-bridge file path, output some its tag data(StbColumn, StbGirder, StbPost, StbBeam, StbBrace, StbSlab). Support for ST-bridge ver2.0 is now available from HoaryFox ver1.1. @@ -33,6 +31,8 @@ If you need more information, send direct message to my twitter account. Please refer to Samples directory files. +Please see [the documentation site](https://hiron.dev/HoaryFox/) for detailed instructions. + ## Karamba3D Integration Conversion of data into Karamba3D supports only beam elements. diff --git a/Samples/Filter2LCA.gh b/Samples/Filter2LCA.gh new file mode 100644 index 00000000..bd570f0d Binary files /dev/null and b/Samples/Filter2LCA.gh differ diff --git a/website/docs/Changelog.md b/website/docs/Changelog.md index 6d7f126e..9bca4081 100644 --- a/website/docs/Changelog.md +++ b/website/docs/Changelog.md @@ -5,6 +5,41 @@ title: Changelog --- +## [v2.1.0 - 2021-12-29](https://github.com/hrntsm/HoaryFox/releases/tag/v2.1.0) + +### 追加 + +- LCA 解析への出力のためのフィルター機能を追加 + - MaterialType + - Story + - Filter by Material + +### 修正 + +- Karamba3D 連携で、断面形状が null のときエラーで止まっていたため修正 + +### 変更 + +- Stb to Brep コンポーネントで Brep を作成する方法を変更した。 + - これまでの方法では、体積が負になることがあったため Brep の法線を確認して体積が負になるならば面を反転する処理を追加した。 + - Planer の面にならないスラブに厚さを与えるようにした。 + +--- + +## [v2.0.1 - 2021-10-10](https://github.com/hrntsm/HoaryFox/releases/tag/v2.0.1) + +### 追加 + +- ウェブサイトに Algolia を使った検索バーを追加した + +### 修正 + +- デッキスラブとプレキャストスラブが含まれる場合、Brep の作成に失敗し Stb2Brep コンポーネントがエラーになる問題を修正 +- 2 断面の梁を Stb2Brep で変換する際のエラーを修正 + - これによって片側ハンチでもそれを反映した Brep が作成されるようになった + +--- + ## [v2.0.0 - 2021-09-17](https://github.com/hrntsm/HoaryFox/releases/tag/v2.0.0) ### 変更 @@ -13,7 +48,7 @@ title: Changelog - Stb2Brep、Stb2Line のコンポーネントの機能を使い Bake した際より多くの情報が Rhino での UserText として出力されるようにした - Stb2Brep で部材のハンチに対応した Brep が表示されるようにした - Tag コンポーネントはこれまで 中央断面等の代表断面のみを表示していたが、全ての断面情報が表示されるようにした - - SRC の場合は、RC形状、鉄骨形状 ともに出力される + - SRC の場合は、RC 形状、鉄骨形状 ともに出力される - 壁開口が非対応となった - Stb2Brep コンポーネントでスラブと壁を一枚のサーフェスではなく Closed Brep で出力するようにした - HoaryFox v1 のときは、Karamba3D から ST-Bridge に変換した際に、変換状況の概要がパネルで確認できたが、v2 では現状できなくなった @@ -24,11 +59,11 @@ title: Changelog - SlabNameTag, WallNameTag, SlabSectionTag, WallSectionTag の追加 - 軸の表示機能の追加 - Axis コンポーネントを使うことで、階情報、軸情報が出力される -- Karamba3D への変化の際、ST-Bridge 内での RC の材料名称に応じて Karamba3Dないでの材質を指定するようにした。 +- Karamba3D への変化の際、ST-Bridge 内での RC の材料名称に応じて Karamba3D ないでの材質を指定するようにした。 - 例えば材質が FC21 となっている場合、建築学会の基準に基づき FC21 相当の材料物性が入力される - 強度に応じてヤング率、せん断弾性係数、密度が変わる - 対応は fc18, 21, 24, 26, 30, 33, 36, 40, 42, 45, 50, 55, 60 でそれ以外は fc21 相当の材質で変換 - - 鋼材は強度以外は材質間で変化ないのですべてSN400扱い + - 鋼材は強度以外は材質間で変化ないのですべて SN400 扱い - Karamba3D データの ST-Bridge への変換出力がこれまでの ST-Bridge v1.4 準拠の内容から v2.0.2 準拠の内容に変更した ### その他 diff --git a/website/docs/Component/Filter.md b/website/docs/Component/Filter.md new file mode 100644 index 00000000..739678ce --- /dev/null +++ b/website/docs/Component/Filter.md @@ -0,0 +1,73 @@ +--- +id: Filter +title: Filter +--- + +データのフィルタリングを行うコンポーネントのカテゴリ + +--- + +## MaterialType + +![](../../images/Component/MaterialType.png) + +材料ごとの分類作成 + +|入力|説明| +|---|:---:| +|Data|読み取った ST-Bridge ファイルのデータ| + +|出力|説明| +|---|:---:| +|Columns|柱の材料情報| +|Girders|大梁の材料情報| +|Posts|間柱の材料情報| +|Beams|小柱の材料情報| +|Braces|ブレースの材料情報| +|Slabs|スラブの材料情報| +|Walls|壁の材料情報| + +--- + +## Story + +![](../../images/Component/Story.png) + +階ごとの分類作成 +柱、壁、ブレースの所属階は、所属節点の中で上部の節点が属する階を出力します。 + +|入力|説明| +|---|:---:| +|Data|読み取った ST-Bridge ファイルのデータ| + +|出力|説明| +|---|:---:| +|Columns|柱の階情報| +|Girders|大梁の階情報| +|Posts|間柱の階情報| +|Beams|小柱の階情報| +|Braces|ブレースの階情報| +|Slabs|スラブの階情報| +|Walls|壁の階情報| + +--- + +## Filter by Materials + +![](../../images/Component/FilterByMaterials.png) + +Stb to Brep で作成した Brep を材料、階情報ごとにフィルタリングする。 +階情報はブランチで反映する。 + +|入力|説明| +|---|:---:| +|Geometry|Stb to Brep で作成した Brep| +|Material|MaterialType で作成した材料情報| +|Story|Story で作成した階情報| + +|出力|説明| +|---|:---:| +|RC|材料が RC の Brep| +|S|材料が S の Brep| +|SRC|材料が SRC の Brep| +|CFT|材料が CFT の Brep| diff --git a/website/docs/Usage/BakeGeometry.md b/website/docs/Usage/BakeGeometry.md index 3a0355cb..f79939c9 100644 --- a/website/docs/Usage/BakeGeometry.md +++ b/website/docs/Usage/BakeGeometry.md @@ -22,6 +22,6 @@ Bake の入力に Button などを使用して True を入力すると Rhino へ Bake されたジオメトリには、メタ情報を追加しています。 ジオメトリを選択し、Properties の Attribute User Text を確認すると、断面サイズなどの値を確認することができるような BIM 的な機能になっています。 -なお、Rhino 側で UserText を編集してもモデルを Grasshopper 側へ反映することはできません。 +なお、Rhino 側で UserText を編集しても、モデルは Grasshopper 側へは反映されません。 ![](../../images/BakeGeometry/Bake.png) diff --git a/website/docs/Usage/HowToInstall.md b/website/docs/Usage/HowToInstall.md index 148529a5..02624001 100644 --- a/website/docs/Usage/HowToInstall.md +++ b/website/docs/Usage/HowToInstall.md @@ -11,28 +11,45 @@ HoaryFox のインストール方法について紹介します。 - HoaryFox のバージョン 2 以降は ST-Bridge のバージョン 2 のみの対応となります。 - ST-Bridge のバージョン 1 のデータを扱う場合は HoaryFox のバージョン 1.3 を使用してください。 1. ダウンロードした zip ファイルを右クリックしプロパティから全般のタブの中にあるセキュリティの項目を「許可する」にし、zip を解凍する -1. Grasshopper を起動して File > Special Folders > Components folder を選択することで表示されるフォルダに、1. でダウンロードしたファイルの中にある 「HoaryFox」 という名前のフォルダを入れる +1. Grasshopper を起動して File > Special Folders > Components folder を選択することで表示されるフォルダに、1. でダウンロードしたフォルダの中にある 「HoaryFox」 という名前のフォルダを入れる + - バージョン 2 からは Rhino と Karamba3D の組み合わせごとにフォルダが分かれています。ご使用の環境にあったものを選択してください。 1. Rhino を再起動する +以下のような形になります。 + +![](../../images/HowToInstall/installHoaryFox.jpg) + +:::note +うまく動作しない場合は 2. のやり忘れの場合が多いです。注意してください。 +::: + ## 動作環境 対応OS - Windows - Mac - - Apple silicon での動作は未確認 - Karamba3D 連携については、Mac 版の Karamba3D がないため動きません 対応バージョン - Rhino6 + - Karamba3D 1.3.3 + - Karamba3D 2.2.0 - Rhino7 + - Karamba3D 1.3.3 + - Karamba3D 2.2.0 ## Karamba3D との連携 -Karamba3D との連携機能を使う場合は Karamba.gha と同じフォルダに HoaryFox のフォルダを移動してください。 -Karamba.gha はデフォルトでは C:\Program Files\Rhino xx\Plugins\Karamba にあります。 +Karamba3D との連携機能を使う場合は Karamba.gha と同じフォルダに KarambaConnect フォルダ以下のファイルを移動してください。 +Karamba.gha はデフォルトでは C:\Program Files\Rhino xx\Plugins\Karamba (xx は Rhino のバージョン)にあります。 + +HoaryFox v2.1 を Rhino7 で使う場合は以下のようになります。 +連携機能を使用する場合は、HoaryFox v2.1 以降を使用することを推奨します。 + +![](../../images/HowToInstall/installKarambaConnect.png) :::note -連携が必要ない場合は、HoaryFoxのフォルダ内にある karambaConnect.gha ファイルを削除するとコンポーネントの読み込みエラーを回避できます。 +HoaryFox の場合と異なり上記のように **必ず** フォルダから出して直に karamba フォルダにファイルを入れてください。 ::: ## 各ソフトとの連携の概要 diff --git a/website/docs/Usage/LCAAnalysis.md b/website/docs/Usage/LCAAnalysis.md new file mode 100644 index 00000000..b2343686 --- /dev/null +++ b/website/docs/Usage/LCAAnalysis.md @@ -0,0 +1,85 @@ +--- +id: LCAAnalysis +title: Filtering & Analyze LCA +--- + +ST-Bridge のモデルを Grasshopper に読み込んで、LCA 解析を実行する方法を説明します。こちらの内容は Samples フォルダーの Filter2LCA.gh のモデルを参照してください。 + +この例では LCA 解析自体は [Cardinal LCA](https://www.food4rhino.com/en/app/cardinal-lca) というコンポーネントを使用して行うため、必要に応じてインストールしてください。 + +:::important +本機能は試験的な機能なので注意してください。 +::: + +## LCA 解析とは + +[Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%A9%E3%82%A4%E3%83%95%E3%82%B5%E3%82%A4%E3%82%AF%E3%83%AB%E3%82%A2%E3%82%BB%E3%82%B9%E3%83%A1%E3%83%B3%E3%83%88) より引用 + +> ライフサイクルアセスメント (life-cycle assessment: LCA) とは製品やサービスに対する、環境影響評価の手法のこと。 +> +>「環境アセスメント」では、主に大規模開発等による環境への影響を予め評価することを目的とするが、「ライフサイクルアセスメント」では、主に個別の商品の製造、輸送、販売、使用、廃棄、再利用までの各段階における環境負荷を明らかにし、その改善策をステークホルダーと伴に議論し検討する。 +> また、このような環境負荷の少ない商品の開発や設計については特に、『環境配慮設計』と呼ばれ、「環境工学」の一分野にもなっている。 +> +> また、代替製品や新製品の環境負荷を、既存の製品と比較し、より環境負荷の少ない製品、サービスへの切り替えを行う意思決定のツールでもある。 +> 近年では、カーボンフットプリントなど「環境負荷の見える化」のための指標を計算するためのツールとしても用いられている。 + +例えば日本建築学会では [LCA 小委員会](http://news-sv.aij.or.jp/tkankyo/s5/) が設置されており、「建築のLCA指針」などが発刊されています。 + +SNS を見ていると欧米では建築構造のプロポーザルに LCA 解析を行い、如何に環境負荷を構造でも考慮しているかに価値がおかれる場合があるような印象を受けました。 +そのため、それを日本でも行いやすくするための支援ツールとして試しに実装しました。 + +## Cardinal LCA について + +公式サイトは以下です。 +なお例としてこのコンポーネントを使用しているだけで、本サイトは結果の保証、使用の推奨をしているわけではありません。 +- [Cardinal LCA](https://www.cardinallca.com/#) + +使い方については、Food4Rhino に Demo ファイルがあるので、そちらを参照してください。 +基本的な使い方としては、計算したい材料の体積と LCA 解析に必要な材料パラメータを入力すると材料ごとに計算結果が出力されます。 + +デフォルトで材料情報は入っていますが、欧米向けの材料情報なので、例えば上記の日本建築学会の資料などを参考に対象建設地での LCA 解析に必要な材料情報を設定する必要があります。 + +## ST-Bridge ファイルを読み込み + +ファイルを開くと以下のようになっているため、path コンポーネントを右クリックし Select one existing file を選択し可視化したいstbファイルを選択してください。 +読み込みにエラーがない場合、その隣にある Load STB data コンポーネントでデータの変換が行われます。この出力を各可視化コンポーネントにつなぐことで Rhino のビューポート上に情報が可視化されます。 + +![](../../images/ShowStbModel/input.png) + +こちらで変換された Brep の体積を使用して LCA 解析を実行します。 + +:::important +ST-Bridge データには部材の形状、断面情報は含まれますが体積は含まれないため Brep の体積を Rhino の機能で求めて使用しています。 +例えば スラブ-梁部材、仕口などで Brep は重複する場合がありますが、重複分を引くといった処理はしていません。 +体積の正確性については確認の上、使用お願いいたします。 +::: + +## ジオメトリのフィルタリング + +Stb to Brep コンポーネントでは材料ごとに分類された出力ではないため、Filter by materials コンポーネントを使って材料ごとに Brep をフィルタリングします。 + +Material Type コンポーネントと Story コンポーネントを使うことで、 Brep のツリー構造と合わせた形で部材の材料情報、階情報を出力するので、その情報を Filter に入力することで、分類がされます。 +フィルターの結果は以下のようにツリー構造で出力されます。 + +![](../../images/LCAAnalysis/filter.png) + +各ブランチは階情報に対応しており、例えば {0;1} のデータは最初の階に属する部材、 {1;25} のデータは2つ目の階に属する部材を表します。 +Filter の 3 つ目の Story(Sts) の入力は任意になっており、 Story の入力がない場合は全て 0 のブランチに属するようになります。 + +このコンポーネントを使うことで、材質ごとに分類された Brep を取得します。 + +## 解析用材料の設定 + +Filter した Brep を Cardinal LCA の BrepImport コンポーネントに入力します。 +Name には適切な名前をつけてください。これが材料名になります。 + +材料は Cardinal LCA についている EC3 のデータベースの値を使用していますが、必要に応じて適切な値を設定してください。 + +![](../../images/LCAAnalysis/inputMaterial.png) + + +## 結果の可視化 + +材料ごとに作成した ReportInfo をまとめて Report コンポーネントに入力することでデータがまとめられグラフ化されます。 + +![](../../images/LCAAnalysis/result.png) \ No newline at end of file diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index b4225ac5..994c4d90 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -24,6 +24,10 @@ module.exports = { hideableSidebar: true, image: `img/HFicon.png`, metadates: [ + { + name: 'keywords', + content: 'BIM, ST-Bridge, Grasshopper, Rhinoceros, HoaryFox', + }, { name: `twitter:card`, content: `summary` diff --git a/website/i18n/en/docusaurus-plugin-content-docs/current/Changelog.md b/website/i18n/en/docusaurus-plugin-content-docs/current/Changelog.md index 5659b39c..b7e58d63 100644 --- a/website/i18n/en/docusaurus-plugin-content-docs/current/Changelog.md +++ b/website/i18n/en/docusaurus-plugin-content-docs/current/Changelog.md @@ -5,6 +5,41 @@ title: Changelog --- +## [v2.1.0 - 2021-12-29](https://github.com/hrntsm/HoaryFox/releases/tag/v2.1.0) + +### ADD + +- Added filtering for output to LCA analysis + - MaterialType + - Story + - Filter by Material + +### FIX + +- Karamba3D connection error stopped when the cross-sectional shape was null. + +### CHANGE + +- The method of creating a brep with the Stb to Brep component has been changed. + - In the previous method, the volume was sometimes negative, so we added a process to check the normal of the brep and flip the face if the volume is negative. + - Slabs that are not Planer faces are now given a thickness. + +--- + +## [v2.0.1 - 2021-10-10](https://github.com/hrntsm/HoaryFox/releases/tag/v2.0.1) + +### ADD + +- Added a search bar using Algolia to the website. + +### FIX + +- The Stb2Brep component to fail to create a Brep when a deck slab and a precast slab are included. +- Fixed an error when converting beams with two cross sections with Stb2Brep. + - This makes it possible to create a Brep that reflects the one-sided haunch. + +--- + ## [v2.0.0 - 2021-09-17](https://github.com/hrntsm/HoaryFox/releases/tag/v2.0.0) ### CHANGE @@ -66,7 +101,7 @@ title: Changelog - RC cross-section names have been changed from "Id + number" to BD- or CD- to indicate the cross-section size. - For example, BD-300x600. - The FrameBuilder using Karamba3D component has been separated into two parts: frame conversion and nodal conversion. - - Framebuilder by angle and NodeBuilderFrameBuilder + - Framebuilder by angle and NodeBuilderFrameBuilder - Allowed input of the angle for determining the column and beam when converting - Added text output to Rhino viewport to show results of the above decisions diff --git a/website/i18n/en/docusaurus-plugin-content-docs/current/Component/Filter.md b/website/i18n/en/docusaurus-plugin-content-docs/current/Component/Filter.md new file mode 100644 index 00000000..7c441439 --- /dev/null +++ b/website/i18n/en/docusaurus-plugin-content-docs/current/Component/Filter.md @@ -0,0 +1,73 @@ +--- +id: Filter +title: Filter +--- + +Categories of components for filtering data. + +--- + +## MaterialType + +![](../../images/Component/MaterialType.png) + +Create a category for each material. + +|Input|Explanation| +|---|:---:| +|Data|Load STB file Input the Data output of the component| + +|Output|Explanation| +|---|:---:| +|Columns|Material information for columns| +|Girders|Material information for girders| +|Posts|Material information for posts| +|Beams|Material information for beams| +|Braces|Material information for braces| +|Slabs|Material information for slabs| +|Walls|Material information for walls| + +--- + +## Story + +![](../../images/Component/Story.png) + +Creating Categories for Each Floor +The floors to which columns, walls, and braces belong are output as the floors to which the upper nodes belong among the nodes to which they belong. + +|Input|Explanation| +|---|:---:| +|Data|Load STB file Input the Data output of the component| + +|Output|Explanation| +|---|:---:| +|Columns|Floor information of the columns| +|Girders|Floor information of the girders| +|Posts|Floor information of the posts| +|Beams|Floor information of the beams| +|Braces|Floor information of the braces| +|Slabs|Floor information of the slabs| +|Walls|Floor information of the walls| + +--- + +## Filter by Materials + +![](../../images/Component/FilterByMaterials.png) + +Filter the brep created by Stb to Brep by material and floor information. +The floor information is implemented in the branch. + +|Input|Explanation| +|---|:---:| +|Geometry|Brep created with Stb to Brep| +|Material|Material information created by MaterialType| +|Story|Floor information created by Story| + +|Output|Explanation| +|---|:---:| +|RC|Brep with RC material| +|S|Brep with S material| +|SRC|Brep with SRC material| +|CFT|Brep with CFT material| diff --git a/website/i18n/en/docusaurus-plugin-content-docs/current/Component/Geometry.md b/website/i18n/en/docusaurus-plugin-content-docs/current/Component/Geometry.md index c5eca7a2..d9bcb863 100644 --- a/website/i18n/en/docusaurus-plugin-content-docs/current/Component/Geometry.md +++ b/website/i18n/en/docusaurus-plugin-content-docs/current/Component/Geometry.md @@ -22,8 +22,9 @@ Display a part as a Line | ------- | :------------------------------: | | Nodes | Output the Point3d list of nodes | | Columns | Output list of column lines | -| Posts | output list of intercolumn lines | -| Beams | Output list of small beam lines | +| Girders | Output list of girder lines | +| Posts | output list of post lines | +| Beams | Output list of beam lines | | Braces | output list of braces lines | ## Stb to Brep diff --git a/website/i18n/en/docusaurus-plugin-content-docs/current/Usage/LCAAnalysis.md b/website/i18n/en/docusaurus-plugin-content-docs/current/Usage/LCAAnalysis.md new file mode 100644 index 00000000..1c51b929 --- /dev/null +++ b/website/i18n/en/docusaurus-plugin-content-docs/current/Usage/LCAAnalysis.md @@ -0,0 +1,75 @@ +--- +id: LCAAnalysis +title: Filtering & Analyze LCA +--- + +This section explains how to load the ST-Bridge model into Grasshopper and run the LCA analysis. Please refer to the model Filter2LCA.gh in the Samples folder. + +In this example, the LCA analysis itself is done using a component called [Cardinal LCA](https://www.food4rhino.com/en/app/cardinal-lca), so please install it if necessary. + +:::important +Please note that this function is experimental. +::: + +## What is LCA Analysis? + +Quote from [Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%A9%E3%82%A4%E3%83%95%E3%82%B5%E3%82%A4%E3%82%AF%E3%83%AB%E3%82%A2%E3%82%BB%E3%82%B9%E3%83%A1%E3%83%B3%E3%83%88) + +> Life cycle assessment or LCA (also known as life cycle analysis) is a methodology for assessing environmental impacts associated with all the stages of the life cycle of a commercial product, process, or service. For instance, in the case of a manufactured product, environmental impacts are assessed from raw material extraction and processing (cradle), through the product's manufacture, distribution and use, to the recycling or final disposal of the materials composing it (grave). + +## About Cardinal LCA + +The official site is below. +Please note that we are using this component as an example only, and this site does not guarantee results or recommend its use. +- [Cardinal LCA](https://www.cardinallca.com/#) + +For more information on how to use it, please refer to the demo file available at Food4Rhino. +The basic usage is to input the volume of the material you want to calculate and the material parameters required for LCA analysis, and the calculation results will be output for each material. + +Material information is included by default, but since the material information is for Europe and the United States, it is necessary to set the material information necessary for LCA analysis at the target construction site by referring to the materials of the Architectural Institute of Japan mentioned above, for example. + +Translated with www.DeepL.com/Translator (free version) + +## Load the STB file + +When you open the file, it should look like this: Right-click on the path component and select Select one existing file, then select the stb file you want to visualize. +If there are no errors in loading, the Load STB data component next to it will convert the data. Connect this output to the visualization components to visualize the information in the Rhino viewport. + +![](../../images/ShowStbModel/input.png) + +Run the LCA analysis using the Brep volume converted here. + +:::important +The ST-Bridge data contains the shape and cross-sectional information of the member, but not the volume, so we use Rhino's functions to calculate the Brep volume. +For example, there may be overlapping Brep in slab-beam members and joints, but we do not subtract the overlap. +Please check the accuracy of the volumes before use. +::: + +## Filtering geometry + +Since the Stb to Brep component does not output a classification by material, we will use the Filter by materials component to filter the brep by material. + +By using the Material Type and Story components, the material and floor information of the member is output in a way that matches the tree structure of the brep, and this information can be input to the Filter to classify it. +The result of the filter is output in a tree structure as shown below. + +![](../../images/LCAAnalysis/filter.png) + +Each branch corresponds to a floor, e.g. {0;1} represents a member of the first floor, {1;25} represents a member of the second floor. +The input of the third Story(Sts) in the Filter is optional, and if there is no Story input, all the components will belong to the 0 branch. + +By using this component, we can get the Brep classified by material. + +## Setting material for analyze + +Enter the filtered brep into the BrepImport component of the Cardinal LCA. +Give the Name an appropriate name. This will be the material name. + +The material uses the value in the EC3 database attached to the Cardinal LCA, but you can set an appropriate value if necessary. + +![](../../images/LCAAnalysis/inputMaterial.png) + +## Visualize result + +By inputting the ReportInfo created for each material together into the Report component, the data is summarized and graphed. + +![](../../images/LCAAnalysis/result.png) diff --git a/website/i18n/en/docusaurus-plugin-content-docs/images/Component/FilterByMaterials.png b/website/i18n/en/docusaurus-plugin-content-docs/images/Component/FilterByMaterials.png new file mode 100644 index 00000000..69560cae Binary files /dev/null and b/website/i18n/en/docusaurus-plugin-content-docs/images/Component/FilterByMaterials.png differ diff --git a/website/i18n/en/docusaurus-plugin-content-docs/images/Component/MaterialType.png b/website/i18n/en/docusaurus-plugin-content-docs/images/Component/MaterialType.png new file mode 100644 index 00000000..88d07cfc Binary files /dev/null and b/website/i18n/en/docusaurus-plugin-content-docs/images/Component/MaterialType.png differ diff --git a/website/i18n/en/docusaurus-plugin-content-docs/images/Component/Story.png b/website/i18n/en/docusaurus-plugin-content-docs/images/Component/Story.png new file mode 100644 index 00000000..bebfc07f Binary files /dev/null and b/website/i18n/en/docusaurus-plugin-content-docs/images/Component/Story.png differ diff --git a/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/filter.png b/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/filter.png new file mode 100644 index 00000000..c7843ea3 Binary files /dev/null and b/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/filter.png differ diff --git a/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/inputMaterial.png b/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/inputMaterial.png new file mode 100644 index 00000000..881ab75f Binary files /dev/null and b/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/inputMaterial.png differ diff --git a/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/result.png b/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/result.png new file mode 100644 index 00000000..54e04504 Binary files /dev/null and b/website/i18n/en/docusaurus-plugin-content-docs/images/LCAAnalysis/result.png differ diff --git a/website/images/Component/FilterByMaterials.png b/website/images/Component/FilterByMaterials.png new file mode 100644 index 00000000..69560cae Binary files /dev/null and b/website/images/Component/FilterByMaterials.png differ diff --git a/website/images/Component/MaterialType.png b/website/images/Component/MaterialType.png new file mode 100644 index 00000000..88d07cfc Binary files /dev/null and b/website/images/Component/MaterialType.png differ diff --git a/website/images/Component/Story.png b/website/images/Component/Story.png new file mode 100644 index 00000000..bebfc07f Binary files /dev/null and b/website/images/Component/Story.png differ diff --git a/website/images/HowToInstall/installHoaryFox.jpg b/website/images/HowToInstall/installHoaryFox.jpg new file mode 100644 index 00000000..06fe8650 Binary files /dev/null and b/website/images/HowToInstall/installHoaryFox.jpg differ diff --git a/website/images/HowToInstall/installKarambaConnect.png b/website/images/HowToInstall/installKarambaConnect.png new file mode 100644 index 00000000..c2d99229 Binary files /dev/null and b/website/images/HowToInstall/installKarambaConnect.png differ diff --git a/website/images/LCAAnalysis/filter.png b/website/images/LCAAnalysis/filter.png new file mode 100644 index 00000000..c7843ea3 Binary files /dev/null and b/website/images/LCAAnalysis/filter.png differ diff --git a/website/images/LCAAnalysis/inputMaterial.png b/website/images/LCAAnalysis/inputMaterial.png new file mode 100644 index 00000000..881ab75f Binary files /dev/null and b/website/images/LCAAnalysis/inputMaterial.png differ diff --git a/website/images/LCAAnalysis/result.png b/website/images/LCAAnalysis/result.png new file mode 100644 index 00000000..54e04504 Binary files /dev/null and b/website/images/LCAAnalysis/result.png differ diff --git a/website/package-lock.json b/website/package-lock.json index 8068d1c2..6ac2c40b 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -2526,9 +2526,9 @@ } }, "algoliasearch-helper": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.5.5.tgz", - "integrity": "sha512-JDH14gMpSj8UzEaKwVkrqKOeAOyK0dDWsFlKvWhk0Xl5yw9FyafYf1xZPb4uSXaPBAFQtUouFlR1Zt68BCY0/w==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.6.2.tgz", + "integrity": "sha512-Xx0NOA6k4ySn+R2l3UMSONAaMkyfmrZ3AP1geEMo32MxDJQJesZABZYsldO9fa6FKQxH91afhi4hO1G0Zc2opg==", "requires": { "events": "^1.1.1" }, diff --git a/website/sidebars.js b/website/sidebars.js index 8c2661ab..5392e118 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -11,6 +11,7 @@ module.exports = { 'Usage/ConvertToKaramba', 'Usage/ExportSTB', 'Usage/BakeGeometry', + 'Usage/LCAAnalysis', ] }, { @@ -22,6 +23,7 @@ module.exports = { 'Component/NameTag', 'Component/SectionTag', 'Component/StbBuilder', + 'Component/Filter', ] }, 'Changelog', diff --git a/website/static/img/undraw_docusaurus_mountain.svg b/website/static/img/undraw_docusaurus_mountain.svg index 431cef2f..2f7802f1 100644 --- a/website/static/img/undraw_docusaurus_mountain.svg +++ b/website/static/img/undraw_docusaurus_mountain.svg @@ -1,170 +1,585 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/static/img/undraw_docusaurus_react.svg b/website/static/img/undraw_docusaurus_react.svg index e4170504..12dcb255 100644 --- a/website/static/img/undraw_docusaurus_react.svg +++ b/website/static/img/undraw_docusaurus_react.svg @@ -1,169 +1,540 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/static/img/undraw_docusaurus_tree.svg b/website/static/img/undraw_docusaurus_tree.svg index a05cc03d..c9beb3c3 100644 --- a/website/static/img/undraw_docusaurus_tree.svg +++ b/website/static/img/undraw_docusaurus_tree.svg @@ -1 +1,455 @@ -docu_tree \ No newline at end of file + + + + + + image/svg+xml + + + + + + + docu_tree + + + + + + + + + + + + + + + + + + + + + + + +