Basically it helps you use a function block_type(x,y,z) which outputs block type from coordinates. The script then saves this to a MCEdit schematics-file which can be inserted into a level with MCEdit.

The core is pymclevel by codewarrior. I've only added a little bit on top of this.

Here's the script (save as mineplot.py):

""" -- string name, function myfunc, tuple ranges --- Work in progress: 3D function plotter for Minecraft Made by Gommle, inspired by Voxelizer. Contact: [email protected] Dependencies: pymclevel by codewarrior ( DL: http://github.com/codewarrior0/pymclevel ) numpy (DL: http://www.scipy.org/Download ) Major credits to codewarrior for making this possible. """ from pymclevel import * """ See http://www.minecraftwiki.net/wiki/Data_values """ def plot(name, myfunc, ranges): # Useful stuff (xr, yr, zr) = ranges w = xr[1]-xr[0] + 1 # width h = zr[1]-zr[0] + 1 # height l = yr[1]-yr[0] + 1 # lengt size = (w, h, l); #NB: USES X, Z, Y schematic = MCSchematic(shape=size, mats='Alpha'); types = {} blocks = 0 for x in range(xr[0], xr[1]+1): for y in range(yr[0], yr[1]+1): for z in range(zr[0], zr[1]+1): block_type = myfunc(x, y, z) # if block_type != 0: blocks += 1 schematic.setBlockAt(x - xr[0], z - zr[0], y - yr[0], block_type) #NB: USES X, Z, Y filename = name + '.schematic' schematic.saveToFile(filename) print "Wrote " + str(blocks) + " blocks to " + filename

Put the folder pymclevel in the same folder as mineplot.py.

Here is an example of an advanced function, which makes a HUGE decorated torus: (save as mp_something.py in the same folder as mineplot.py)

import mineplot from math import sqrt, pow, fabs, sin # Variables name = "mp_toroid_space_station" #Without file ending R = 20 # Main radius r = 20 # Tube radius def myfunc(x,y,z): btype = 0 # air is default block # Distance from center of torus. Remove z for horizontal distance. dist = sqrt(x**2 + y**2 + z**2) if abs((x**2 + y**2 + z**2 + R**2 - r**2)**2 - 4*R**2*(x**2 + y**2)) < 200000: # Z-options if z == -4: btype = 45 # brick elif z == -17: # Bottom floor btype = 2 # grass elif z > -4: # Upper part btype = 20 # glass elif z < -14: # Two levels above and including bottom floor btype = 49 # obsidian else: # Bottom part btype = 45 # brick # Distance options # Make a hollow sphere in the middle section if dist < 10: btype = 0 # air else: if z == 0: # Make a balcony in the middle of the torus if dist < 0.5*(R+r) or (dist > 0.7*(R+r) and dist < R+r): # From both sides, but not all the way over if round(dist) % 4 == 0: # Every other row is gold btype = 41 # gold else: btype = 20 # glass else: btype = 0 return btype # Coordinate ranges xr = [-(R+r), R+r] # Main radius + tube radius yr = xr zr = [-r, r] # Tube radius ranges = [xr, yr, zr] mineplot.plot(name, myfunc, ranges)

Oh, and a little heads up for something that is based on this:

array2minecraft