1388 crash when usind draw fused aircraft triangulation#1389
Open
joergbrech wants to merge 5 commits into
Open
1388 crash when usind draw fused aircraft triangulation#1389joergbrech wants to merge 5 commits into
joergbrech wants to merge 5 commits into
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 #1389 +/- ##
==========================================
+ Coverage 73.21% 73.23% +0.01%
==========================================
Files 324 324
Lines 28556 28563 +7
==========================================
+ Hits 20908 20918 +10
+ Misses 7648 7645 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
5 tasks
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 #1388.
Fusing the whole aircraft (
Draw -> Aircraft -> Fused aircraft triangulation (slow)in TiGLCreator) crashed with:This had two causes, both fixed here:
Fuse aborted on components without geometry.
CTiglElementGeometryBuilder::BuildShape()threw whenever a system or deck component (e.g. a lavatory or ceiling panel) had no<geometry>primitives defined. This is a perfectly valid CPACS state — all primitive lists inside<geometry>are optional, so an element can legitimately be described by mass properties only. BuildShape()now returns a null shape in that case instead of throwing, consistent with how the rest of the codebase already treats "no shape" (e.g. ducts, mirrored lofts, far field,CFuseShapes/CGroupShapes` already skip null shapes when aggregating).The two call sites that genuinely need a shape to do their job —
CCPACSComponent::GetCentroidLocal()and theBuildMass()implementations inCCPACSComponentandCCPACSDeckComponentBase(for volume-based mass/CoG) — now explicitlycheck for the missing geometry and report a precise error there instead, rather than the fuse
algorithm blowing up mid-way through an unrelated multi-minute operation.
2.Uncaught exception in TiGLCreator.
TIGLCreatorDocument::drawFusedAircraftTriangulation()never caught exceptions from the fusing algorithm, so any remainingCTiglError(or any other exception) would terminate the whole application. It now wraps the fuse call in the sametry/catchused bydrawFusedAircraft(), showing an error dialog instead of crashing.How Has This Been Tested?
InvalidSystems.ElementWithoutGeometryHasNoLoft(tests/unittests/tiglSystems.cpp): confirmsGetLoft()on a system component without geometry returns a null shape instead of throwing.InvalidSystems.InvalidSystemMassProperties: the "no geometry" case now surfaces as a precise "zero volume" error from the mass computation (which genuinely needs a shape) instead of an opaque "no geometry primitives" error from loft building.Decks.ComponentWithoutGeometryHasNoLoftand, most importantly,Decks.FusingToleratesComponentWithoutGeometry(tests/unittests/tiglDecks.cpp), an end-to-end regression test that fuses a small aircraft (TestData/simpletest-decks.cpacs.xml, extended with a new mass-only lavatory element/instance) viaCCPACSConfiguration::AircraftFusingAlgo()->FusedPlane()and asserts it no longer throws.CTiglElementGeometryBuilder::BuildShape()fix and confirmed both tests fail with the originalNo geometry primitives defined for uID="..."exception, then restored the fix and confirmed they pass again.pixi run -e default unittests): 901/901 tests pass, no regressions.Screenshots, that help to understand the changes(if applicablable):
N/A (backend/logic fix, no UI changes)
Checklist for PR Author:
ChangeLog.mdupdated