~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to release/scripts/addons_contrib/io_export_dxf/primitive_exporters/viewborder_exporter.py

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-05-12 20:02:22 UTC
  • mfrom: (14.2.16 sid)
  • Revision ID: package-import@ubuntu.com-20120512200222-lznjs2cxzaq96wua
Tags: 2.63a-1
* New upstream bugfix release
  + debian/patches/: re-worked since source code changed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from base_exporter import BasePrimitiveDXFExporter
2
 
 
3
 
 
4
 
class ViewBorderDXFExporter(BasePrimitiveDXFExporter):
5
 
 
6
 
    def export(self, ob, mx, mw, **common):
7
 
        """converts Lamp-Object to desired projection and representation(DXF-Entity type)
8
 
        """
9
 
        identity_matrix = mathutils.Matrix().identity()
10
 
        points = projected_co(border, identity_matrix)
11
 
        closed = 1
12
 
        points = toGlobalOrigin(points)
13
 
        c = settings['curve_as']
14
 
        if c=="LINEs": # export Curve as multiple LINEs
15
 
            for i in range(len(points)-1):
16
 
                linepoints = [points[i], points[i+1]]
17
 
                dxfLINE = DXF.Line(linepoints,paperspace=espace,color=LAYERCOLOR_DEF)
18
 
                entities.append(dxfLINE)
19
 
        else:
20
 
            fag70, flag75 = closed, 0
21
 
            dxfPOLYFACE = DXF.PolyLine([allpoints, faces], flag70=flag70, flag75=flag70, width=0.0, paperspace=espace, color=LAYERCOLOR_DEF)
22
 
            #dxfPLINE = DXF.PolyLine(points,points[0],[closed,0,0], paperspace=espace, color=LAYERCOLOR_DEF)
23
 
            d.append(dxfPLINE)
24