예제 #1
0
    def generate(self, bounds, blocktypes):
        # self.systemsBox.value()
        schematic = createSchematic(bounds.size, blocktypes)
        dim = schematic.getDimension()
        system = koch.Snowflake(dim.bounds, blocktype=self.blocktypeButton.block)
        symbol_list = [system]

        max_iterations = self.iterationsSlider.value()
        def process(_symbol_list):
            for iteration, _symbol_list in applyReplacementsIterated(_symbol_list, max_iterations):
                yield iteration, max_iterations

            yield _symbol_list

        symbol_list = showProgress("Generating...", process(symbol_list), cancel=True)
        if symbol_list is False:
            return

        import pprint
        pprint.pprint(symbol_list)
        rendering = renderBlocks(symbol_list)

        print("Rendering %d blocks" % len(rendering))
        for x, y, z, blockType in rendering:
            dim.setBlock(x, y, z, blockType)

        return schematic
예제 #2
0
    def generateInSchematic(self, dimension, originalBounds):
        symbol_list = self.createSymbolList(originalBounds)
        if symbol_list is None:
            return None

        log.info("Rendering symbols to blocks")

        rendering = renderBlocks(symbol_list)

        log.info("Editing %d blocks" % len(rendering))
        for x, y, z, blockType in rendering:
            x -= originalBounds.minx
            y -= originalBounds.miny
            z -= originalBounds.minz

            dimension.setBlock(x, y, z, blockType)
예제 #3
0
    def generateInSchematic(self, dimension, originalBounds):
        symbol_list = self.createSymbolList(originalBounds)
        if symbol_list is None:
            return None

        log.info("Rendering symbols to blocks")

        rendering = renderBlocks(symbol_list)

        log.info("Editing %d blocks" % len(rendering))
        for x, y, z, blockType in rendering:
            x -= originalBounds.minx
            y -= originalBounds.miny
            z -= originalBounds.minz

            dimension.setBlock(x, y, z, blockType)
예제 #4
0
 def renderBlocks(self, symbol_list):
     return renderBlocks(symbol_list)
예제 #5
0
 def renderBlocks(self, symbol_list):
     return renderBlocks(symbol_list)