-
I used the add_spline method when I used ezdxf to draw the spline curve. When I converted the dxf file to the svg image format, an error occurred. What is the reason? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Please keep the headline short. Use the appropriate boards, this is an issue but can not be transferred to "Issues" as far I know. But it is easy to transfer an "Issue" to "Discussions". And at last to ALL: Provide the damn source code, the exception traceback alone was never enough to find a bug. |
Beta Was this translation helpful? Give feedback.
-
Thank you for pointing out that there is no audit functionality implemented for the SPLINE entity at all! |
Beta Was this translation helpful? Give feedback.
-
Added an audit method to the # Safe loading procedure (requires ezdxf v0.14):
try:
doc, auditor = recover.readfile('your.dxf')
except IOError:
print(f'Not a DXF file or a generic I/O error.')
sys.exit(1)
except ezdxf.DXFStructureError:
print(f'Invalid or corrupted DXF file.')
sys.exit(2) But this will not prevent you from creating invalid splines, if you use the As simple rule, use A spline is only defined by the control points (and the knot values), using fit points is just a convenience method to define a spline, but render algorithm have to calculate the required control points (and knot values) from these fit points. Which is by the way not that easy because fit points do not define a single spline instead an infinite set of splines, from which the algorithm choose one spline, which leads to the problem that ezdxf does not render the same splines as AutoCAD or BricsCAD, because the way this CAD applications calculate the end tangents, if they are not stored in the DXF files, is not known. Using fit points is an easy way to define splines but you don't know exact what you get, beside the fact that the spline passes through your fit points. |
Beta Was this translation helpful? Give feedback.
非常感谢