DLR-SC / tigl

The TiGL Geometry Library to process aircraft geometries in pre-design.
https://dlr-sc.github.io/tigl/
Apache License 2.0
231 stars 60 forks source link

Fix for hard crash if guiceCurves node is present but empty in wing segment #984

Closed joergbrech closed 6 months ago

joergbrech commented 7 months ago

Fixes #962

Description

This PR adds an internal check if an std::vector is empty before trying to access elements. As a consequence, the wing loft and segment loft will be build just as if there were no guide curves defined.

Note that CPACS 3.3 requires the guideCurves node to be nonempty. We are less restrictive here.

How Has This Been Tested?

A new test has been added

Screenshots, that help to understand the changes(if applicable):

Not applicable

Checklist:

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7671d7e) 68.90% compared to head (5c645fc) 68.91%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/DLR-SC/tigl/pull/984/graphs/tree.svg?width=650&height=150&src=pr&token=8b0i0TsOw6&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DLR-SC)](https://app.codecov.io/gh/DLR-SC/tigl/pull/984?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DLR-SC) ```diff @@ Coverage Diff @@ ## master #984 +/- ## ======================================= Coverage 68.90% 68.91% ======================================= Files 298 299 +1 Lines 26479 26483 +4 ======================================= + Hits 18246 18250 +4 Misses 8233 8233 ``` | [Files](https://app.codecov.io/gh/DLR-SC/tigl/pull/984?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DLR-SC) | Coverage Δ | | |---|---|---| | [src/guide\_curves/CCPACSGuideCurves.cpp](https://app.codecov.io/gh/DLR-SC/tigl/pull/984?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DLR-SC#diff-c3JjL2d1aWRlX2N1cnZlcy9DQ1BBQ1NHdWlkZUN1cnZlcy5jcHA=) | `62.96% <100.00%> (+1.42%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/DLR-SC/tigl/pull/984/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DLR-SC)
joergbrech commented 6 months ago

@AntonReiswich, I just rebased this on master, so that hopefully the MacOS tests will succeed as well.

joergbrech commented 6 months ago

💩 Some linker error on linux now...I will investigate...

EDIT: This happens on master as well ☹️

joergbrech commented 6 months ago

💩 Some linker error on linux now...I will investigate...

EDIT: This happens on master as well ☹️

I wonder if the PR https://github.com/DLR-SC/tigl-conda/pull/29 is responsible? This is the only change yesterday that I can make out which could potentially influence the build job here.

tigl-conda uses ubuntu-latest, aka Ubuntu 22.04. Maybe the newly built packages introduce a glibc incompatibility?

See also

EDIT 2:

Let's see if this helps: https://github.com/DLR-SC/tigl-conda/pull/35

joergbrech commented 6 months ago

Fixed with https://github.com/DLR-SC/tigl-conda/pull/36. This is ready for review again