File: mline.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 (223 lines) | stat: -rw-r--r-- 6,375 bytes parent folder | download | duplicates (2)
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
MLine
=====

.. module:: ezdxf.entities
    :noindex:

The MLINE entity (`DXF Reference`_).


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

.. _DXF Reference: http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-590E8AE3-C6D9-4641-8485-D7B3693E432C

.. class:: MLine

    .. attribute:: dxf.style_name

        :class:`MLineStyle` name stored in :attr:`Drawing.mline_styles`
        dictionary, use :meth:`~MLine.set_style` to change the MLINESTYLE
        and update geometry accordingly.

    .. attribute:: dxf.style_handle

        Handle of :class:`MLineStyle`, use :meth:`~MLine.set_style` to change
        the MLINESTYLE and update geometry accordingly.

    .. attribute:: dxf.scale_factor

        MLINE scaling factor, use method :meth:`~MLine.set_scale_factor`
        to change the scaling factor and update geometry accordingly.

    .. attribute:: dxf.justification

        Justification defines the location of the MLINE in relation to
        the reference line, use method :meth:`~MLine.set_justification`
        to change the justification and update geometry accordingly.

        Constants defined in :mod:`ezdxf.lldxf.const`:

        ============================== =======
        dxf.justification              Value
        ============================== =======
        MLINE_TOP                      0
        MLINE_ZERO                     1
        MLINE_BOTTOM                   2
        MLINE_RIGHT (alias)            0
        MLINE_CENTER (alias)           1
        MLINE_LEFT (alias)             2
        ============================== =======

    .. attribute:: dxf.flags

        Use method :meth:`~MLine.close` and the properties :attr:`~MLine.start_caps`
        and :attr:`~MLine.end_caps` to change these flags.

        Constants defined in :mod:`ezdxf.lldxf.const`:

        ============================== =======
        dxf.flags                      Value
        ============================== =======
        MLINE_HAS_VERTEX               1
        MLINE_CLOSED                   2
        MLINE_SUPPRESS_START_CAPS      4
        MLINE_SUPPRESS_END_CAPS        8
        ============================== =======

    .. attribute:: dxf.start_location

        Start location of the reference line. (read only)

    .. attribute:: dxf.count

        Count of MLINE vertices. (read only)

    .. attribute:: dxf.style_element_count

        Count of elements in :class:`MLineStyle` definition. (read only)

    .. attribute:: dxf.extrusion

        Normal vector of the entity plane, but MLINE is not an OCS entity, all
        vertices of the reference line are WCS! (read only)

    .. attribute:: vertices

        MLINE vertices as :class:`MLineVertex` objects, stored in a
        regular Python list.

    .. autoproperty:: style

    .. automethod:: set_style

    .. automethod:: set_scale_factor

    .. automethod:: set_justification

    .. autoproperty:: is_closed

    .. automethod:: close

    .. autoproperty:: start_caps

    .. autoproperty:: end_caps

    .. automethod:: __len__

    .. automethod:: start_location

    .. automethod:: get_locations

    .. automethod:: extend

    .. automethod:: clear

    .. automethod:: update_geometry

    .. automethod:: generate_geometry

    .. automethod:: transform

    .. automethod:: virtual_entities

    .. automethod:: explode

.. class:: MLineVertex

    .. attribute:: location

        Reference line vertex location.

    .. attribute:: line_direction

        Reference line direction.

    .. attribute:: miter_direction

    .. attribute:: line_params

        The line parameterization is a list of float values. The list may
        contain zero or more items.

        The first value (miter-offset) is the distance from the vertex
        :attr:`location` along the :attr:`miter_direction` vector to the
        point where the line element's path intersects the miter vector.

        The next value (line-start-offset) is the distance along the
        :attr:`line_direction` from the miter/line path intersection point to
        the actual start of the line element.

        The next value (dash-length) is the distance from the start of the
        line element (dash) to the first break (gap) in the line element.
        The successive values continue to list the start and stop points of
        the line element in this segment of the mline.

    .. attribute:: fill_params

        The fill parameterization is also a list of float values.
        Similar to the line parameterization, it describes the
        parameterization of the fill area for this mline segment.
        The values are interpreted identically to the line parameters and when
        taken as a whole for all line elements in the mline segment, they
        define the boundary of the fill area for the mline segment.

.. class:: MLineStyle

    The :class:`MLineStyle` stores the style properties for the MLINE entity.

    .. attribute:: dxf.name

    .. attribute:: dxf.description

    .. attribute:: dxf.flags

    .. attribute:: dxf.fill_color

        :ref:`ACI` value of the fill color

    .. attribute:: dxf.start_angle

    .. attribute:: dxf.end_angle

    .. attribute:: elements

        :class:`~ezdxf.entities.mline.MLineStyleElements` object

    .. automethod:: update_all

.. class:: ezdxf.entities.mline.MLineStyleElements

    .. attribute:: elements

        List of :class:`~ezdxf.entities.mline.MLineStyleElement` objects, one
        for each line element.

    .. automethod:: __len__

    .. automethod:: __getitem__

    .. automethod:: append

.. class:: ezdxf.entities.mline.MLineStyleElement

    Named tuple to store properties of a line element.

    .. attribute:: offset

        Normal offset from the reference line: if justification is ``MLINE_ZERO``,
        positive values are above and negative values are below the reference
        line.

    .. attribute:: color

        :ref:`ACI` value

    .. attribute:: linetype

        Linetype name