1 # SPDX-FileCopyrightText: 2012-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 from base_exporter
import BasePrimitiveDXFExporter
8 class ViewBorderDXFExporter(BasePrimitiveDXFExporter
):
10 def export(self
, ob
, mx
, mw
, **common
):
11 """converts Lamp-Object to desired projection and representation(DXF-Entity type)
13 identity_matrix
= mathutils
.Matrix().identity()
14 points
= projected_co(border
, identity_matrix
)
16 points
= toGlobalOrigin(points
)
17 c
= settings
['curve_as']
18 if c
=="LINEs": # export Curve as multiple LINEs
19 for i
in range(len(points
)-1):
20 linepoints
= [points
[i
], points
[i
+1]]
21 dxfLINE
= DXF
.Line(linepoints
,paperspace
=espace
,color
=LAYERCOLOR_DEF
)
22 entities
.append(dxfLINE
)
24 fag70
, flag75
= closed
, 0
25 dxfPOLYFACE
= DXF
.PolyLine([allpoints
, faces
], flag70
=flag70
, flag75
=flag70
, width
=0.0, paperspace
=espace
, color
=LAYERCOLOR_DEF
)
26 #dxfPLINE = DXF.PolyLine(points,points[0],[closed,0,0], paperspace=espace, color=LAYERCOLOR_DEF)