Looking for advice

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for advice

laird
This post has NOT been accepted by the mailing list yet.
I'm trying to figure out if there's a way to use OpenSCAD to create a thin shell (i.e. inset) of an imported STL object. My specific goal is to generate two objects, one a thin shell and the other the interior, with an OpenSCAD-generated 3d fill pattern, so that I can feed them into a slicer and print the shell and interior with different profiles (e.g. high quality shell, low quality, fast interior), and control the interior fill pattern more than I can with my slicer.

I can of course do this for specific objects that I model, since I can build the shell programmatically in the design.

So far I haven't come up with a way to do it. My instinct is that some variation of Minkowski could work, but so far I've only managed to make an outset shell (easy), but I'd like to have it be inset so that the exterior dimensions match the original object.

The other approach, and it seems far more complex, would be to import the STL as a structured object, and manipulate that. But at that point, I'm not sure that OpenSCAD would be the right tool. Admittedly it doesn't have to be OpenSCAD to solve the problem, but it's so good at things like this, I figure I might as well try.

Thoughts? Suggestions.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for advice

kintel
Administrator
PS! you're still not subscribed to the mailing list, so your messages don't make it there..
Reply | Threaded
Open this post in threaded view
|

Re: Looking for advice

kintel
Administrator
In reply to this post by laird

We don’t yet have a 3D offset function, so shells must be made through creative use of minkowski.
This will be very very slow, but here’s a starting point (based on the 3D morphology at https://github.com/openscad/scad-utils/blob/master/morphology.scad):

module outset(d) {
   minkowski() {
       sphere(d);
       children();
   }
}

module inset(d) {
   inverse() outset(d) inverse() children();
}

module shell(d) {
   difference() {
       children();
       inset(d) children();
   }
}

module inverse() {
   difference() {
       cube(100,center=true);
       children();
   }
}

shell(2) cube(10);

-Marius