Arc
The ARC entity (DXF Reference) represents a circular arc, which is defined by the DXF
attributes dxf.center
, dxf.radius
, dxf.start_angle
and
dxf.end_angle
.
The arc-curve goes always from dxf.start_angle
to dxf.end_angle
in
counter-clockwise orientation around the dxf.extrusion
vector, which is (0, 0, 1)
by default and the usual case for 2D arcs. The ARC entity has OCS
coordinates.
The helper tool ezdxf.math.ConstructionArc
supports creating arcs from
various scenarios, like from 3 points or 2 points and an angle or 2 points and
a radius and the upright
module can convert inverted extrusion vectors
from (0, 0, -1) to (0, 0, 1) without changing the curve.
See also
Subclass of |
|
DXF type |
|
Factory function |
|
Inherited DXF attributes |
Warning
Do not instantiate entity classes by yourself - always use the provided factory functions!
- class ezdxf.entities.Arc
-
- dxf.radius
Radius of arc (float)
- dxf.start_angle
Start angle in degrees (float)
- dxf.end_angle
End angle in degrees (float)
- angles(num: int) Iterator[float]
Yields num angles from start- to end angle in degrees in counter-clockwise orientation. All angles are normalized in the range from [0, 360).
- flattening(sagitta: float) Iterator[Vec3]
Approximate the arc by vertices in WCS, the argument sagitta defines the maximum distance from the center of an arc segment to the center of its chord.
- transform(m: Matrix44) Arc
Transform ARC entity by transformation matrix m inplace. Raises
NonUniformScalingError()
for non-uniform scaling.
- to_ellipse(replace=True) Ellipse
Convert the CIRCLE/ARC entity to an
Ellipse
entity.Adds the new ELLIPSE entity to the entity database and to the same layout as the source entity.
- Parameters:
replace – replace (delete) source entity by ELLIPSE entity if
True
- to_spline(replace=True) Spline
Convert the CIRCLE/ARC entity to a
Spline
entity.Adds the new SPLINE entity to the entity database and to the same layout as the source entity.
- Parameters:
replace – replace (delete) source entity by SPLINE entity if
True
- construction_tool() ConstructionArc
Returns the 2D construction tool
ezdxf.math.ConstructionArc
but the extrusion vector is ignored.
- apply_construction_tool(arc: ConstructionArc) Arc
Set ARC data from the construction tool
ezdxf.math.ConstructionArc
but the extrusion vector is ignored.