You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by ValerioMussi March 16, 2022
Hi @mozman!
There is something I cannot properly understand about using the flattening method of the arc dxf entity. Can you please help me figuring out what I'm doing wrong?
When I try to use the flattening method of a 3D arc dxf entity I get vertexes that actually do not lie on the arc.
Here is an example modified from the arc.py example.
import ezdxf
from ezdxf.math import Vec3, ConstructionArc, UCS
# create a 3D arc from 3 points in WCS
start_point_wcs = Vec3(3, 0, 0)
end_point_wcs = Vec3(0, 3, 0)
def_point_wcs = Vec3(0, 0, 3)
# create UCS
ucs = UCS.from_x_axis_and_point_in_xy(
origin=def_point_wcs,
axis=start_point_wcs - def_point_wcs,
point=end_point_wcs,
)
start_point_ucs = ucs.from_wcs(start_point_wcs)
end_point_ucs = ucs.from_wcs(end_point_wcs)
def_point_ucs = Vec3(0, 0) # origin of UCS
# create arc in the xy-plane of the UCS
arc = ConstructionArc.from_3p(start_point_ucs, end_point_ucs, def_point_ucs)
arc.add_to_layout(modelspace, ucs, dxfattribs={"color": 1}) # red arc
arc2=modelspace.query("ARC")[0]
points=list(arc2.flattening(1))
print(f"start: {arc2.start_point} end: {arc2.end_point}")
print(points)
for p in points:
modelspace.add_point(p)
# saving DXF file
filename = "arcs.dxf"
doc.saveas(filename)
print("drawing '%s' created.\n" % filename)`
Discussed in #654
Originally posted by ValerioMussi March 16, 2022
Hi @mozman!
There is something I cannot properly understand about using the flattening method of the arc dxf entity. Can you please help me figuring out what I'm doing wrong?
When I try to use the flattening method of a 3D arc dxf entity I get vertexes that actually do not lie on the arc.
Here is an example modified from the arc.py example.
The output I get is:
And here is a screenshot from Draftsight:
Thanks,
Valerio.
The text was updated successfully, but these errors were encountered: