DXFLib icon indicating copy to clipboard operation
DXFLib copied to clipboard

Fix exceptions when Traces and 3DFaces have 4 coordinates

Open JosephEoff opened this issue 8 years ago • 2 comments

Fix exceptions when Traces and 3DFaces have 4 coordinates.

This is the same as the fix for SOLIDS with 4 coordinates.

JosephEoff avatar Aug 04 '16 13:08 JosephEoff

@JosephEoff thanks for pointing that out! I thought about it and came up with an alternative solution. I thought it would be bad to have always 4 coordinates. You would have to "guess" wether your item had originally three or four coordinates based on the values of the fourth coordinate set.

I'm not entirely sure aboud SOLIDs though. Those are known to have 4 coordinates, right? Otherwise I'll update it's implementation to use the same fix. Please have a look at https://github.com/mkernel/DXFLib/tree/JosephEoff-master and check if that also fixes the crashes with your demo files.

mkernel avatar Aug 05 '16 07:08 mkernel

Close. The for loop is a bit off. With it corrected, everything works. Correct for loop: for (int i = oldLength - 1; i < idx + 1;i++ )

JosephEoff avatar Aug 05 '16 09:08 JosephEoff