3D part design with Inkscape and OpenSCAD # 116: Getting bounding box information from multiple objects.

2 min read
By Bob
3D part design with Inkscape and OpenSCAD # 116: Getting bounding box information from multiple objects.

When you import multiple objects into OpenSCAD there is an easy way to get the individual bounding box information for each object by simply showing the object you want the info for and hiding the other objects. I do this quite a bit with the OpenSCAD code I write by putting in a "show object" check box:

different objects moved to different layers in Inkscape
The SVG layer import code I have posted on this site

Above only SVG layer one is shown and I can press render to get its size and location,

Here layer 2 is displayed and the bounding box info only shows for layer 2 etc.

You can do this really easily for any imported file, here is an example with the same objects that I exported to stl for this post:

and the code:

show1=true;
show2=true;
show3=true;


if(show1)
import("yourfile1.stl");
if(show2)
import("yourfile2.stl");
if(show3)
import("yourfile3.stl");