Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tigl wing get segment upper surface area trimmed #960

Merged
merged 6 commits into from
Apr 24, 2023

Conversation

AntonReiswich
Copy link
Contributor

@AntonReiswich AntonReiswich commented Apr 24, 2023

Closes #961

Bug Description

The API function tiglWingGetSegmentUpperSurfaceAreaTrimmed(...) terminated with return code 1, when passing the valid arguments (tiglHandle, 1, 1, 0, 0, 0, 1, 0.05, 1, 0.05, 0, double*ReturnValue).

Bug Analysis

This bug arises due to the fact that the implementation of the mentioned function contained a cast from TopoDS_Compound to a TopoDS_Face. As the used test data configuration has the property, that both its upper and lower wing consists of more than one face, respectively, arising through the use of additional guide curves, both the upper and lower wing are given by compounds containing more than one element, respectively. Trying to cast each of these compounds to a face yields an error.

The bug originates due to the fact that earlier, both upper and lower wings consisted of only one face, respectively. Hence, the mentioned conversion was not a problem.

Bug Fix

It has been fixed by avoiding these falsy conversions by minor refactoring of the code.

How Has This Been Tested?

Two unit tests have been added: One test for the correct return value of the above API function, and the second giving a roughly estimated check if the computed area leads to the right value.

@AntonReiswich AntonReiswich self-assigned this Apr 24, 2023
@AntonReiswich
Copy link
Contributor Author

@joergbrech Thanks for finding and fixing this bug! I took your fix and created this PR with it.

@codecov-commenter
Copy link

Codecov Report

Merging #960 (55bf1bc) into master (9ee8277) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #960      +/-   ##
==========================================
- Coverage   68.76%   68.75%   -0.01%     
==========================================
  Files         299      299              
  Lines       26483    26481       -2     
==========================================
- Hits        18210    18208       -2     
  Misses       8273     8273              
Impacted Files Coverage Δ
src/wing/CCPACSWingSegment.cpp 84.24% <100.00%> (-0.06%) ⬇️

@joergbrech joergbrech merged commit 17a60de into master Apr 24, 2023
@joergbrech joergbrech deleted the fix_tiglWingGetSegmentUpperSurfaceAreaTrimmed branch April 24, 2023 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix bug in API function "tiglWingGetSegmentUpperSurfaceAreaTrimmed"
3 participants