Skip to content

Push of Free Polygonal Loads#129

Merged
peterjamesnugent merged 21 commits intodevelopfrom
RFEM6_Toolkit-#127-AddFreePolygonalLoads
Nov 10, 2025
Merged

Push of Free Polygonal Loads#129
peterjamesnugent merged 21 commits intodevelopfrom
RFEM6_Toolkit-#127-AddFreePolygonalLoads

Conversation

@Arne-Martensen
Copy link
Contributor

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:

  1. Push Panel Structure/Nodes
  2. Push AreaUniformlyDistributedLoad
  3. Pull AreaUniformlyDistributedLoad
  4. Check soundness of RFEM6 Model
  5. Check if Pushed and Pulled Model do match.
  6. Vary AreaUniformlyDistributedLoad preassure direction (Axis Parallel X, Y or Z) and Vary Axis (Local, Glabal) and Projected (True/False)

Changelog

  • Added Pull Method for AreaUniformlyDistributedLoad with added Polygon Parameter
  • Added Push Method for AreaUniformlyDistributedLoad with added Polygon Parameter

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.
@Arne-Martensen Arne-Martensen self-assigned this Nov 3, 2025
@Arne-Martensen Arne-Martensen added size:L Measured in days type:feature New capability or enhancement labels Nov 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 assigns X = secondCoordinate[i], Y = thirdCoordinate[i], Z = x where x is firstCoordinate. This should be X = 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.

Adds a warning if the AreaUniformlyDistributedLoad pressure vector is not parallel to any global axis, prompting users to verify the load direction.
@Arne-Martensen Arne-Martensen marked this pull request as ready for review November 4, 2025 08:12
DomiAcas
DomiAcas previously approved these changes Nov 5, 2025
Copy link

@DomiAcas DomiAcas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Arne-Martensen
Copy link
Contributor Author

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Nov 5, 2025

@Arne-Martensen to confirm, the following actions are now queued:

  • check ready-to-merge

There are 4 requests in the queue ahead of you.

Arne-Martensen and others added 8 commits November 5, 2025 10:46
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.
@Arne-Martensen
Copy link
Contributor Author

@BHoMBot check compliance

@Arne-Martensen
Copy link
Contributor Author

@BHoMBot check installer
@BHoMBot check core
@BHoMBot check serialisation
@BHoMBot check null-handling

@Arne-Martensen
Copy link
Contributor Author

@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.
Arne-Martensen and others added 5 commits November 5, 2025 15:36
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>
@Arne-Martensen
Copy link
Contributor Author

@BHoMBot check compliance

@Arne-Martensen
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link

Copilot AI commented Nov 5, 2025

@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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

@DomiAcas DomiAcas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@peterjamesnugent peterjamesnugent merged commit 949f6f7 into develop Nov 10, 2025
15 of 16 checks passed
@peterjamesnugent peterjamesnugent deleted the RFEM6_Toolkit-#127-AddFreePolygonalLoads branch November 10, 2025 09:10
@Arne-Martensen Arne-Martensen restored the RFEM6_Toolkit-#127-AddFreePolygonalLoads branch November 25, 2025 09:01
@BHoMBot BHoMBot mentioned this pull request Dec 15, 2025
@Arne-Martensen Arne-Martensen deleted the RFEM6_Toolkit-#127-AddFreePolygonalLoads branch February 17, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Measured in days type:feature New capability or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Push/Pull of Free Polgon Loads

5 participants