discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Function / operator similar to difference() for bounds along path? (Shapes can slip over each other)

L
lobrien
Sun, Jul 3, 2016 8:44 PM

I'm new to OpenSCAD, so forgive my ignorance of functions and terminology. I
am trying to design a shape that will slip over another piece. So, for
instance, imagine that I'm trying to create a cube/box that can slip over a
sphere: the function I'm looking for would create successfully larger
dimples until it reached the full diameter of the subtracted sphere, but
then would not close in despite the sphere being "inside" the box.

It seems to me that this might be done by translating the "clipping" shape
along a path, creating a thin difference(), projecting the negative of
that down the path and difference()ing that with the other elements of the
clipping shape, and then moving the clipping shape another increment.

Is there such a function or library?

--
View this message in context: http://forum.openscad.org/Function-operator-similar-to-difference-for-bounds-along-path-Shapes-can-slip-over-each-other-tp17871.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm new to OpenSCAD, so forgive my ignorance of functions and terminology. I am trying to design a shape that will slip over another piece. So, for instance, imagine that I'm trying to create a cube/box that can slip over a sphere: the function I'm looking for would create successfully larger dimples until it reached the full diameter of the subtracted sphere, but then *would not* close in despite the sphere being "inside" the box. It seems to me that this might be done by translating the "clipping" shape along a path, creating a thin difference(), projecting the negative of *that* down the path and difference()ing that with the other elements of the clipping shape, and then moving the clipping shape another increment. Is there such a function or library? -- View this message in context: http://forum.openscad.org/Function-operator-similar-to-difference-for-bounds-along-path-Shapes-can-slip-over-each-other-tp17871.html Sent from the OpenSCAD mailing list archive at Nabble.com.
LV
Lucas Vinicius Hartmann
Sun, Jul 3, 2016 8:58 PM

If your sphere is convex (they usually are,  but sphere here just means the
inside shape) then you can do this :

Difference ()  {
Cube(...) ;
Hull() {
Sphere(...) ;
Translate (where to slip to) sphere(...) ;
}
}

If you replace sphere() with a concave shape (e.g. a star) then hull will
not work as expected. Instead you may replace the hull(){...} section with
a hacked Minkowski. This will always slip the star up, rotate the cylinder
if you must change this.

Minkowski () {
Star(...) ;
Cylinder(h=slip distance, d=0.00001);
}
Em 3 de jul de 2016 17:45, "lobrien" lobrien@knowing.net escreveu:

I'm new to OpenSCAD, so forgive my ignorance of functions and terminology.
I
am trying to design a shape that will slip over another piece. So, for
instance, imagine that I'm trying to create a cube/box that can slip over a
sphere: the function I'm looking for would create successfully larger
dimples until it reached the full diameter of the subtracted sphere, but
then would not close in despite the sphere being "inside" the box.

It seems to me that this might be done by translating the "clipping" shape
along a path, creating a thin difference(), projecting the negative of
that down the path and difference()ing that with the other elements of
the
clipping shape, and then moving the clipping shape another increment.

Is there such a function or library?

--
View this message in context:
http://forum.openscad.org/Function-operator-similar-to-difference-for-bounds-along-path-Shapes-can-slip-over-each-other-tp17871.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

If your sphere is convex (they usually are, but sphere here just means the inside shape) then you can do this : Difference () { Cube(...) ; Hull() { Sphere(...) ; Translate (where to slip to) sphere(...) ; } } If you replace sphere() with a concave shape (e.g. a star) then hull will not work as expected. Instead you may replace the hull(){...} section with a hacked Minkowski. This will always slip the star up, rotate the cylinder if you must change this. Minkowski () { Star(...) ; Cylinder(h=slip distance, d=0.00001); } Em 3 de jul de 2016 17:45, "lobrien" <lobrien@knowing.net> escreveu: > I'm new to OpenSCAD, so forgive my ignorance of functions and terminology. > I > am trying to design a shape that will slip over another piece. So, for > instance, imagine that I'm trying to create a cube/box that can slip over a > sphere: the function I'm looking for would create successfully larger > dimples until it reached the full diameter of the subtracted sphere, but > then *would not* close in despite the sphere being "inside" the box. > > It seems to me that this might be done by translating the "clipping" shape > along a path, creating a thin difference(), projecting the negative of > *that* down the path and difference()ing that with the other elements of > the > clipping shape, and then moving the clipping shape another increment. > > Is there such a function or library? > > > > -- > View this message in context: > http://forum.openscad.org/Function-operator-similar-to-difference-for-bounds-along-path-Shapes-can-slip-over-each-other-tp17871.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >