Skip to content

Improve error handling for degenerate c2c contour files #1879

@kennyweiss

Description

@kennyweiss

A user reported problems shaping in contour files.

It turned out that a linear spline had a duplicate control point, e.g.

point = spline_start
piece = rz(units=cm, interpolation=linear, 
     rz=  0 5
		  5 0
		  5 0  # <-- duplicate!
		  0 -5)
point = spline_end
piece = line(end=spline_start)

C2C converts this a NURBS curve of degree 1 with C^-1 continuity (i.e. discontinuous), which our NURBSCurve class (intentionally) does not support.

Loading this input triggers a validity check in our KnotVector class via a SLIC_ASSERT and crashes in Debug configs without a good error message.
More significantly, this does not get triggered at construction time in Release configs and manifests as an out-of-bounds array indexing error (which is much harder to pinpoint).

We should fix this by improving the error messages when loading invalid contour files and ensuring that it gets reported in all configs (debug and release).

I don't think we need to directly support this invalid mesh in our reader since it is easy enough for users to fix their input data.
On the other hand, this case (linear spline with duplicated control point) might be common enough to try to fix on our side.

Metadata

Metadata

Assignees

Labels

PrimalIssues related to Axom's 'primal componentQuestIssues related to Axom's 'quest' componentUser RequestIssues related to user requestsbugSomething isn't workinghigh priorityusabilityRelated to code usability

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions