Problem
xmsgrid/ugrid/XmUGrid.cpp:2946-2969 — GetPlanViewPolygon3d always returns true for prismatic cells, even when iMergeSegmentsToPoly hit its failure path and cleared a_polygon:
if (GetCellXySegments(a_cellIdx, segments))
{
// Prismatic cell
iMergeSegmentsToPoly(segments, a_polygon);
return true; // ← always true, even when a_polygon was just cleared
}
When iMergeSegmentsToPoly fails (now expanded by PR #193's iBuildPolygon hardening) it fires a debug-only XM_ASSERT(0) and clears a_polygon. The public XmUGrid::GetCellPlanViewPolygon (line 2127-2139) then returns true with an empty VecPt3d, and callers cannot distinguish "valid prismatic cell" from "polygon construction failed."
Why this matters
The bool plumbing added inside iBuildPolygon in #193 dies one stack frame above where it would actually surface to a user. Issue #188 hardened the lower layer; this is the matching fix at the public-API boundary.
Suggested fix
Either:
- Change
iMergeSegmentsToPoly to return bool and propagate:
return iMergeSegmentsToPoly(segments, a_polygon);
- At minimum,
return !a_polygon.empty(); after the call.
Context
Surfaced during review of #193 (follow-up to #186). Reviewer flagged as out-of-scope for #193 and recommended filing separately.
Problem
xmsgrid/ugrid/XmUGrid.cpp:2946-2969—GetPlanViewPolygon3dalways returnstruefor prismatic cells, even wheniMergeSegmentsToPolyhit its failure path and cleareda_polygon:When
iMergeSegmentsToPolyfails (now expanded by PR #193'siBuildPolygonhardening) it fires a debug-onlyXM_ASSERT(0)and clearsa_polygon. The publicXmUGrid::GetCellPlanViewPolygon(line 2127-2139) then returnstruewith an emptyVecPt3d, and callers cannot distinguish "valid prismatic cell" from "polygon construction failed."Why this matters
The
boolplumbing added insideiBuildPolygonin #193 dies one stack frame above where it would actually surface to a user. Issue #188 hardened the lower layer; this is the matching fix at the public-API boundary.Suggested fix
Either:
iMergeSegmentsToPolyto returnbooland propagate:return iMergeSegmentsToPoly(segments, a_polygon);return !a_polygon.empty();after the call.Context
Surfaced during review of #193 (follow-up to #186). Reviewer flagged as out-of-scope for #193 and recommended filing separately.