# Path: core/ezdxf/lldxf/const.py
# VERTEXNAMES = ('vtx0', 'vtx1', 'vtx2', 'vtx3')


from ..lldxf.const import VERTEXNAMES
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"



class PolyfaceBuilder(object):
    def __init__(self, faces, precision=6):
        self.precision = precision
        self.faces = []
        self.vertices = []
        self.index_mapping = {}
        self.build(faces)

    @property
    def nvertices(self):
        return len(self.vertices)

    @property
    def nfaces(self):
        return len(self.faces)

    def get_vertices(self):
        vertices = self.vertices[:]
        vertices.extend(self.faces)
        return vertices

    def build(self, faces):
        for face in faces:
            face_record = face.face_record

# Path: core/ezdxf/lldxf/const.py
# VERTEXNAMES = ('vtx0', 'vtx1', 'vtx2', 'vtx3')


# Path: core/ezdxf/legacy/polyfacebuilder.py
from ..lldxf.const import VERTEXNAMES

# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"



class PolyfaceBuilder(object):
    def __init__(self, faces, precision=6):
        self.precision = precision
        self.faces = []
        self.vertices = []
        self.index_mapping = {}
        self.build(faces)

    @property
    def nvertices(self):
        return len(self.vertices)

    @property
    def nfaces(self):
        return len(self.faces)

    def get_vertices(self):
        vertices = self.vertices[:]
        vertices.extend(self.faces)
        return vertices

    def build(self, faces):
        for face in faces:
            face_record = face.face_record

            for vertex, name in zip(face, VERTEXNAMES):