discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

"Inside minkowski"?

T
Troberg
Fri, Mar 16, 2018 12:32 PM

Minkowski works by (conceptually, I'm sure the practical workings to achieve
it under the hood are different) basically sliding the the second objects
center along the surface of the first, and then adding up all covered
spaces.

This means that, for example, if I want to make a rounded cube, I must
subtract the diameter of the ball from the size of the cube. Sure, I can do
that, but if I want a more complex form rounded, my brain soon starts to
hurt.

So, I thought, what if one did something like the minkowski, but instead of
sliding the center along the surface, we use the surface of the second
object as the contact point. That way, the dimensions of the first object
will be maintained, and the edges would be rounded (or whatever you want to
do).

Is there any way to do that?

--
Sent from: http://forum.openscad.org/

Minkowski works by (conceptually, I'm sure the practical workings to achieve it under the hood are different) basically sliding the the second objects center along the surface of the first, and then adding up all covered spaces. This means that, for example, if I want to make a rounded cube, I must subtract the diameter of the ball from the size of the cube. Sure, I can do that, but if I want a more complex form rounded, my brain soon starts to hurt. So, I thought, what if one did something like the minkowski, but instead of sliding the center along the surface, we use the surface of the second object as the contact point. That way, the dimensions of the first object will be maintained, and the edges would be rounded (or whatever you want to do). Is there any way to do that? -- Sent from: http://forum.openscad.org/
NH
nop head
Fri, Mar 16, 2018 12:44 PM

For 2D you can offset inwards and the outwards by the same amount.

For 3D you can probably make a negative object by subtracting the original
from a big cube, offset with Minkowski to make the inside smaller and
subtract from the original, then offset outwards with a second Minkowski,
but that can get slow.

On 16 March 2018 at 12:32, Troberg troberg.anders@gmail.com wrote:

Minkowski works by (conceptually, I'm sure the practical workings to
achieve
it under the hood are different) basically sliding the the second objects
center along the surface of the first, and then adding up all covered
spaces.

This means that, for example, if I want to make a rounded cube, I must
subtract the diameter of the ball from the size of the cube. Sure, I can do
that, but if I want a more complex form rounded, my brain soon starts to
hurt.

So, I thought, what if one did something like the minkowski, but instead of
sliding the center along the surface, we use the surface of the second
object as the contact point. That way, the dimensions of the first object
will be maintained, and the edges would be rounded (or whatever you want to
do).

Is there any way to do that?

--
Sent from: http://forum.openscad.org/


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

For 2D you can offset inwards and the outwards by the same amount. For 3D you can probably make a negative object by subtracting the original from a big cube, offset with Minkowski to make the inside smaller and subtract from the original, then offset outwards with a second Minkowski, but that can get slow. On 16 March 2018 at 12:32, Troberg <troberg.anders@gmail.com> wrote: > Minkowski works by (conceptually, I'm sure the practical workings to > achieve > it under the hood are different) basically sliding the the second objects > center along the surface of the first, and then adding up all covered > spaces. > > This means that, for example, if I want to make a rounded cube, I must > subtract the diameter of the ball from the size of the cube. Sure, I can do > that, but if I want a more complex form rounded, my brain soon starts to > hurt. > > So, I thought, what if one did something like the minkowski, but instead of > sliding the center along the surface, we use the surface of the second > object as the contact point. That way, the dimensions of the first object > will be maintained, and the edges would be rounded (or whatever you want to > do). > > Is there any way to do that? > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
N
NateTG
Fri, Mar 16, 2018 3:58 PM

... So, I thought, what if one did something like the minkowski, but

instead of
sliding the center along the surface, we use the surface of the second
object as the contact point ...

"Use the surface as a the contact point" doesn't make sense - there are lots
of points on the surface.  Also if you pick any particular point on the
surface, you just end up with the minkowski sum again.

What you seem to want is a 3D version of "offset()" for automated rounding,
bevelling and maybe filleting.  (
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#offset
)  That's not so easy to do.

Automated bevelling is already on the list of requested features..

https://github.com/openscad/openscad/issues/884

--
Sent from: http://forum.openscad.org/

> ... So, I thought, what if one did something like the minkowski, but instead of sliding the center along the surface, we use the surface of the second object as the contact point ... "Use the surface as a the contact point" doesn't make sense - there are lots of points on the surface. Also if you pick any particular point on the surface, you just end up with the minkowski sum again. What you seem to want is a 3D version of "offset()" for automated rounding, bevelling and maybe filleting. ( https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#offset ) That's not so easy to do. Automated bevelling is already on the list of requested features.. https://github.com/openscad/openscad/issues/884 -- Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Fri, Mar 16, 2018 4:43 PM

What you seem to want is a 3D version of "offset()" for automated rounding,
bevelling and maybe filleting.  (
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_
OpenSCAD_Language#offset
)  That's not so easy to do.

​It is not efficient but it has been solved:

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Tips_and_Tricks#Filleting_objects

May be  also relevant  this discussion:

<goog_179910088>
http://forum.openscad.org/Chamfered-3D-text-td23162.html

> > What you seem to want is a 3D version of "offset()" for automated rounding, > bevelling and maybe filleting. ( > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_ > OpenSCAD_Language#offset > ) That's not so easy to do. ​It is not efficient but it has been solved: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Tips_and_Tricks#Filleting_objects May be also relevant this discussion: <goog_179910088> http://forum.openscad.org/Chamfered-3D-text-td23162.html ​
N
NateTG
Fri, Mar 16, 2018 6:59 PM

Pretty sure that there's a minus sign is in the wrong place on that, and it
should be:

     offset_3d(-4) offset_3d(4) // interior fillets
> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Tips_and_Tricks#Filleting_objects Pretty sure that there's a minus sign is in the wrong place on that, and it should be: > offset_3d(-4) offset_3d(4) // interior fillets -- Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Fri, Mar 16, 2018 11:00 PM

Tricks#Filleting_objects

Pretty sure that there's a minus sign is in the wrong place on that, and it
should be:

     offset_3d(-4) offset_3d(4) // interior fillets

​Nice catch. Updated.​

> > > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Tips_and_ > Tricks#Filleting_objects > > Pretty sure that there's a minus sign is in the wrong place on that, and it > should be: > > > offset_3d(-4) offset_3d(4) // interior fillets > ​Nice catch. Updated.​
T
Troberg
Sat, Mar 17, 2018 6:20 AM

"Use the surface as a the contact point" doesn't make sense - there are

lots
of points on the surface.  Also if you pick any particular point on the
surface, you just end up with the minkowski sum again.

It's hard to explain in words.

I'll try a simple example: I want rounded corners on a box. So, this
operation would, basically, take a sphere and move it around inside the box,
as if it was rolling on the inside (except, of course, that it wouldn't
actually rotate). So, basically, it's trapped inside, and moves everywhere
it can, but can't go further when surfaces touch (any point on either
surface).

--
Sent from: http://forum.openscad.org/

> "Use the surface as a the contact point" doesn't make sense - there are lots of points on the surface. Also if you pick any particular point on the surface, you just end up with the minkowski sum again. It's hard to explain in words. I'll try a simple example: I want rounded corners on a box. So, this operation would, basically, take a sphere and move it around inside the box, as if it was rolling on the inside (except, of course, that it wouldn't actually rotate). So, basically, it's trapped inside, and moves everywhere it can, but can't go further when surfaces touch (any point on either surface). -- Sent from: http://forum.openscad.org/
N
NateTG
Sat, Mar 17, 2018 6:45 AM

Troberg wrote

...

I'll try a simple example: I want rounded corners on a box. So, this
operation would, basically, take a sphere and move it around inside the
box,
as if it was rolling on the inside (except, of course, that it wouldn't
actually rotate). So, basically, it's trapped inside, and moves everywhere
it can, but can't go further when surfaces touch (any point on either
surface).
...

