I´m new in programming and try to make a 3d-shape from a 2d scribble/painting. I use
toxiclibs-complete-0020.zip and
volumeutils-0003.zip Here is my code i use . Tha programmer who wrote this code used volumeutils-0004. Maybe thats the problem, that i have a older version-bbut i cannot find the newer version for download ANYWHERE. "Cannot instantiate the type VolumetricSpace" is the error i get by trying using this code. What does it mean? I work with PC. Thank you a lot!
import toxi.processing.*;
import toxi.volume.*;
import toxi.math.conversion.*;
import toxi.geom.*;
import toxi.math.*;
import toxi.geom.mesh2d.*;
import toxi.util.datatypes.*;
import toxi.util.events.*;
import toxi.geom.mesh.subdiv.*;
import toxi.geom.mesh.*;
import toxi.math.waves.*;
import toxi.util.*;
import toxi.math.noise.*;
/**
* Loads a B&W image and extrudes black pixels into
* a watertight 3D mesh.
* @author toxi
*
* Dependencies: toxiclibscore-0018, volumeutils-0004
* (or newer, available from: http://toxiclibs.org/ )
*/
import toxi.geom.*;
import toxi.geom.mesh.*;
import toxi.volume.*;
int scale=8;
int depth=32;
PImage img=loadImage("heightmap.gif");
Vec3D worldSize = new Vec3D(img.width, img.height, depth).scale(scale);
VolumetricSpace volume = new VolumetricSpace(worldSize, img.width, img.height, depth);
VolumetricBrush brush = new RoundBrush(volume, scale);
for (int y = 0; y < img.height; y ++) {
for (int x = 0; x < img.width; x ++) {
if (0 == (img.pixels[y * img.width + x] & 0xff)) {
for (int z = 0; z < depth; z++) {
brush.drawAtGridPos(x, y, z, 0.5f);
}
}
}
}
volume.closeSides();
TriangleMesh mesh = new IsoSurface(volume).computeSurfaceMesh(null, 0.1f);
mesh.saveAsSTL(sketchPath("test.stl"), true);
exit();
import toxi.processing.*;
import toxi.volume.*;
import toxi.math.conversion.*;
import toxi.geom.*;
import toxi.math.*;
import toxi.geom.mesh2d.*;
import toxi.util.datatypes.*;
import toxi.util.events.*;
import toxi.geom.mesh.subdiv.*;
import toxi.geom.mesh.*;
import toxi.math.waves.*;
import toxi.util.*;
import toxi.math.noise.*;
/**
* Loads a B&W image and extrudes black pixels into
* a watertight 3D mesh.
* @author toxi
*
* Dependencies: toxiclibscore-0018, volumeutils-0004
* (or newer, available from: http://toxiclibs.org/ )
*/
import toxi.geom.*;
import toxi.geom.mesh.*;
import toxi.volume.*;
int scale=8;
int depth=32;
PImage img=loadImage("heightmap.gif");
Vec3D worldSize = new Vec3D(img.width, img.height, depth).scale(scale);
VolumetricSpace volume = new VolumetricSpace(worldSize, img.width, img.height, depth);
VolumetricBrush brush = new RoundBrush(volume, scale);
for (int y = 0; y < img.height; y ++) {
for (int x = 0; x < img.width; x ++) {
if (0 == (img.pixels[y * img.width + x] & 0xff)) {
for (int z = 0; z < depth; z++) {
brush.drawAtGridPos(x, y, z, 0.5f);
}
}
}
}
volume.closeSides();
TriangleMesh mesh = new IsoSurface(volume).computeSurfaceMesh(null, 0.1f);
mesh.saveAsSTL(sketchPath("test.stl"), true);
exit();
1