File: 3dface.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 (71 lines) | stat: -rw-r--r-- 2,060 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
Face3d
======

.. module:: ezdxf.entities
    :noindex:

The 3DFACE entity (`DXF Reference`_) is real 3D solid filled triangle or quadrilateral.
Access vertices by name (:code:`entity.dxf.vtx0 = (1.7, 2.3)`) or by index
(:code:`entity[0] = (1.7, 2.3)`).

Unlike the entities :class:`Solid` and :class:`Trace`, the vertices of
:class:`Face3d` have the expected vertex order:

.. code-block:: Python

    msp.add_3dface([(0, 0), (10, 0), (10, 10), (0, 10)])

.. image:: gfx/3dface.png
    :align: center

======================== ==========================================
Subclass of              :class:`ezdxf.entities.DXFGraphic`
DXF type                 ``'3DFACE'``
Factory function         :meth:`ezdxf.layouts.BaseLayout.add_3dface`
Inherited DXF attributes :ref:`Common graphical DXF attributes`
======================== ==========================================

.. warning::

    Do not instantiate entity classes by yourself - always use the provided
    factory functions!

.. class:: Face3d

    The class name is :class:`Face3d` because :class:`3dface` is not a valid
    Python class name.

    .. attribute:: dxf.vtx0

        Location of 1. vertex (3D Point in :ref:`WCS`)

    .. attribute:: dxf.vtx1

        Location of 2. vertex (3D Point in :ref:`WCS`)

    .. attribute:: dxf.vtx2

        Location of 3. vertex (3D Point in :ref:`WCS`)

    .. attribute:: dxf.vtx3

        Location of 4. vertex (3D Point in :ref:`WCS`)

    .. attribute:: dxf.invisible_edges

        invisible edge flag (int, default=0)

        === ==============================
        1   first edge is invisible
        2   second edge is invisible
        4   third edge is invisible
        8   fourth edge is invisible
        === ==============================

        Combine values by adding them, e.g. 1+4 = first and third edge is invisible.

    .. automethod:: transform

    .. automethod:: wcs_vertices(close: bool = False) -> list[Vec3]

.. _DXF Reference: http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-747865D5-51F0-45F2-BEFE-9572DBC5B151