Ellipse¶
ELLIPSE (DXF Reference) with center point at location dxf.center
and a major axis dxf.major_axis
as vector.
dxf.ratio
is the ratio of minor axis to major axis. dxf.start_param
and dxf.end_param
defines the starting- and the end point of the ellipse, a full ellipse goes from 0
to 2*pi
.
The ellipse goes from starting- to end param in counter clockwise direction.
dxf.extrusion
is supported, but does not establish an OCS, but creates an 3D entity by
extruding the base ellipse in direction of the dxf.extrusion
vector.
Subclass of | ezdxf.entities.DXFGraphic |
DXF type | 'ELLIPSE' |
factory function | add_ellipse() |
Inherited DXF attributes | Common graphical DXF attributes |
Required DXF version | DXF R2000 ('AC1015' ) |
-
class
ezdxf.entities.
Ellipse
¶ -
-
dxf.
major_axis
¶ Endpoint of major axis, relative to the
dxf.center
(Vec3), default value is(1, 0, 0)
.
-
dxf.
ratio
¶ Ratio of minor axis to major axis (float), has to be in range from
0.000001
to1
, default value is1
.
-
dxf.
start_param
¶ Start parameter (float), default value is
0
.
-
dxf.
end_param
¶ End parameter (float), default value is
2*pi
.
-
start_point
¶ Returns the start point of the ellipse in WCS.
-
end_point
¶ Returns the end point of the ellipse in WCS.
-
minor_axis
¶ Returns the minor axis of the ellipse as
Vec3
in WCS.
-
construction_tool
() → ezdxf.math.ellipse.ConstructionEllipse¶ Returns construction tool
ezdxf.math.ConstructionEllipse
.
-
apply_construction_tool
(e: ezdxf.math.ellipse.ConstructionEllipse) → ezdxf.entities.ellipse.Ellipse¶ Set ELLIPSE data from construction tool
ezdxf.math.ConstructionEllipse
.
-
vertices
(params: Iterable[float]) → Iterable[ezdxf.math._vector.Vec3]¶ Yields vertices on ellipse for iterable params in WCS.
Parameters: params – param values in the range from 0
to2*pi
in radians, param goes counter clockwise around the extrusion vector, major_axis = local x-axis = 0 rad.
-
flattening
(distance: float, segments: int = 8) → Iterable[ezdxf.math._vector.Vec3]¶ Adaptive recursive flattening. The argument segments is the minimum count of approximation segments, if the distance from the center of the approximation segment to the curve is bigger than distance the segment will be subdivided. Returns a closed polygon for a full ellipse: start vertex == end vertex.
Parameters: - distance – maximum distance from the projected curve point onto the segment chord.
- segments – minimum segment count
New in version 0.15.
-
params
(num: int) → Iterable[float]¶ Returns num params from start- to end param in counter clockwise order.
All params are normalized in the range from [0, 2pi).
-
transform
(m: ezdxf.math._matrix44.Matrix44) → ezdxf.entities.ellipse.Ellipse¶ Transform the ELLIPSE entity by transformation matrix m inplace.
-
translate
(dx: float, dy: float, dz: float) → ezdxf.entities.ellipse.Ellipse¶ Optimized ELLIPSE translation about dx in x-axis, dy in y-axis and dz in z-axis, returns self (floating interface).
-
to_spline
(replace=True) → Spline¶ Convert ELLIPSE 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
-
classmethod
from_arc
(entity: ezdxf.entities.dxfgfx.DXFGraphic) → ezdxf.entities.ellipse.Ellipse¶ Create a new ELLIPSE entity from ARC or CIRCLE entity.
The new SPLINE entity has no owner, no handle, is not stored in the entity database nor assigned to any layout!
-