File: ellipse.rst

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (91 lines) | stat: -rw-r--r-- 2,741 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Ellipse
=======

.. module:: ezdxf.entities
    :noindex:

The ELLIPSE entity (`DXF Reference`_) is an elliptic 3D curve defined by the DXF
attributes :attr:`dxf.center`, the :attr:`dxf.major_axis` vector and the
:attr:`dxf.extrusion` vector.

The :attr:`dxf.ratio` attribute is the ratio of minor axis to major axis and has
to be smaller or equal 1.  The :attr:`dxf.start_param` and :attr:`dxf.end_param`
attributes defines the starting- and the end point of the ellipse, a full
ellipse goes from 0 to 2π.  The curve always goes from start- to end
param in counter clockwise orientation.

The :attr:`dxf.extrusion` vector defines the normal vector of the ellipse plane.
The minor axis direction is calculated by :attr:`dxf.extrusion` cross
:attr:`dxf.major_axis`. The default extrusion vector (0, 0, 1) defines an ellipse
plane parallel to xy-plane of the :ref:`WCS`.

All coordinates and vectors in :ref:`WCS`.

.. seealso::

    - :ref:`tut_dxf_primitives`, section :ref:`tut_dxf_primitives_ellipse`
    - :class:`ezdxf.math.ConstructionEllipse`

======================== ==========================================
Subclass of              :class:`ezdxf.entities.DXFGraphic`
DXF type                 ``'ELLIPSE'``
factory function         :meth:`~ezdxf.layouts.BaseLayout.add_ellipse`
Inherited DXF attributes :ref:`Common graphical DXF attributes`
Required DXF version     DXF R2000 (``'AC1015'``)
======================== ==========================================

.. class:: Ellipse

    .. attribute:: dxf.center

        Center point of circle (2D/3D Point in :ref:`WCS`)

    .. attribute:: dxf.major_axis

        Endpoint of major axis, relative to the :attr:`dxf.center` (Vec3),
        default value is (1, 0, 0).

    .. attribute:: dxf.ratio

        Ratio of minor axis to major axis (float), has to be in range from
        0.000001 to 1.0, default value is 1.

    .. attribute:: dxf.start_param

        Start parameter (float), default value is 0.

    .. attribute:: dxf.end_param

        End parameter (float), default value is 2π.

    .. attribute:: start_point

        Returns the start point of the ellipse in WCS.

    .. attribute:: end_point

        Returns the end point of the ellipse in WCS.

    .. attribute:: minor_axis

        Returns the minor axis of the ellipse as :class:`Vec3` in WCS.

    .. automethod:: construction_tool

    .. automethod:: apply_construction_tool

    .. automethod:: vertices

    .. automethod:: flattening

    .. automethod:: params

    .. automethod:: transform

    .. automethod:: translate

    .. automethod:: to_spline

    .. automethod:: from_arc

.. _DXF Reference: http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-107CB04F-AD4D-4D2F-8EC9-AC90888063AB