That's what the 'exterior fillet' example Ronaldo linked to does.  (Though
you might want to get a cup of coffee while that calculates.)

--
Sent from: http://forum.openscad.org/

Troberg wrote > ... > > I'll try a simple example: I want rounded corners on a box. So, this > operation would, basically, take a sphere and move it around inside the > box, > as if it was rolling on the inside (except, of course, that it wouldn't > actually rotate). So, basically, it's trapped inside, and moves everywhere > it can, but can't go further when surfaces touch (any point on either > surface). > ... That's what the 'exterior fillet' example Ronaldo linked to does. (Though you might want to get a cup of coffee while that calculates.) -- Sent from: http://forum.openscad.org/
NH
nop head
Sat, Mar 17, 2018 10:35 AM

Here is what I described earlier. It renders in 32 seconds on my machine.

$fn = 32;
inf = 1e10;

module erode(d)
render() difference() { // negate the result
cube(inf / 2, center = true);

    minkowski() {
        difference() { // negate original object
            cube(inf, center = true);

            children();
        }
        sphere(d);
    }
}

module round(d)
minkowski() {
erode(d)
children();
sphere(d);
}

round(3) {
cube([100, 50, 20]);
cube([10, 10, 30]);
}

On 17 March 2018 at 06:45, NateTG nate-openscadforum@pedantic.org wrote:

Troberg wrote

...

I'll try a simple example: I want rounded corners on a box. So, this
operation would, basically, take a sphere and move it around inside the
box,
as if it was rolling on the inside (except, of course, that it wouldn't
actually rotate). So, basically, it's trapped inside, and moves

everywhere

it can, but can't go further when surfaces touch (any point on either
surface).
...

That's what the 'exterior fillet' example Ronaldo linked to does.  (Though
you might want to get a cup of coffee while that calculates.)

--
Sent from: http://forum.openscad.org/


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

Here is what I described earlier. It renders in 32 seconds on my machine. $fn = 32; inf = 1e10; module erode(d) render() difference() { // negate the result cube(inf / 2, center = true); minkowski() { difference() { // negate original object cube(inf, center = true); children(); } sphere(d); } } module round(d) minkowski() { erode(d) children(); sphere(d); } round(3) { cube([100, 50, 20]); cube([10, 10, 30]); } On 17 March 2018 at 06:45, NateTG <nate-openscadforum@pedantic.org> wrote: > Troberg wrote > > ... > > > > I'll try a simple example: I want rounded corners on a box. So, this > > operation would, basically, take a sphere and move it around inside the > > box, > > as if it was rolling on the inside (except, of course, that it wouldn't > > actually rotate). So, basically, it's trapped inside, and moves > everywhere > > it can, but can't go further when surfaces touch (any point on either > > surface). > > ... > > That's what the 'exterior fillet' example Ronaldo linked to does. (Though > you might want to get a cup of coffee while that calculates.) > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
RP
Ronaldo Persiano
Sat, Mar 17, 2018 2:33 PM

Here is what I described earlier. It renders in 32 seconds on my machine.

​This is basically what is done by offset_3d​ I have referred before.
The processing time is reasonable when the model has few vertices.

> > Here is what I described earlier. It renders in 32 seconds on my machine. > ​This is basically what is done by offset_3d​ I have referred before. The processing time is reasonable when the model has few vertices.