Export_3ds: Improved distance cue node search
[blender-addons.git] / io_export_dxf / primitive_exporters / viewborder_exporter.py
blobca09031ee49811f4e258f274c5c5556a5c4b37f6
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)
12 """
13 identity_matrix = mathutils.Matrix().identity()
14 points = projected_co(border, identity_matrix)
15 closed = 1
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)
23 else:
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)
27 d.append(dxfPLINE)