Push of Free Polygonal Loads#129
Conversation
Implemented reading and conversion of RFEM6 free polygon loads as AreaUniformlyDistributedLoad objects. Added ReadPolygonLoad method and FromRFEM conversion for free_polygon_load, including handling of load direction, axis, and projection. Updated unit test to enable pulling panels for verification.
Added logic to extract and construct polygon geometry from RFEM6 polygon load data, handling different projection types. The resulting polygon is now attached to AreaUniformlyDistributedLoad objects. Also added a unit test for pulling uniformly distributed area loads and commented out a redundant panel push in test setup.
Introduces handling of AreaUniformlyDistributedLoad objects with Polygon custom data. Adds CreateLoad_Polygon method and ToRFEM6_Polygon extension to convert and assign polygonal area loads to RFEM6, supporting different plane orientations and load directions.
Updated the logic to assign the load_projection value according to the orientation of the polygon's fit plane, ensuring correct projection for XY, XZ, or YZ planes. This replaces the previous hardcoded value and improves accuracy for different polygon orientations.
Wrapped the CreateLoad_Polygon logic in a try-catch block to record errors when load creation fails, such as when the polygon is non-planar or not parallel to principal planes. This improves robustness and provides clearer error reporting.
Added warnings in Load.cs to notify users when the 'Projected' option is set for area loads with the Local axis, as this combination is not supported and will be ignored. Also removed commented-out code in Panel.cs and filtered out invalid line numbers in RFEMLine.cs.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for free polygon loads in the RFEM6 adapter, enabling conversion between BHoM's AreaUniformlyDistributedLoad with polygon geometry and RFEM6's free_polygon_load type.
- Implements bidirectional conversion methods for free polygon loads
- Adds logic to detect polygon-based area loads via CustomData
- Updates read/create methods to handle polygon loads separately from standard surface loads
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 24 comments.
Show a summary per file
| File | Description |
|---|---|
| RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs | Adds ToRFEM6_Polygon method to convert BHoM area loads with polygon geometry to RFEM6 free polygon loads |
| RFEM6_Adapter/Convert/FromRFEM6/BHoMDataStructure/Loading/Load.cs | Adds FromRFEM method to convert RFEM6 free polygon loads back to BHoM area loads with polygon data |
| RFEM6_Adapter/Convert/FromRFEM6/BHoMDataStructure/Geometry/Panel.cs | Removes commented-out code |
| RFEM6_Adapter/CRUD/Read/IntermediateDatastructure/RFEMLine.cs | Filters line numbers to exclude non-positive IDs |
| RFEM6_Adapter/CRUD/Read/BHoMDataStructure/Loading/Load.cs | Extends ReadAreaLoad to include free polygon loads and adds new ReadPolygonLoad method |
| RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs | Routes polygon-based area loads to the polygon-specific create method |
| .ci/unit-tests/RFEM_Toolkit_Test/BHoMDataStructure/Loading/UniformlyDistributedAreaLoad.cs | Comments out panel push in setup and adds new incomplete test for pulling loads |
| .ci/unit-tests/RFEM_Toolkit_Test/BHoMDataStructure/Geometry/Panel/Panel.cs | Comments out panel push and uncomments panel pull code |
Comments suppressed due to low confidence (3)
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs:1
- Coordinate mapping inconsistency: For the default case (LOAD_PROJECTION_XZ_OR_UW), in ToRFEM6_Polygon the coordinates are mapped as
[v.X, v.Z](lines 282), but in FromRFEM the reverse mapping assignsX = secondCoordinate[i], Y = thirdCoordinate[i], Z = xwherexis firstCoordinate. This should beX = x, Y = thirdCoordinate[i], Z = secondCoordinate[i]to be consistent with the forward conversion.
/*
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs:292
- This assignment to r is useless, since its value is never read.
free_polygon_load_load_location_row r = new free_polygon_load_load_location_row() { row = k };
RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs:255
- Generic catch clause.
} catch {
BH.Engine.Base.Compute.RecordError($"The creation of {bhLoad} failed.\nA potential cause is that the applied polygon is non-planar or not parallel to the XY, YZ, or ZX plane.");
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
RFEM6_Adapter/Convert/FromRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Outdated
Show resolved
Hide resolved
Adds a warning if the AreaUniformlyDistributedLoad pressure vector is not parallel to any global axis, prompting users to verify the load direction.
DomiAcas
left a comment
There was a problem hiding this comment.
Tested the feature using the provided Grasshopper (.gh) script and created polygonal loads with varying directions and axes, including both projected and non-projected load types in RFEM6. Pulled loads back to .gh environment from the RFEM6 softare and checked if Pushed and Pulled Model match. The check deemed the feature successful.
|
@BHoMBot check ready-to-merge |
|
@Arne-Martensen to confirm, the following actions are now queued:
There are 4 requests in the queue ahead of you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Corrected the typo from 'polgon' to 'polygon' in multiple places and added assignment of 'loadProjection' based on the polygon's fit plane orientation.
|
@BHoMBot check compliance |
|
@BHoMBot check compliance |
Corrected spelling errors in log messages and standardized the variable name from 'loadMagintude' to 'loadMagnitude' in the Load.cs files for improved code clarity and consistency.
Deleted the ReadPolygonLoad method from Load.cs as it is no longer needed. This helps clean up the codebase and removes dead code.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…thub.com/BHoM/RFEM6_Toolkit into RFEM6_Toolkit-#127-AddFreePolygonalLoads
|
@BHoMBot check compliance |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@Arne-Martensen I've opened a new pull request, #132, to work on those changes. Once the pull request is ready, I'll request review from you. |
DomiAcas
left a comment
There was a problem hiding this comment.
Tested the feature again using the provided Grasshopper (.gh) script and created polygonal loads with varying directions and axes, including both projected and non-projected load types in RFEM6. Pulled loads back to .gh environment from the RFEM6 softare and checked if Pushed and Pulled Model match. The check deemed the feature successful.
Issues addressed by this PR
Closes #127
This PR is aming to add the feature for Pushing/Pulling Free Polygonal Loads to/from RFEM6.
Test files
Test File
For the testing please do the following:
Changelog