Esempio n. 1
0
    def _build_geometry(self, points, cells):
        geometry = Geometry()
        
        for cell in cells:
            cell_type, cell = cell[0], cell[1:]           
                
            if cell_type == CellType.VTK_TRIANGLE:
                poly, name = self._build_triangle(cell, points)
            if cell_type == CellType.VTK_QUAD:
                poly, name = self._build_quadrilateral(cell, points)
            if cell_type == CellType.VTK_PIXEL:
                poly, name = self._build_pixel(cell, points)
            if cell_type == CellType.VTK_TETRA:
                poly, name = self._build_tetrahedron(cell, points)
            elif cell_type == CellType.VTK_VOXEL:
                poly, name = self._build_voxel(cell, points)

            geometry.add_named_polyhedron(poly, name, self.current_id)
            self.current_id += 1
        
        return geometry