You have to match line and arc end points manually.
Get the end points of arcs with default extrusion (0, 0, 1):
from ezdxf.math import Vector
start_point = Vector.from_deg_angle(arc.dxf.start_angle, arc.dxf.radius)
end_point = Vector.from_deg_angle(arc.dxf.end_angle, arc.dxf.radius)
Add to arc center:
s = start_point + arc.dxf.center
e = end_point + arc.dxf.center
If the Object Coordinate System (OCS) defined by arc.dxf.extrusion
is different from (0, 0, 1), a transformation to the World Coordinate System (WCS) has to be done:
ocs = arc.ocs()
s = ocs.to_wcs(s)
e = ocs.to_wcs(e)
Next ezdxf version v0.11 will have Arc.start_point
and Arc.end_point
properties, which will return the WCS coordinates.
Important: Don't compare with the equal operator (==), use math.isclose()
or better Vector.isclose()
like:
s.isclose(line.dxf.start, abs_tol=1e-6)
e.isclose(line.dxf.start, abs_tol=1e-6)
s.isclose(line.dxf.end, abs_tol=1e-6)
e.isclose(line.dxf.end, abs_tol=1e-6)
Set absolute tolerance according to your needs.