Thanks for answering, nallath.
I ended up doing this to create a cube that touches the buildplate:
s = size / 2
dtb = distance_to_buildplate
verts = [ # 6 faces with 4 corners each
[-s, -dtb, s], [-s, s, s], [ s, s, s], [ s, -dtb, s], # a = x-yz
[-s, s, -s], [-s, -dtb, -s], [ s, -dtb, -s], [ s, s, -s], # b = x+yz
[ s, -dtb, -s], [-s, -dtb, -s], [-s, -dtb, s], [ s, -dtb, s], # c = xy-z
[-s, s, -s], [ s, s, -s], [ s, s, s], [-s, s, s], # d = xy+z
[-s, -dtb, s], [-s, -dtb, -s], [-s, s, -s], [-s, s, s], # e = +xyz
[ s, -dtb, -s], [ s, -dtb, s], [ s, s, s], [ s, s, -s] # f = -xyz
]
where "distance_to_buildplate" is the position in the Y axis of the cube when you click on the model, which is the same thing as the distance from the cube the ground.