Skip to content

How to set start and end points of an arc. #714

Answered by mozman
xDylan03x asked this question in Q&A
Discussion options

You must be logged in to vote

The add_arc() method had never the arguments start_point and end_point because it always used only the geometry parameters center, radius, start_angle and end_angle of the underlying DXF ARC entity to create an arc.

You can use the construction tool ezdxf.math.ConstructionArc to create arcs from 3 points by the classmethod from_3p() and add the arc by the add_to_layout() method to a layout like the modelspace.

import ezdxf
from ezdxf.math import ConstructionArc

doc = ezdxf.new()
arc = ConstructionArc.from_3p(start_point=(0, 0), end_point=(10, 0), def_point=(5, 3), ccw=False)
arc.add_to_layout(doc.modelspace(), dxfattribs={"color": ezdxf.colors.RED})
doc.saveas("arc.dxf")

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xDylan03x
Comment options

Answer selected by xDylan03x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants