Welcome to mirror list, hosted at ThFree Co, Russian Federation.

model.py « model « io_export_dxf - git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 698f5102514df7e58971545461c947d4770c5dc1 (plain)
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

class DxfDrawing(object):
    """
    Represents intermediate model of DXF drawing. It is useful in iterating
    through exported object and for easy change the DXF handling library.
    """
    def __init__(self):
        self._entities = {}
        self._layers = {}
        self._views = []
        self._vports = []
        self._blocks = []

    def isEmpty(self):
        return len(self._entities) == 0

    def addEntity(self, type, **kwargs):
        if type not in self._entities:
            self._entities[type] = []
        self._entities[type].append(kwargs)

    def addLayer(self, name, color):
        self._layers[name] = color

    def containsLayer(self, name):
        return name in self._layers

    def addBlock(self, block):
        self._blocks.append(block)

    def containsBlock(self, blockname):
        return blockname in self._blocks

    def convert(self, **kwargs):
        """ Converts this drawing into DXF representation object """
        raise NotImplementedError()