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

Implemented Fuselage Profile Type: Superellipse ( #1016) #1021

Merged
merged 36 commits into from
Oct 23, 2024

Conversation

merakulix
Copy link
Contributor

@merakulix merakulix commented Aug 27, 2024

Description

With the superellipse profile type, the CPACS standard profile type is now fully implemented.
The profile curves are generated using the functionality of the CFunctionToBSpline class with an implementation of the MathFunc3d interface.
As with the rectangle profile, this functionality means that profile curves require fewer knots than building a profile from point lists.

See also Issues #1016, #909. #1005 covered the rectangle type.

Changes in tiglcommonfunctions.* :

Added new global function that builds the wire which is needed to build profiles:

BuildWireSuperellipse(... , )

Uses the implementation of the MathFunc3d interface in an anonymos namespace:

SuperEllipse()

Changes in CCPACSFuselageProfile.* :

Added new member function that uses buildWireSuperellipse(..,) from tiglcommonfunctions.*:

BuildWiresSuperellipse(...,)

Changed member function:

BuildWires(...)

Added conditional statement to choose right method for building the wire, depending on profile type.

How Has This Been Tested?

The implementation hast been tested in Unit Tests, by creating test files, that include different test profiles, checking also the combination of different profile types with different parameters (e.g. hyper- and hypoellipses), guide curves and kinks:

new testfile:

  • testFuselageStandardProfileSuperellipse.cpp

used testdata:

  • simpletest_standard_profile_superellipse_guides.cpacs.xml
  • simpletest_standard_profile_superellipse_kink.cpacs.xml

Screenshots, that help to understand the changes:

Several ways to combine rectangular/superelliptic profile with guide curves or a profile with kinks:

testfile1
testfile1-2
testfile2-1
testfile2-2
testfile2-4

Checklist:

  • A test for the new functionality was added.
  • All tests run without failure.
  • The new code complies with the TiGL style guide.
  • New classes have been added to the Python interface.
  • API changes were documented properly in tigl.h.

@merakulix merakulix requested a review from joergbrech August 27, 2024 13:20
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 96.39640% with 4 lines in your changes missing coverage. Please review.

Project coverage is 69.47%. Comparing base (8870b8f) to head (077e04c).
Report is 37 commits behind head on master.

Files with missing lines Patch % Lines
src/common/tiglcommonfunctions.cpp 97.67% 2 Missing ⚠️
src/fuselage/CCPACSFuselageProfile.cpp 92.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1021      +/-   ##
==========================================
+ Coverage   69.36%   69.47%   +0.11%     
==========================================
  Files         301      301              
  Lines       26785    26889     +104     
==========================================
+ Hits        18579    18681     +102     
- Misses       8206     8208       +2     
Flag Coverage Δ
unittests 69.47% <96.39%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/common/tiglcommonfunctions.h 100.00% <ø> (ø)
src/common/tiglcommonfunctions.cpp 78.22% <97.67%> (+1.49%) ⬆️
src/fuselage/CCPACSFuselageProfile.cpp 85.31% <92.00%> (+1.66%) ⬆️

@merakulix merakulix marked this pull request as ready for review September 3, 2024 11:53
Copy link
Contributor

@joergbrech joergbrech left a comment

Choose a reason for hiding this comment

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

Just some minor changes. I checked your super ellipse points using matplotlib and they seem fine. The blue dots are the sampled points using your formulas, the green dots are the parametric form as provided on the Wikipedia page for superellipses.

grafik
superellipse_test.txt

src/fuselage/CCPACSFuselageProfile.cpp Outdated Show resolved Hide resolved
src/common/tiglcommonfunctions.cpp Outdated Show resolved Hide resolved
src/common/tiglcommonfunctions.h Outdated Show resolved Hide resolved
@joergbrech
Copy link
Contributor

The fuselages look awesome by the way :D

@joergbrech
Copy link
Contributor

Thanks @merakulix 💐

@joergbrech joergbrech merged commit 696581f into master Oct 23, 2024
17 checks passed
@joergbrech joergbrech deleted the superellipse branch October 23, 2024 13:48
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.

2 participants