I regularly have 3D models that consist of a Boolean union of balls and cylinders (molecule models, star maps, mathematical designs), that I then want to convert to a STL model for printing at Shapeways. But I don't know how to easily do that! I already have the model as a series of floating point numbers (four for each ball, and seven for each cylinder), so I don't want to have to go into a graphical interface to click/drag points. Instead I want to convert my lists of floating point numbers to STL from the command line.

I thought this would be a trivial thing, but I cannot find what is the best tool for this. All I need, I think, is a pointer to what tools are most appropriate (although more detailed help will be appreciated :-)) I thought that "gmsh" might be good for this, but it is not immediately clear to me how to use it for that.

I would like the software for this to be "free", in the sense that it does not cost money. Also, I am not a Windows user, so I would like to be able to run this under Linux or macOS.

  • 4
    I'm voting to close this question as off-topic because this is about 3D modeling for 3D printing. Try 3D printing stackexhange.
    – joojaa
    Commented Dec 1, 2019 at 13:40
  • 1
    I'm sorry that I didn't pay attention and posted to the wrong forum. I now reposted on the 3D printing stackexchange, although the answer here already satisfies all my needs. But I wondered whether the people there would come up with some alternatives (thus far they didn't). Commented Dec 2, 2019 at 19:54

1 Answer 1


I agree that this question is better suited to the 3D stack exchange. Perhaps a moderator will migrate it, hence this answer.

To the OP:

You may consider to use the free program OpenSCAD which works with Linux and can be run via command line. For your purposes, you may find it more useful to run it in GUI mode as it is a text based description type of program. Your values can be entered into the editor with appropriate modifiers to create the objects you require.

openscad screen shot

There is a thingiverse entry which provides for someone else's creation of various molecules, using OpenSCAD. The files accompanying the entry include the OpenSCAD code, which you'd be able to use as a reference or to modify to meet your requirements, reducing the learning curve.

thingiverse sample molecule

  • 1
    Yes, this is exactly what I needed, thanks! Commented Dec 2, 2019 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.