Trace

TRACE entity (DXF Reference) is solid filled triangle or quadrilateral. Access vertices by name (entity.dxf.vtx0 = (1.7, 2.3)) or by index (entity[0] = (1.7, 2.3)). If only 3 vertices are provided the last (3rd) vertex will be repeated in the DXF file.

The TRACE entity stores the vertices in an unusual way, the last two vertices are reversed. The coordinates [(0, 0), (1, 0), (1, 1), (0, 1)] do not create a square as you would expect:

../_images/solid0.png

Reverse the last two vertices to get the expected square: [(0, 0), (1, 0), (0, 1), (1, 1)]

../_images/solid1.png

Note

The Trace.vertices() and Trace.wcs_vertices() methods return the vertices in the expected (reversed) order.

Subclass of

ezdxf.entities.DXFGraphic

DXF type

'TRACE'

Factory function

ezdxf.layouts.BaseLayout.add_trace()

Inherited DXF attributes

Common graphical DXF attributes

Warning

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

class ezdxf.entities.Trace
dxf.vtx0

Location of 1. vertex (2D/3D Point in OCS)

dxf.vtx1

Location of 2. vertex (2D/3D Point in OCS)

dxf.vtx2

Location of 3. vertex (2D/3D Point in OCS)

dxf.vtx3

Location of 4. vertex (2D/3D Point in OCS)

transform(m: Matrix44) Trace

Transform the SOLID/TRACE entity by transformation matrix m inplace.

vertices(close: bool = False) List[Vec3]

Returns OCS vertices in correct order, if argument close is True, last vertex == first vertex. Does not return duplicated last vertex if represents a triangle.

New in version 0.15.

wcs_vertices(close: bool = False) List[Vec3]

Returns WCS vertices in correct order, if argument close is True, last vertex == first vertex. Does not return duplicated last vertex if represents a triangle.

New in version 0.15.