Fix #1386: geometry generation fails when creating a new CPACS file from the simpletest.cpacs.xml template#1387
Merged
Conversation
Contributor
PR RemindersThis PR has changes in
This is an automated reminder from CI |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1387 +/- ##
==========================================
- Coverage 73.22% 73.21% -0.02%
==========================================
Files 324 324
Lines 28567 28556 -11
==========================================
- Hits 20919 20908 -11
Misses 7648 7648
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
joergbrech
marked this pull request as ready for review
July 17, 2026 11:34
svengoldberg
approved these changes
Jul 17, 2026
svengoldberg
left a comment
Contributor
There was a problem hiding this comment.
Looks good and also like an elegant solution to me!
Just a small annotation here, although it does not belong to the present changes
svengoldberg
deleted the
1386-geometry-generation-fails-when-creating-a-new-cpacs-file-from-the-simpletestcpacsxml-template
branch
July 17, 2026 13:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1386.
Opening the TIGLCreator template
TIGLCreator/data/templates/simpletest.cpacs.xmlfailed to generate geometry after #1367 switched the template's fuselage "Circle" profile from apointListto astandardProfile/rectangle(heightToWidthRatio=1,cornerRadius=0.5).That combination is the degenerate limit where a rounded rectangle becomes a pure circle: all four straight edges of the rectangle collapse to zero length.
BuildWireRectangle(src/common/tiglcommonfunctions.cpp) didn't special-case this, so it still built a zero-length line segment for each straight edge and fed it intoCTiglBSplineAlgorithms::concatCurvesalongside the four quarter-circle arcs. Concatenating those degenerate segments produced knots that ended up closer together than OpenCASCADE's internal tolerance, and OCCT throwsStandard_Failure: BSpline curve: Knots interval values too close.Fix:
BuildWireRectanglenow skips adding a straight edge whenever its two endpoints coincide, instead of feeding a zero-length segment through the interpolation/concatenation pipeline. At the circle limit this correctly reduces to a wire built purely from the four quarter-circle arcs.Finally, the scaling of the fuselage had to be adapted to obtain the same Sodacan-geometry we are all accustomed to. With the standard profile the radius was decreased.
How Has This Been Tested?
TiglCommonFunctions.BuildWireRectangle_FullCircleLimitintests/unittests/tiglCommonFunctions.cpp, which reproduces the exact degenerate input (heightToWidthRatio=1,cornerRadius=0.5) used by the template. Before the fix this test throwsStandard_Failure: BSpline curve: Knots interval values too close; after the fix it builds a valid, closed wire and lofts successfully.TIGLCreator/data/templates/simpletest.cpacs.xmldirectly and building both the fuselage and wing lofts — both now produce valid geometry (BRepCheck_Analyzer(...).IsValid()).pixi run -e default unittests): all 899 tests pass, no regressions (including the existingFuselageStandardProfile.*andTiglCommonFunctions.BuildWireRectangle_*cases covering non-degenerate rectangle/rounded-rectangle profiles).Screenshots, that help to understand the changes(if applicabl
N/A (non-visual fix in geometry construction code).
Checklist for PR Author:
ChangeLog.mdupdated