File: ellipse.rst

package info (click to toggle)
ezdxf 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 46,952 kB
  • sloc: python: 158,141; javascript: 166; cpp: 138; makefile: 116; lisp: 20
file content (76 lines) | stat: -rw-r--r-- 2,359 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
Ellipse
=======

.. module:: ezdxf.entities
    :noindex:

ELLIPSE (`DXF Reference`_) with center point at location :attr:`dxf.center` and a major axis :attr:`dxf.major_axis` as vector.
:attr:`dxf.ratio` is the ratio of minor axis to major axis. :attr:`dxf.start_param` and :attr:`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.

:attr:`dxf.extrusion` is supported, but does not establish an :ref:`OCS`, but creates an 3D entity by
extruding the base ellipse in direction of the :attr:`dxf.extrusion` vector.

======================== ==========================================
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``,
        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*pi``.

    .. 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