Beispiel #1
0
    def addCube(self, dimensions, center, color=[1, 1, 1], subdivisions=0):

        bmin = np.array(center) - np.array(dimensions) / 2.0
        bmax = np.array(center) + np.array(dimensions) / 2.0
        cube = vtk.vtkTessellatedBoxSource()
        cube.SetBounds(bmin[0], bmax[0], bmin[1], bmax[1], bmin[2], bmax[2])
        cube.SetLevel(subdivisions)
        cube.Update()
        self.addPolyData(cube.GetOutput(), color)
Beispiel #2
0
    def addCube(self, dimensions, center, color=[1,1,1], subdivisions=0):

        bmin = np.array(center) - np.array(dimensions)/2.0
        bmax = np.array(center) + np.array(dimensions)/2.0
        cube = vtk.vtkTessellatedBoxSource()
        cube.SetBounds(bmin[0], bmax[0], bmin[1], bmax[1], bmin[2], bmax[2])
        cube.SetLevel(subdivisions)
        cube.Update()
        self.addPolyData(cube.GetOutput(), color)