-
-
Notifications
You must be signed in to change notification settings - Fork 54
Mis-rendering and confusing error message in aperture macro outline primitives with mismatched vertex count #171
Copy link
Copy link
Open
Description
When presented with the following Gerber file, gerbv produces a corrupted rendering result and outputs a misleading error message.
The file contains two aperture macro definitions. Both use an "outline" primitive. For some reason, in aperture macro outlines, the number of coordinate pairs is listed as a parameter. gerbv internally uses this parameter to allocate memory. When the parameter is mismatched to the actual number of vertices, it produces a cryptic error message on the command line:
Number of parameters to aperture macro (75) capped to stack capacity (54)
and produces a corrupted rendering result:
I reproduced this behavior on both gerbv 2.9.5 and 2.9.7-rc1.
Suggested resolution
- Detect the mismatch and warn the user with a sepecific warning message such as "Aperture macro outline vertex count does not match parameter count
- Either:
a) Use the actual number of parameters instead of the stated vertex count to allocate memory, and render the outline as if the correct count was given (likely to be closest to user intent, and least likely to cause significant mismatch to user intent)
b) Continue using the stated vertex count to allocate memory, and do not render anything at all when a mismatch is detected (smallest code change, but likely to cause significant mismatch to user intent).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
