11

I am looking for a java library to create 3d-geometries and then convert that to .stl files so I can 3d print my object using a 3d printer.

I can imagine using a 3d-graphics object where one can draw the same like on a graphics2d object:

 Buffered3DObject obj = new Buffered3DObject(200,200,200, Unit.MM); 
 Graphics3D g3 = obj.getGraphics();
 Stroke3d stroke = new Stroke(3);
 g3.setStroke(stroke);
 g3.drawpipe(x1,y1,z1,x2,y2,z2);
 obj.exportToSTL("filename.stl");

Ok, I am just making up code :). But something like this.

Anybody know how I could pull something like this off? Any opensource libs that does stuff like this?

Would be nice to be able to generate a customized object through user input from a website.

Rob.

Edit: Even though the question is closed (and nobody cared to answer my question on why) I found my answer (I post it so others with the same question can find it):

There is a java library on its way as a wrapper around OpenScad. The java wrapper is called JavaScad. Can be found here JavaScad

bluevoid
  • 1,145
  • 10
  • 27
  • jmonkey can import many types but I dont know if it can export. – huseyin tugrul buyukisik Jul 03 '13 at 20:33
  • From what I read it can import existing models, I do not want to import that just create the model. – bluevoid Jul 03 '13 at 20:42
  • I found this class which can export java 3D to a .obj file: http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/src/com/eteks/sweethome3d/j3d/OBJWriter.java?view=markup but java 3d is quite limited in object manipulation – bluevoid Jul 03 '13 at 21:21
  • I do not understand why this is put on hold. Asking for the existence of a library is opinion based? I do not get this. I am not asking which technology is beter. Can someone enlighten me here? – bluevoid Jul 05 '13 at 13:02
  • Thanks everyone for reopening this question – bluevoid Feb 26 '14 at 09:34

3 Answers3

4

There is a java library which works as a wrapper around OpenScad. The java wrapper is called JavaScad. Can be found here JavaScad. It works fine and I actually contributed to the library already.

bluevoid
  • 1,145
  • 10
  • 27
  • Hi bluevoid, did you end up using JavaSCAD? If so, how did you manage to print eventually? The output file is .scad format and i'm looking how to convert it to stl or any other "printable" type.. – geo1302 Feb 25 '14 at 15:28
  • I import the scad file to openscad hit compile (F6) and the export as stl, then print. And yes I got good print results from my 3d-printer through it. OpenScad is a a bit of a memory hog: make sure to increase memory when your objects have many triangles (somewhere under preferences) – bluevoid Feb 26 '14 at 09:21
3
  • JCSG - Java implementation of BSP based CSG (Constructive Solid Geometry)
  • jsolid - wrapper around JCSG providing fluent API
Marcin Mikosik
  • 748
  • 7
  • 19
0

Another option is: abfab3d.com This is opensourced code from Shapeways. Its is more complex and uses voxels as a base, but can convert to mesh aswell. The code is at github: abfab3d @ github

I have not tried it, but will as the openscad route is slow and difficult to integrate in a webserver, so I will try it once I have time.

bluevoid
  • 1,145
  • 10
  • 27