GraphicsGems
GraphicsGems copied to clipboard
Assertion failed: (dstD != NULL)
(from a user) For ch7-4 in Graphics Gems V: when I run the provided code I always receive the following error “Assertion failed: (dstD != NULL), function complexCut, file polygon.cc. Abort Trap: 6”.
Eric here: specific line is https://github.com/erich666/GraphicsGems/blob/master/gemsv/ch7-4/polygon.cc#L169
I could not find George Vanacek Jr, the author of this gem (he was at Purdue 1991-1995, after that I do not know).
Debug output:
Before: (0 0 0) (2 0 0) (3 3 0) (4 0 0) (9 0 0) (9 3 0) (10 3 0) (10 0 0) (13 0 0) (13 3 0) (14 3 0) (14 6 0) (6 6 0) (6 2 0) (7 2 0) (7 5 0) (12 5 0) (12 1 0) (11 1 0) (11 4 0) (8 4 0) (8 1 0) (5 1 0) (5 3 0) (4 3 0) (4 6 0) (3 6 0) (2 3 0) (1 6 0) (0 6 0) Assertion failed: dstD != NULL, file c:\temp\graphicsgems-master\gemsv\ch7-4\polygon.cc, line 169
I hit this assertion on the fifth test of it. Looks like srcD gets set, but it's the last element, 14, in the array and so there is no dstD. The pairs up to that point are: 3-4, 6-7, 8-9, 10-12.