discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: python support for openscad

SP
Sanjeev Prabhakar
Sun, Jul 23, 2023 4:07 PM

In the past I have shared few examples which probably are very difficult to
do in pure openscad.

Python is a very convenient, easy to learn and use language as per me.

Is probably not more than 2 years that I started learning python. I
wouldn't call myself proficient in the language but at the least I could
make few very complicated models through this.

In the past I have shared few examples which probably are very difficult to do in pure openscad. Python is a very convenient, easy to learn and use language as per me. Is probably not more than 2 years that I started learning python. I wouldn't call myself proficient in the language but at the least I could make few very complicated models through this.
SP
Sanjeev Prabhakar
Sun, Jul 23, 2023 4:34 PM

example attached where a fillet is created:
calculations for this are done in python.
[image: Screenshot 2023-07-22 at 9.41.49 PM.png]

On Sun, 23 Jul 2023 at 21:37, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

In the past I have shared few examples which probably are very difficult
to do in pure openscad.

Python is a very convenient, easy to learn and use language as per me.

Is probably not more than 2 years that I started learning python. I
wouldn't call myself proficient in the language but at the least I could
make few very complicated models through this.

example attached where a fillet is created: calculations for this are done in python. [image: Screenshot 2023-07-22 at 9.41.49 PM.png] On Sun, 23 Jul 2023 at 21:37, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > In the past I have shared few examples which probably are very difficult > to do in pure openscad. > > Python is a very convenient, easy to learn and use language as per me. > > Is probably not more than 2 years that I started learning python. I > wouldn't call myself proficient in the language but at the least I could > make few very complicated models through this. > > > >
TP
Torsten Paul
Sun, Jul 23, 2023 4:45 PM

On 23.07.23 18:34, Sanjeev Prabhakar wrote:

example attached where a fillet is created:
calculations for this are done in python.

That is great stuff, but in my view it would belong into the geometry
engine.

Maybe you can help with the calculation side of that?

ciao,
Torsten.

On 23.07.23 18:34, Sanjeev Prabhakar wrote: > example attached where a fillet is created: > calculations for this are done in python. That is great stuff, but in my view it would belong into the geometry engine. Maybe you can help with the calculation side of that? ciao, Torsten.
RW
Rogier Wolff
Sun, Jul 23, 2023 4:59 PM

On Sun, Jul 23, 2023 at 09:37:10PM +0530, Sanjeev Prabhakar wrote:

In the past I have shared few examples which probably are very difficult to
do in pure openscad.

Python is a very convenient, easy to learn and use language as per me.

Is probably not more than 2 years that I started learning python. I
wouldn't call myself proficient in the language but at the least I
could make few very complicated models through this.

I agree that a procedural language addition to openscad would be very
useful. Some things are much easier to express procedurally than the
way openscad would like you to formulate things.

For example building up an array element by element is awkward in
openscad, while "natural" in a procedural language.

It took me a long time to figure out why a module using a global
variable wouldn't instantiate in two different ways when I changed the
global variable between calls. (back then openscad didn't have the
warning that is generated nowadays).

I agree with the openscad folks that it is an advantage that an
openscad script is just "data": It cannot affect your computer beyond
bogging it down for a while while trying to render it. Just like a
"word processor documuent" should be.

How about allowing the python extension to be activated by a
commandline argument but also by using a different binary name.

pyopenscad, popenscad or maybe openpyscad. (That last one... might not
be such a good idea... ). And a different extension.

For those that are paranoid (and those that don't have python at
compile-time) it should remain possible to compile without python
support.

I'm hoping such a construction would satisfy both ends of this
discussion.

Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sun, Jul 23, 2023 at 09:37:10PM +0530, Sanjeev Prabhakar wrote: > In the past I have shared few examples which probably are very difficult to > do in pure openscad. > > Python is a very convenient, easy to learn and use language as per me. > Is probably not more than 2 years that I started learning python. I > wouldn't call myself proficient in the language but at the least I > could make few very complicated models through this. I agree that a procedural language addition to openscad would be very useful. Some things are much easier to express procedurally than the way openscad would like you to formulate things. For example building up an array element by element is awkward in openscad, while "natural" in a procedural language. It took me a long time to figure out why a module using a global variable wouldn't instantiate in two different ways when I changed the global variable between calls. (back then openscad didn't have the warning that is generated nowadays). I agree with the openscad folks that it is an advantage that an openscad script is just "data": It cannot affect your computer beyond bogging it down for a while while trying to render it. Just like a "word processor documuent" should be. How about allowing the python extension to be activated by a commandline argument but also by using a different binary name. pyopenscad, popenscad or maybe openpyscad. (That last one... might not be such a good idea... ). And a different extension. For those that are paranoid (and those that don't have python at compile-time) it should remain possible to compile without python support. I'm hoping such a construction would satisfy both ends of this discussion. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
SP
Sanjeev Prabhakar
Sun, Jul 23, 2023 4:59 PM

Thanks

It's a little complicated to explain,  but the main thing is calculating
the intersection line between 2 solids.

Once you get the intersection line,  then it's not so difficult to create
any fillet.

On Sun, 23 Jul 2023, 22:16 Torsten Paul, Torsten.Paul@gmx.de wrote:

On 23.07.23 18:34, Sanjeev Prabhakar wrote:

example attached where a fillet is created:
calculations for this are done in python.

That is great stuff, but in my view it would belong into the geometry
engine.

Maybe you can help with the calculation side of that?

ciao,
Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks It's a little complicated to explain, but the main thing is calculating the intersection line between 2 solids. Once you get the intersection line, then it's not so difficult to create any fillet. On Sun, 23 Jul 2023, 22:16 Torsten Paul, <Torsten.Paul@gmx.de> wrote: > On 23.07.23 18:34, Sanjeev Prabhakar wrote: > > example attached where a fillet is created: > > calculations for this are done in python. > > That is great stuff, but in my view it would belong into the geometry > engine. > > Maybe you can help with the calculation side of that? > > ciao, > Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Rogier Wolff
Sun, Jul 23, 2023 5:03 PM

On Sun, Jul 23, 2023 at 06:45:41PM +0200, Torsten Paul wrote:

On 23.07.23 18:34, Sanjeev Prabhakar wrote:

example attached where a fillet is created:
calculations for this are done in python.

That is great stuff, but in my view it would belong into the geometry
engine.

Maybe you can help with the calculation side of that?

This specific case of "a fillet" is something that might be welcome in
openscad. But that is not the point that Sanjeev is trying to make.

There are manythings that are relatively easy to do in
python-enhanced-openscad, that are hard to do in vanilla openscad. Not
just fillets. His example might make sense to "Oh, but we want that to
be possible in plain openscad". You can't keep saying that for
everything that anybody can come up with.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sun, Jul 23, 2023 at 06:45:41PM +0200, Torsten Paul wrote: > On 23.07.23 18:34, Sanjeev Prabhakar wrote: > > example attached where a fillet is created: > > calculations for this are done in python. > > That is great stuff, but in my view it would belong into the geometry > engine. > > Maybe you can help with the calculation side of that? This specific case of "a fillet" is something that might be welcome in openscad. But that is not the point that Sanjeev is trying to make. There are manythings that are relatively easy to do in python-enhanced-openscad, that are hard to do in vanilla openscad. Not just fillets. His example might make sense to "Oh, but we want that to be possible in plain openscad". You can't keep saying that for everything that anybody can come up with. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
TP
Torsten Paul
Sun, Jul 23, 2023 5:04 PM

On 23.07.23 18:59, Sanjeev Prabhakar wrote:

Once you get the intersection line,  then it's not so difficult to create any fillet.

I have not looked at the details, but my understanding from some discussion
in the Manifold repository is there are IDs in the CSG output that detail to
which part the new faces belong. From that it should be possible to get the
information which vertices are that intersection line.

Maybe we can try some demo code separate from OpenSCAD to see if we can get
your algorithm into Manifold based C++ code.

ciao,
Torsten.

On 23.07.23 18:59, Sanjeev Prabhakar wrote: > Once you get the intersection line,  then it's not so difficult to create any fillet. I have not looked at the details, but my understanding from some discussion in the Manifold repository is there are IDs in the CSG output that detail to which part the new faces belong. From that it should be possible to get the information which vertices are that intersection line. Maybe we can try some demo code separate from OpenSCAD to see if we can get your algorithm into Manifold based C++ code. ciao, Torsten.
RW
Rogier Wolff
Sun, Jul 23, 2023 5:10 PM

On Sun, Jul 23, 2023 at 10:29:34PM +0530, Sanjeev Prabhakar wrote:

Thanks

It's a little complicated to explain,  but the main thing is calculating
the intersection line between 2 solids.

Once you get the intersection line,  then it's not so difficult to create
any fillet.

I'm guessing that it can become complicated.
Try this:

fillet_radius = 3;
dist = 10;
size = 10;

fillet (radius= fillet_radius) {
cube ([size2+dist, size, size]);
cube ([size, size, 2
size]);
translate ([size+dist, 0,0]) cube ([size, size, 2*size]);
}

Easy. But what if dist is reduced to below 2*fillet_radius ? You can
intersect the radii but then you'll get a sharp inside corner that the
fillet is supposed to be preventing.

And what if dist is reducted to below 1*fillet_radius ? Does the space
between the objects fill completely with fillet?

In the general case, this is quite hard.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sun, Jul 23, 2023 at 10:29:34PM +0530, Sanjeev Prabhakar wrote: > Thanks > > It's a little complicated to explain, but the main thing is calculating > the intersection line between 2 solids. > > Once you get the intersection line, then it's not so difficult to create > any fillet. I'm guessing that it can become complicated. Try this: fillet_radius = 3; dist = 10; size = 10; fillet (radius= fillet_radius) { cube ([size*2+dist, size, size]); cube ([size, size, 2*size]); translate ([size+dist, 0,0]) cube ([size, size, 2*size]); } Easy. But what if dist is reduced to below 2*fillet_radius ? You can intersect the radii but then you'll get a sharp inside corner that the fillet is supposed to be preventing. And what if dist is reducted to below 1*fillet_radius ? Does the space between the objects fill completely with fillet? In the general case, this is quite hard. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
TP
Torsten Paul
Sun, Jul 23, 2023 5:11 PM

On 23.07.23 18:59, Rogier Wolff wrote:

I'm hoping such a construction would satisfy both ends of this
discussion.

The related logic is already merged into OpenSCAD master and the
PR adding the actual Python interface is accepted in spirit, just
pending some detailed code review. So it's only a matter of finding
the time, no general open discussion.

https://github.com/openscad/openscad/pull/4702

Getting builds to enable this feature is going to be a challenge,
as I mentioned before, but we'll have to see if we can get some
help with that.

ciao,
Torsten.

On 23.07.23 18:59, Rogier Wolff wrote: > I'm hoping such a construction would satisfy both ends of this > discussion. The related logic is already merged into OpenSCAD master and the PR adding the actual Python interface is accepted in spirit, just pending some detailed code review. So it's only a matter of finding the time, no general open discussion. https://github.com/openscad/openscad/pull/4702 Getting builds to enable this feature is going to be a challenge, as I mentioned before, but we'll have to see if we can get some help with that. ciao, Torsten.
SP
Sanjeev Prabhakar
Sun, Jul 23, 2023 5:13 PM

Sure
I will try to explain the logic maybe in a day or two for the benefit of
all who maybe interested in geometry manipulations.

Sure I will try to explain the logic maybe in a day or two for the benefit of all who maybe interested in geometry manipulations.
AM
Adrian Mariano
Sun, Jul 23, 2023 7:07 PM

I've been working on BOSL2 for a while with Revar, and we have 60k lines of
OpenSCAD code.  Based on that experience, I think that the problem with the
OpenSCAD language is NOT fundamentally that it is functional.  The benefit
of python is NOT fundamentally that it is procedural.  There are two basic
problems with OpenSCAD for doing more complicated user space processing.
One is the inability to gain access to geometry, so to do user space
design, everything from the ground up has to be done "outside" of the
OpenSCAD geometry engine.  The second problem is about efficiency.
OpenSCAD has no data structures.  Graphics algorithms assume access to
sophisticated and efficient data structures like a priority queue or a tree
or other kinds of things that are impossible to implement efficiently in
OpenSCAD.  So, yeah, you can implement the data structure, but instead of
being O(log N) or whatever it will be O(N^2).  So then trying to implement
that process that uses that data structure in user space becomes
intractable.  It's not clear to me that this limitation is fundamentally
about the language being functional.

Note that the filleting process displayed by Sanjeev is straight forward to
implement in principle.  You just find the intersection of two things and
put a fillet there.  Two complications arise for doing this in userspace in
OpenSCAD.  The first is representing the things, because again, you can't
use the geometry engine to do it.  Now maybe a solution to that problem is
coming?  The second complication is dealing with self-intersections of the
resulting polyhedron, because that's intractable in OpenSCAD.  Really it
seems like OpenSCAD should have a primitive that accepts a series of
profiles and links them together into a polyhedron, even if it's
self-intersecting.

Here's examples of doing the fillet problem entirely in OpenSCAD
userspace.  There are many examples at the link below.  I show a single one
in this message.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

[image: image.png]

On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

Sure
I will try to explain the logic maybe in a day or two for the benefit of
all who maybe interested in geometry manipulations.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've been working on BOSL2 for a while with Revar, and we have 60k lines of OpenSCAD code. Based on that experience, I think that the problem with the OpenSCAD language is NOT fundamentally that it is functional. The benefit of python is NOT fundamentally that it is procedural. There are two basic problems with OpenSCAD for doing more complicated user space processing. One is the inability to gain access to geometry, so to do user space design, everything from the ground up has to be done "outside" of the OpenSCAD geometry engine. The second problem is about efficiency. OpenSCAD has no data structures. Graphics algorithms assume access to sophisticated and efficient data structures like a priority queue or a tree or other kinds of things that are impossible to implement efficiently in OpenSCAD. So, yeah, you can implement the data structure, but instead of being O(log N) or whatever it will be O(N^2). So then trying to implement that process that uses that data structure in user space becomes intractable. It's not clear to me that this limitation is fundamentally about the language being functional. Note that the filleting process displayed by Sanjeev is straight forward to implement in principle. You just find the intersection of two things and put a fillet there. Two complications arise for doing this in userspace in OpenSCAD. The first is representing the things, because again, you can't use the geometry engine to do it. Now maybe a solution to that problem is coming? The second complication is dealing with self-intersections of the resulting polyhedron, because that's intractable in OpenSCAD. Really it seems like OpenSCAD should have a primitive that accepts a series of profiles and links them together into a polyhedron, even if it's self-intersecting. Here's examples of doing the fillet problem entirely in OpenSCAD userspace. There are many examples at the link below. I show a single one in this message. https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism [image: image.png] On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > Sure > I will try to explain the logic maybe in a day or two for the benefit of > all who maybe interested in geometry manipulations. > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
NH
nop head
Sun, Jul 23, 2023 7:17 PM

I am not sure 3D fillets are any use in FDM printing because of the layers.
I only use 2D fillets to get rounded tool paths.

On Sun, 23 Jul 2023, 20:08 Adrian Mariano, avm4@cornell.edu wrote:

I've been working on BOSL2 for a while with Revar, and we have 60k lines
of OpenSCAD code.  Based on that experience, I think that the problem with
the OpenSCAD language is NOT fundamentally that it is functional.  The
benefit of python is NOT fundamentally that it is procedural.  There are
two basic problems with OpenSCAD for doing more complicated user space
processing.  One is the inability to gain access to geometry, so to do user
space design, everything from the ground up has to be done "outside" of the
OpenSCAD geometry engine.  The second problem is about efficiency.
OpenSCAD has no data structures.  Graphics algorithms assume access to
sophisticated and efficient data structures like a priority queue or a tree
or other kinds of things that are impossible to implement efficiently in
OpenSCAD.  So, yeah, you can implement the data structure, but instead of
being O(log N) or whatever it will be O(N^2).  So then trying to implement
that process that uses that data structure in user space becomes
intractable.  It's not clear to me that this limitation is fundamentally
about the language being functional.

Note that the filleting process displayed by Sanjeev is straight forward
to implement in principle.  You just find the intersection of two things
and put a fillet there.  Two complications arise for doing this in
userspace in OpenSCAD.  The first is representing the things, because
again, you can't use the geometry engine to do it.  Now maybe a solution to
that problem is coming?  The second complication is dealing with
self-intersections of the resulting polyhedron, because that's intractable
in OpenSCAD.  Really it seems like OpenSCAD should have a primitive that
accepts a series of profiles and links them together into a polyhedron,
even if it's self-intersecting.

Here's examples of doing the fillet problem entirely in OpenSCAD
userspace.  There are many examples at the link below.  I show a single one
in this message.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

[image: image.png]

On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Sure
I will try to explain the logic maybe in a day or two for the benefit of
all who maybe interested in geometry manipulations.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I am not sure 3D fillets are any use in FDM printing because of the layers. I only use 2D fillets to get rounded tool paths. On Sun, 23 Jul 2023, 20:08 Adrian Mariano, <avm4@cornell.edu> wrote: > I've been working on BOSL2 for a while with Revar, and we have 60k lines > of OpenSCAD code. Based on that experience, I think that the problem with > the OpenSCAD language is NOT fundamentally that it is functional. The > benefit of python is NOT fundamentally that it is procedural. There are > two basic problems with OpenSCAD for doing more complicated user space > processing. One is the inability to gain access to geometry, so to do user > space design, everything from the ground up has to be done "outside" of the > OpenSCAD geometry engine. The second problem is about efficiency. > OpenSCAD has no data structures. Graphics algorithms assume access to > sophisticated and efficient data structures like a priority queue or a tree > or other kinds of things that are impossible to implement efficiently in > OpenSCAD. So, yeah, you can implement the data structure, but instead of > being O(log N) or whatever it will be O(N^2). So then trying to implement > that process that uses that data structure in user space becomes > intractable. It's not clear to me that this limitation is fundamentally > about the language being functional. > > Note that the filleting process displayed by Sanjeev is straight forward > to implement in principle. You just find the intersection of two things > and put a fillet there. Two complications arise for doing this in > userspace in OpenSCAD. The first is representing the things, because > again, you can't use the geometry engine to do it. Now maybe a solution to > that problem is coming? The second complication is dealing with > self-intersections of the resulting polyhedron, because that's intractable > in OpenSCAD. Really it seems like OpenSCAD should have a primitive that > accepts a series of profiles and links them together into a polyhedron, > even if it's self-intersecting. > > Here's examples of doing the fillet problem entirely in OpenSCAD > userspace. There are many examples at the link below. I show a single one > in this message. > > > https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism > > [image: image.png] > > > On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar < > sprabhakar2006@gmail.com> wrote: > >> Sure >> I will try to explain the logic maybe in a day or two for the benefit of >> all who maybe interested in geometry manipulations. >> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Sun, Jul 23, 2023 7:23 PM

Are you thinking that the layers break the propagation of stress through
the model, causing stress to concentrate at each layer, instead of
concentrating at a corner?  Have you observed that models which fail by
layers shearing do so and random places in the model?

On Sun, Jul 23, 2023 at 3:18 PM nop head nop.head@gmail.com wrote:

I am not sure 3D fillets are any use in FDM printing because of the
layers. I only use 2D fillets to get rounded tool paths.

On Sun, 23 Jul 2023, 20:08 Adrian Mariano, avm4@cornell.edu wrote:

I've been working on BOSL2 for a while with Revar, and we have 60k lines
of OpenSCAD code.  Based on that experience, I think that the problem with
the OpenSCAD language is NOT fundamentally that it is functional.  The
benefit of python is NOT fundamentally that it is procedural.  There are
two basic problems with OpenSCAD for doing more complicated user space
processing.  One is the inability to gain access to geometry, so to do user
space design, everything from the ground up has to be done "outside" of the
OpenSCAD geometry engine.  The second problem is about efficiency.
OpenSCAD has no data structures.  Graphics algorithms assume access to
sophisticated and efficient data structures like a priority queue or a tree
or other kinds of things that are impossible to implement efficiently in
OpenSCAD.  So, yeah, you can implement the data structure, but instead of
being O(log N) or whatever it will be O(N^2).  So then trying to implement
that process that uses that data structure in user space becomes
intractable.  It's not clear to me that this limitation is fundamentally
about the language being functional.

Note that the filleting process displayed by Sanjeev is straight forward
to implement in principle.  You just find the intersection of two things
and put a fillet there.  Two complications arise for doing this in
userspace in OpenSCAD.  The first is representing the things, because
again, you can't use the geometry engine to do it.  Now maybe a solution to
that problem is coming?  The second complication is dealing with
self-intersections of the resulting polyhedron, because that's intractable
in OpenSCAD.  Really it seems like OpenSCAD should have a primitive that
accepts a series of profiles and links them together into a polyhedron,
even if it's self-intersecting.

Here's examples of doing the fillet problem entirely in OpenSCAD
userspace.  There are many examples at the link below.  I show a single one
in this message.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

[image: image.png]

On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Sure
I will try to explain the logic maybe in a day or two for the benefit of
all who maybe interested in geometry manipulations.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Are you thinking that the layers break the propagation of stress through the model, causing stress to concentrate at each layer, instead of concentrating at a corner? Have you observed that models which fail by layers shearing do so and random places in the model? On Sun, Jul 23, 2023 at 3:18 PM nop head <nop.head@gmail.com> wrote: > I am not sure 3D fillets are any use in FDM printing because of the > layers. I only use 2D fillets to get rounded tool paths. > > On Sun, 23 Jul 2023, 20:08 Adrian Mariano, <avm4@cornell.edu> wrote: > >> I've been working on BOSL2 for a while with Revar, and we have 60k lines >> of OpenSCAD code. Based on that experience, I think that the problem with >> the OpenSCAD language is NOT fundamentally that it is functional. The >> benefit of python is NOT fundamentally that it is procedural. There are >> two basic problems with OpenSCAD for doing more complicated user space >> processing. One is the inability to gain access to geometry, so to do user >> space design, everything from the ground up has to be done "outside" of the >> OpenSCAD geometry engine. The second problem is about efficiency. >> OpenSCAD has no data structures. Graphics algorithms assume access to >> sophisticated and efficient data structures like a priority queue or a tree >> or other kinds of things that are impossible to implement efficiently in >> OpenSCAD. So, yeah, you can implement the data structure, but instead of >> being O(log N) or whatever it will be O(N^2). So then trying to implement >> that process that uses that data structure in user space becomes >> intractable. It's not clear to me that this limitation is fundamentally >> about the language being functional. >> >> Note that the filleting process displayed by Sanjeev is straight forward >> to implement in principle. You just find the intersection of two things >> and put a fillet there. Two complications arise for doing this in >> userspace in OpenSCAD. The first is representing the things, because >> again, you can't use the geometry engine to do it. Now maybe a solution to >> that problem is coming? The second complication is dealing with >> self-intersections of the resulting polyhedron, because that's intractable >> in OpenSCAD. Really it seems like OpenSCAD should have a primitive that >> accepts a series of profiles and links them together into a polyhedron, >> even if it's self-intersecting. >> >> Here's examples of doing the fillet problem entirely in OpenSCAD >> userspace. There are many examples at the link below. I show a single one >> in this message. >> >> >> https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism >> >> [image: image.png] >> >> >> On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar < >> sprabhakar2006@gmail.com> wrote: >> >>> Sure >>> I will try to explain the logic maybe in a day or two for the benefit of >>> all who maybe interested in geometry manipulations. >>> >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GS
Guenther Sohler
Sun, Jul 23, 2023 7:45 PM

Adriano, thank you for your input
I appreciate your work with Revar on BOSL2 and I understand your reasoning
that BOSL2 could become obsolete,
but I am sure it will not. When openscad becomes more powerful, BOSL code
might be able to code with fewer lines, but  BOSL2 is still very important
to openscad.

Yes, I would appreciate OpenSCAD to have access to the internal vertices to
read them and work with the coordinates.

Unfortunately this is not as easy, because often a model is developed in
OpenCSG and there are no coordinates available in OpenSCG.
If you accept the fact that a full render has to be performed to get
coordinates of a submodule. It's just a matter of a PR.
If somebody guarantees,  that such a PR will actually be accepted/merged,
time to develop on such a PR would not be an issue.

My Main Problem with SCAD language is that variables cannot be reassigned,
once they are set -> could probably be solved with most other interpreter
languages.
The main benefit I see with python is not the opposite of the previous
statement.  Python is just any interpreter language choice. but its very
easy to learn and very easy to read.
PLUS: it has many accompanying libraries which will help you to do fancy
stuff with OpenSCAD.
for example this one:

http://guenther-sohler.net/openscad/examples/qrcode.txt
these few lines of code creates an qr code display object , which you can
scan  with your mobile. (Yes, i have seen openscad qr code libs, but this
one appears easier and has more options)

And your second statement : OpenSCAD has datastructures is also valid.
Polyhedra are composed of triangles which are stored as coordinates only!
It would be much better to compose triangles from
indices into a global vertex array. This is something I am right now
working on.(some ctests are not passed for my PR)
Information which could also be stored with the  "indexed " polygons is: a
lookup table from point -> which triangles use this point.

And Yes, I like your fillet and I personally appreciate , if Sanjeev's
knowledge could go into GeomtryEvaluator.cc

In the End, I'd like to see openscad become more powerful by being able to
change variables once they are set and to use external libs.
And yes, I know that I am aware that people might see this as a security
risk, but those people can stay safe and do not even need to bother when
not activating it.
The rest and the interested people instead can leverage the new power
coming from python.

Thank you for reading

On Sun, Jul 23, 2023 at 9:08 PM Adrian Mariano avm4@cornell.edu wrote:

I've been working on BOSL2 for a while with Revar, and we have 60k lines
of OpenSCAD code.  Based on that experience, I think that the problem with
the OpenSCAD language is NOT fundamentally that it is functional.  The
benefit of python is NOT fundamentally that it is procedural.  There are
two basic problems with OpenSCAD for doing more complicated user space
processing.  One is the inability to gain access to geometry, so to do user
space design, everything from the ground up has to be done "outside" of the
OpenSCAD geometry engine.  The second problem is about efficiency.
OpenSCAD has no data structures.  Graphics algorithms assume access to
sophisticated and efficient data structures like a priority queue or a tree
or other kinds of things that are impossible to implement efficiently in
OpenSCAD.  So, yeah, you can implement the data structure, but instead of
being O(log N) or whatever it will be O(N^2).  So then trying to implement
that process that uses that data structure in user space becomes
intractable.  It's not clear to me that this limitation is fundamentally
about the language being functional.

Note that the filleting process displayed by Sanjeev is straight forward
to implement in principle.  You just find the intersection of two things
and put a fillet there.  Two complications arise for doing this in
userspace in OpenSCAD.  The first is representing the things, because
again, you can't use the geometry engine to do it.  Now maybe a solution to
that problem is coming?  The second complication is dealing with
self-intersections of the resulting polyhedron, because that's intractable
in OpenSCAD.  Really it seems like OpenSCAD should have a primitive that
accepts a series of profiles and links them together into a polyhedron,
even if it's self-intersecting.

Here's examples of doing the fillet problem entirely in OpenSCAD
userspace.  There are many examples at the link below.  I show a single one
in this message.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

[image: image.png]

On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Sure
I will try to explain the logic maybe in a day or two for the benefit of
all who maybe interested in geometry manipulations.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Adriano, thank you for your input I appreciate your work with Revar on BOSL2 and I understand your reasoning that BOSL2 could become obsolete, but I am sure it will not. When openscad becomes more powerful, BOSL code might be able to code with fewer lines, but BOSL2 is still very important to openscad. Yes, I would appreciate OpenSCAD to have access to the internal vertices to read them and work with the coordinates. Unfortunately this is not as easy, because often a model is developed in OpenCSG and there are no coordinates available in OpenSCG. If you accept the fact that a full render has to be performed to get coordinates of a submodule. It's just a matter of a PR. If somebody guarantees, that such a PR will actually be accepted/merged, time to develop on such a PR would not be an issue. My Main Problem with SCAD language is that variables cannot be reassigned, once they are set -> could probably be solved with most other interpreter languages. The main benefit I see with python is not the opposite of the previous statement. Python is just any interpreter language choice. but its very easy to learn and very easy to read. PLUS: it has many accompanying libraries which will help you to do fancy stuff with OpenSCAD. for example this one: http://guenther-sohler.net/openscad/examples/qrcode.txt these few lines of code creates an qr code display object , which you can scan with your mobile. (Yes, i have seen openscad qr code libs, but this one appears easier and has more options) And your second statement : OpenSCAD has datastructures is also valid. Polyhedra are composed of triangles which are stored as coordinates only! It would be much better to compose triangles from indices into a global vertex array. This is something I am right now working on.(some ctests are not passed for my PR) Information which could also be stored with the "indexed " polygons is: a lookup table from point -> which triangles use this point. And Yes, I like your fillet and I personally appreciate , if Sanjeev's knowledge could go into GeomtryEvaluator.cc In the End, I'd like to see openscad become more powerful by being able to change variables once they are set and to use external libs. And yes, I know that I am aware that people might see this as a security risk, but those people can stay safe and do not even need to bother when not activating it. The rest and the interested people instead can leverage the new power coming from python. Thank you for reading On Sun, Jul 23, 2023 at 9:08 PM Adrian Mariano <avm4@cornell.edu> wrote: > I've been working on BOSL2 for a while with Revar, and we have 60k lines > of OpenSCAD code. Based on that experience, I think that the problem with > the OpenSCAD language is NOT fundamentally that it is functional. The > benefit of python is NOT fundamentally that it is procedural. There are > two basic problems with OpenSCAD for doing more complicated user space > processing. One is the inability to gain access to geometry, so to do user > space design, everything from the ground up has to be done "outside" of the > OpenSCAD geometry engine. The second problem is about efficiency. > OpenSCAD has no data structures. Graphics algorithms assume access to > sophisticated and efficient data structures like a priority queue or a tree > or other kinds of things that are impossible to implement efficiently in > OpenSCAD. So, yeah, you can implement the data structure, but instead of > being O(log N) or whatever it will be O(N^2). So then trying to implement > that process that uses that data structure in user space becomes > intractable. It's not clear to me that this limitation is fundamentally > about the language being functional. > > Note that the filleting process displayed by Sanjeev is straight forward > to implement in principle. You just find the intersection of two things > and put a fillet there. Two complications arise for doing this in > userspace in OpenSCAD. The first is representing the things, because > again, you can't use the geometry engine to do it. Now maybe a solution to > that problem is coming? The second complication is dealing with > self-intersections of the resulting polyhedron, because that's intractable > in OpenSCAD. Really it seems like OpenSCAD should have a primitive that > accepts a series of profiles and links them together into a polyhedron, > even if it's self-intersecting. > > Here's examples of doing the fillet problem entirely in OpenSCAD > userspace. There are many examples at the link below. I show a single one > in this message. > > > https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism > > [image: image.png] > > > On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar < > sprabhakar2006@gmail.com> wrote: > >> Sure >> I will try to explain the logic maybe in a day or two for the benefit of >> all who maybe interested in geometry manipulations. >> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
NH
nop head
Sun, Jul 23, 2023 8:00 PM

The fact that prints always break along layer lines means adding a fillet
that is made of layers hardly affects the strength in my opinion.

On Sun, 23 Jul 2023, 20:24 Adrian Mariano, avm4@cornell.edu wrote:

Are you thinking that the layers break the propagation of stress through
the model, causing stress to concentrate at each layer, instead of
concentrating at a corner?  Have you observed that models which fail by
layers shearing do so and random places in the model?

On Sun, Jul 23, 2023 at 3:18 PM nop head nop.head@gmail.com wrote:

I am not sure 3D fillets are any use in FDM printing because of the
layers. I only use 2D fillets to get rounded tool paths.

On Sun, 23 Jul 2023, 20:08 Adrian Mariano, avm4@cornell.edu wrote:

I've been working on BOSL2 for a while with Revar, and we have 60k lines
of OpenSCAD code.  Based on that experience, I think that the problem with
the OpenSCAD language is NOT fundamentally that it is functional.  The
benefit of python is NOT fundamentally that it is procedural.  There are
two basic problems with OpenSCAD for doing more complicated user space
processing.  One is the inability to gain access to geometry, so to do user
space design, everything from the ground up has to be done "outside" of the
OpenSCAD geometry engine.  The second problem is about efficiency.
OpenSCAD has no data structures.  Graphics algorithms assume access to
sophisticated and efficient data structures like a priority queue or a tree
or other kinds of things that are impossible to implement efficiently in
OpenSCAD.  So, yeah, you can implement the data structure, but instead of
being O(log N) or whatever it will be O(N^2).  So then trying to implement
that process that uses that data structure in user space becomes
intractable.  It's not clear to me that this limitation is fundamentally
about the language being functional.

Note that the filleting process displayed by Sanjeev is straight forward
to implement in principle.  You just find the intersection of two things
and put a fillet there.  Two complications arise for doing this in
userspace in OpenSCAD.  The first is representing the things, because
again, you can't use the geometry engine to do it.  Now maybe a solution to
that problem is coming?  The second complication is dealing with
self-intersections of the resulting polyhedron, because that's intractable
in OpenSCAD.  Really it seems like OpenSCAD should have a primitive that
accepts a series of profiles and links them together into a polyhedron,
even if it's self-intersecting.

Here's examples of doing the fillet problem entirely in OpenSCAD
userspace.  There are many examples at the link below.  I show a single one
in this message.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

[image: image.png]

On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Sure
I will try to explain the logic maybe in a day or two for the benefit
of all who maybe interested in geometry manipulations.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

The fact that prints always break along layer lines means adding a fillet that is made of layers hardly affects the strength in my opinion. On Sun, 23 Jul 2023, 20:24 Adrian Mariano, <avm4@cornell.edu> wrote: > Are you thinking that the layers break the propagation of stress through > the model, causing stress to concentrate at each layer, instead of > concentrating at a corner? Have you observed that models which fail by > layers shearing do so and random places in the model? > > > On Sun, Jul 23, 2023 at 3:18 PM nop head <nop.head@gmail.com> wrote: > >> I am not sure 3D fillets are any use in FDM printing because of the >> layers. I only use 2D fillets to get rounded tool paths. >> >> On Sun, 23 Jul 2023, 20:08 Adrian Mariano, <avm4@cornell.edu> wrote: >> >>> I've been working on BOSL2 for a while with Revar, and we have 60k lines >>> of OpenSCAD code. Based on that experience, I think that the problem with >>> the OpenSCAD language is NOT fundamentally that it is functional. The >>> benefit of python is NOT fundamentally that it is procedural. There are >>> two basic problems with OpenSCAD for doing more complicated user space >>> processing. One is the inability to gain access to geometry, so to do user >>> space design, everything from the ground up has to be done "outside" of the >>> OpenSCAD geometry engine. The second problem is about efficiency. >>> OpenSCAD has no data structures. Graphics algorithms assume access to >>> sophisticated and efficient data structures like a priority queue or a tree >>> or other kinds of things that are impossible to implement efficiently in >>> OpenSCAD. So, yeah, you can implement the data structure, but instead of >>> being O(log N) or whatever it will be O(N^2). So then trying to implement >>> that process that uses that data structure in user space becomes >>> intractable. It's not clear to me that this limitation is fundamentally >>> about the language being functional. >>> >>> Note that the filleting process displayed by Sanjeev is straight forward >>> to implement in principle. You just find the intersection of two things >>> and put a fillet there. Two complications arise for doing this in >>> userspace in OpenSCAD. The first is representing the things, because >>> again, you can't use the geometry engine to do it. Now maybe a solution to >>> that problem is coming? The second complication is dealing with >>> self-intersections of the resulting polyhedron, because that's intractable >>> in OpenSCAD. Really it seems like OpenSCAD should have a primitive that >>> accepts a series of profiles and links them together into a polyhedron, >>> even if it's self-intersecting. >>> >>> Here's examples of doing the fillet problem entirely in OpenSCAD >>> userspace. There are many examples at the link below. I show a single one >>> in this message. >>> >>> >>> https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism >>> >>> [image: image.png] >>> >>> >>> On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar < >>> sprabhakar2006@gmail.com> wrote: >>> >>>> Sure >>>> I will try to explain the logic maybe in a day or two for the benefit >>>> of all who maybe interested in geometry manipulations. >>>> >>>> >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GS
Guenther Sohler
Sun, Jul 23, 2023 8:07 PM

nop head, this might be true with  an original print.
But if you e.g. handle ABS with acetone this is no longer the case.
In that case objects with  fillets will break far less than an inbound
sharp corner

cylinder(d=20,h=2);
cylinder(d=5,h=20);

the "edge" between the cylinder might very easily break, but you improve
the strength dramatically when you add a fillet instead.

On Sun, Jul 23, 2023 at 10:00 PM nop head nop.head@gmail.com wrote:

The fact that prints always break along layer lines means adding a fillet
that is made of layers hardly affects the strength in my opinion.

On Sun, 23 Jul 2023, 20:24 Adrian Mariano, avm4@cornell.edu wrote:

Are you thinking that the layers break the propagation of stress through
the model, causing stress to concentrate at each layer, instead of
concentrating at a corner?  Have you observed that models which fail by
layers shearing do so and random places in the model?

On Sun, Jul 23, 2023 at 3:18 PM nop head nop.head@gmail.com wrote:

I am not sure 3D fillets are any use in FDM printing because of the
layers. I only use 2D fillets to get rounded tool paths.

On Sun, 23 Jul 2023, 20:08 Adrian Mariano, avm4@cornell.edu wrote:

I've been working on BOSL2 for a while with Revar, and we have 60k
lines of OpenSCAD code.  Based on that experience, I think that the problem
with the OpenSCAD language is NOT fundamentally that it is functional.  The
benefit of python is NOT fundamentally that it is procedural.  There are
two basic problems with OpenSCAD for doing more complicated user space
processing.  One is the inability to gain access to geometry, so to do user
space design, everything from the ground up has to be done "outside" of the
OpenSCAD geometry engine.  The second problem is about efficiency.
OpenSCAD has no data structures.  Graphics algorithms assume access to
sophisticated and efficient data structures like a priority queue or a tree
or other kinds of things that are impossible to implement efficiently in
OpenSCAD.  So, yeah, you can implement the data structure, but instead of
being O(log N) or whatever it will be O(N^2).  So then trying to implement
that process that uses that data structure in user space becomes
intractable.  It's not clear to me that this limitation is fundamentally
about the language being functional.

Note that the filleting process displayed by Sanjeev is straight
forward to implement in principle.  You just find the intersection of two
things and put a fillet there.  Two complications arise for doing this in
userspace in OpenSCAD.  The first is representing the things, because
again, you can't use the geometry engine to do it.  Now maybe a solution to
that problem is coming?  The second complication is dealing with
self-intersections of the resulting polyhedron, because that's intractable
in OpenSCAD.  Really it seems like OpenSCAD should have a primitive that
accepts a series of profiles and links them together into a polyhedron,
even if it's self-intersecting.

Here's examples of doing the fillet problem entirely in OpenSCAD
userspace.  There are many examples at the link below.  I show a single one
in this message.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

[image: image.png]

On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Sure
I will try to explain the logic maybe in a day or two for the benefit
of all who maybe interested in geometry manipulations.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

nop head, this might be true with an original print. But if you e.g. handle ABS with acetone this is no longer the case. In that case objects with fillets will break far less than an inbound sharp corner cylinder(d=20,h=2); cylinder(d=5,h=20); the "edge" between the cylinder might very easily break, but you improve the strength dramatically when you add a fillet instead. On Sun, Jul 23, 2023 at 10:00 PM nop head <nop.head@gmail.com> wrote: > The fact that prints always break along layer lines means adding a fillet > that is made of layers hardly affects the strength in my opinion. > > On Sun, 23 Jul 2023, 20:24 Adrian Mariano, <avm4@cornell.edu> wrote: > >> Are you thinking that the layers break the propagation of stress through >> the model, causing stress to concentrate at each layer, instead of >> concentrating at a corner? Have you observed that models which fail by >> layers shearing do so and random places in the model? >> >> >> On Sun, Jul 23, 2023 at 3:18 PM nop head <nop.head@gmail.com> wrote: >> >>> I am not sure 3D fillets are any use in FDM printing because of the >>> layers. I only use 2D fillets to get rounded tool paths. >>> >>> On Sun, 23 Jul 2023, 20:08 Adrian Mariano, <avm4@cornell.edu> wrote: >>> >>>> I've been working on BOSL2 for a while with Revar, and we have 60k >>>> lines of OpenSCAD code. Based on that experience, I think that the problem >>>> with the OpenSCAD language is NOT fundamentally that it is functional. The >>>> benefit of python is NOT fundamentally that it is procedural. There are >>>> two basic problems with OpenSCAD for doing more complicated user space >>>> processing. One is the inability to gain access to geometry, so to do user >>>> space design, everything from the ground up has to be done "outside" of the >>>> OpenSCAD geometry engine. The second problem is about efficiency. >>>> OpenSCAD has no data structures. Graphics algorithms assume access to >>>> sophisticated and efficient data structures like a priority queue or a tree >>>> or other kinds of things that are impossible to implement efficiently in >>>> OpenSCAD. So, yeah, you can implement the data structure, but instead of >>>> being O(log N) or whatever it will be O(N^2). So then trying to implement >>>> that process that uses that data structure in user space becomes >>>> intractable. It's not clear to me that this limitation is fundamentally >>>> about the language being functional. >>>> >>>> Note that the filleting process displayed by Sanjeev is straight >>>> forward to implement in principle. You just find the intersection of two >>>> things and put a fillet there. Two complications arise for doing this in >>>> userspace in OpenSCAD. The first is representing the things, because >>>> again, you can't use the geometry engine to do it. Now maybe a solution to >>>> that problem is coming? The second complication is dealing with >>>> self-intersections of the resulting polyhedron, because that's intractable >>>> in OpenSCAD. Really it seems like OpenSCAD should have a primitive that >>>> accepts a series of profiles and links them together into a polyhedron, >>>> even if it's self-intersecting. >>>> >>>> Here's examples of doing the fillet problem entirely in OpenSCAD >>>> userspace. There are many examples at the link below. I show a single one >>>> in this message. >>>> >>>> >>>> https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism >>>> >>>> [image: image.png] >>>> >>>> >>>> On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar < >>>> sprabhakar2006@gmail.com> wrote: >>>> >>>>> Sure >>>>> I will try to explain the logic maybe in a day or two for the benefit >>>>> of all who maybe interested in geometry manipulations. >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SL
Steve Lelievre
Sun, Jul 23, 2023 8:14 PM

I'm confused...

On 2023-07-23 12:45 p.m., Guenther Sohler wrote:

Polyhedra are composed of triangles which are stored as coordinates
only! It would be much better to compose triangles from
indices into a global vertex array. This is something I am right now
working on.

I must have misunderstood your statement as it seems to me to say that
you're working on something that OpenSCAD's polyhedron command already
does: it takes a single list of vertices and each face is defined by a
list of vertex indices.

Could you clarify for me, please.

Steve

I'm confused... On 2023-07-23 12:45 p.m., Guenther Sohler wrote: > Polyhedra are composed of triangles which are stored as coordinates > only! It would be much better to compose triangles from > indices into a global vertex array. This is something I am right now > working on. I must have misunderstood your statement as it seems to me to say that you're working on something that OpenSCAD's polyhedron command already does: it takes a single list of vertices and each face is defined by a list of vertex indices. Could you clarify for me, please. Steve
GS
Guenther Sohler
Sun, Jul 23, 2023 8:23 PM

Sorry Steve,

I actually did not express myself very well.

you you create  cube in openscad, its stored internal as
6 faces, each containing 4 vertices and each vertices contains 3 values
representing x/y/z

the internal representation of openscad is actually triangles containing
coordinates instead of indices.

if you use openscad  polyhedron command in openscad of course you specity a
point list and a faces list containing indices.
but its immediately translated to this stupid coordinate-only format.

it would be much better if openscad object would interally contain:

  • a list of vertices
  • a list of polygons whereas each polygon is just a list of indices.

This is what i am currently working on and Marius appears to appreciate it,
but he wants a "Polygon Builder" in addition.

On Sun, Jul 23, 2023 at 10:15 PM Steve Lelievre <
steve.lelievre.canada@gmail.com> wrote:

I'm confused...

On 2023-07-23 12:45 p.m., Guenther Sohler wrote:

Polyhedra are composed of triangles which are stored as coordinates
only! It would be much better to compose triangles from
indices into a global vertex array. This is something I am right now
working on.

I must have misunderstood your statement as it seems to me to say that
you're working on something that OpenSCAD's polyhedron command already
does: it takes a single list of vertices and each face is defined by a
list of vertex indices.

Could you clarify for me, please.

Steve


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Sorry Steve, I actually did not express myself very well. you you create cube in openscad, its stored internal as 6 faces, each containing 4 vertices and each vertices contains 3 values representing x/y/z the internal representation of openscad is actually triangles containing coordinates instead of indices. if you use openscad polyhedron command in openscad of course you specity a point list and a faces list containing indices. but its immediately translated to this stupid coordinate-only format. it would be much better if openscad object would interally contain: * a list of vertices * a list of polygons whereas each polygon is just a list of indices. This is what i am currently working on and Marius appears to appreciate it, but he wants a "Polygon Builder" in addition. On Sun, Jul 23, 2023 at 10:15 PM Steve Lelievre < steve.lelievre.canada@gmail.com> wrote: > I'm confused... > > On 2023-07-23 12:45 p.m., Guenther Sohler wrote: > > Polyhedra are composed of triangles which are stored as coordinates > > only! It would be much better to compose triangles from > > indices into a global vertex array. This is something I am right now > > working on. > > I must have misunderstood your statement as it seems to me to say that > you're working on something that OpenSCAD's polyhedron command already > does: it takes a single list of vertices and each face is defined by a > list of vertex indices. > > Could you clarify for me, please. > > Steve > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SL
Steve Lelievre
Sun, Jul 23, 2023 8:25 PM

Ah, now I understand.

Thanks

On Sun, Jul 23, 2023 at 13:23, Guenther Sohler guenther.sohler@gmail.com
wrote:

Sorry Steve,

I actually did not express myself very well.

you you create  cube in openscad, its stored internal as
6 faces, each containing 4 vertices and each vertices contains 3 values
representing x/y/z

the internal representation of openscad is actually triangles containing
coordinates instead of indices.

if you use openscad  polyhedron command in openscad of course you specity
a point list and a faces list containing indices.
but its immediately translated to this stupid coordinate-only format.

it would be much better if openscad object would interally contain:

  • a list of vertices
  • a list of polygons whereas each polygon is just a list of indices.

This is what i am currently working on and Marius appears to appreciate
it, but he wants a "Polygon Builder" in addition.

On Sun, Jul 23, 2023 at 10:15 PM Steve Lelievre <
steve.lelievre.canada@gmail.com> wrote:

I'm confused...

On 2023-07-23 12:45 p.m., Guenther Sohler wrote:

Polyhedra are composed of triangles which are stored as coordinates
only! It would be much better to compose triangles from
indices into a global vertex array. This is something I am right now
working on.

I must have misunderstood your statement as it seems to me to say that
you're working on something that OpenSCAD's polyhedron command already
does: it takes a single list of vertices and each face is defined by a
list of vertex indices.

Could you clarify for me, please.

Steve


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--
Cell +1 778 837 5771

Ah, now I understand. Thanks On Sun, Jul 23, 2023 at 13:23, Guenther Sohler <guenther.sohler@gmail.com> wrote: > Sorry Steve, > > I actually did not express myself very well. > > you you create cube in openscad, its stored internal as > 6 faces, each containing 4 vertices and each vertices contains 3 values > representing x/y/z > > the internal representation of openscad is actually triangles containing > coordinates instead of indices. > > if you use openscad polyhedron command in openscad of course you specity > a point list and a faces list containing indices. > but its immediately translated to this stupid coordinate-only format. > > it would be much better if openscad object would interally contain: > > * a list of vertices > * a list of polygons whereas each polygon is just a list of indices. > > This is what i am currently working on and Marius appears to appreciate > it, but he wants a "Polygon Builder" in addition. > > > > On Sun, Jul 23, 2023 at 10:15 PM Steve Lelievre < > steve.lelievre.canada@gmail.com> wrote: > >> I'm confused... >> >> On 2023-07-23 12:45 p.m., Guenther Sohler wrote: >> > Polyhedra are composed of triangles which are stored as coordinates >> > only! It would be much better to compose triangles from >> > indices into a global vertex array. This is something I am right now >> > working on. >> >> I must have misunderstood your statement as it seems to me to say that >> you're working on something that OpenSCAD's polyhedron command already >> does: it takes a single list of vertices and each face is defined by a >> list of vertex indices. >> >> Could you clarify for me, please. >> >> Steve >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > -- Cell +1 778 837 5771
RW
Rogier Wolff
Sun, Jul 23, 2023 8:34 PM

On Sun, Jul 23, 2023 at 09:00:06PM +0100, nop head wrote:

The fact that prints always break along layer lines means adding a fillet
that is made of layers hardly affects the strength in my opinion.

In some cases, you can print it so that the largest load ends up in
the X or Y direction and then a fillet perpendicular to that ends up
being printed in one layer in the XY plane. This can benefit from the
fillet from strength.

That said: I think also a fillet in the other direction will help with
strength. I have seen objects delaminate exactly in the stresspoint
where a fillet would have helped.

And even if it doesn't help, it looks nice and less "openscad-like".

Roger. 

On Sun, 23 Jul 2023, 20:24 Adrian Mariano, avm4@cornell.edu wrote:

Are you thinking that the layers break the propagation of stress through
the model, causing stress to concentrate at each layer, instead of
concentrating at a corner?  Have you observed that models which fail by
layers shearing do so and random places in the model?

On Sun, Jul 23, 2023 at 3:18 PM nop head nop.head@gmail.com wrote:

I am not sure 3D fillets are any use in FDM printing because of the
layers. I only use 2D fillets to get rounded tool paths.

On Sun, 23 Jul 2023, 20:08 Adrian Mariano, avm4@cornell.edu wrote:

I've been working on BOSL2 for a while with Revar, and we have 60k lines
of OpenSCAD code.  Based on that experience, I think that the problem with
the OpenSCAD language is NOT fundamentally that it is functional.  The
benefit of python is NOT fundamentally that it is procedural.  There are
two basic problems with OpenSCAD for doing more complicated user space
processing.  One is the inability to gain access to geometry, so to do user
space design, everything from the ground up has to be done "outside" of the
OpenSCAD geometry engine.  The second problem is about efficiency.
OpenSCAD has no data structures.  Graphics algorithms assume access to
sophisticated and efficient data structures like a priority queue or a tree
or other kinds of things that are impossible to implement efficiently in
OpenSCAD.  So, yeah, you can implement the data structure, but instead of
being O(log N) or whatever it will be O(N^2).  So then trying to implement
that process that uses that data structure in user space becomes
intractable.  It's not clear to me that this limitation is fundamentally
about the language being functional.

Note that the filleting process displayed by Sanjeev is straight forward
to implement in principle.  You just find the intersection of two things
and put a fillet there.  Two complications arise for doing this in
userspace in OpenSCAD.  The first is representing the things, because
again, you can't use the geometry engine to do it.  Now maybe a solution to
that problem is coming?  The second complication is dealing with
self-intersections of the resulting polyhedron, because that's intractable
in OpenSCAD.  Really it seems like OpenSCAD should have a primitive that
accepts a series of profiles and links them together into a polyhedron,
even if it's self-intersecting.

Here's examples of doing the fillet problem entirely in OpenSCAD
userspace.  There are many examples at the link below.  I show a single one
in this message.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

[image: image.png]

On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Sure
I will try to explain the logic maybe in a day or two for the benefit
of all who maybe interested in geometry manipulations.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sun, Jul 23, 2023 at 09:00:06PM +0100, nop head wrote: > The fact that prints always break along layer lines means adding a fillet > that is made of layers hardly affects the strength in my opinion. In some cases, you can print it so that the largest load ends up in the X or Y direction and then a fillet perpendicular to that ends up being printed in one layer in the XY plane. This can benefit from the fillet from strength. That said: I think also a fillet in the other direction will help with strength. I have seen objects delaminate exactly in the stresspoint where a fillet would have helped. And even if it doesn't help, it looks nice and less "openscad-like". Roger. > > On Sun, 23 Jul 2023, 20:24 Adrian Mariano, <avm4@cornell.edu> wrote: > > > Are you thinking that the layers break the propagation of stress through > > the model, causing stress to concentrate at each layer, instead of > > concentrating at a corner? Have you observed that models which fail by > > layers shearing do so and random places in the model? > > > > > > On Sun, Jul 23, 2023 at 3:18 PM nop head <nop.head@gmail.com> wrote: > > > >> I am not sure 3D fillets are any use in FDM printing because of the > >> layers. I only use 2D fillets to get rounded tool paths. > >> > >> On Sun, 23 Jul 2023, 20:08 Adrian Mariano, <avm4@cornell.edu> wrote: > >> > >>> I've been working on BOSL2 for a while with Revar, and we have 60k lines > >>> of OpenSCAD code. Based on that experience, I think that the problem with > >>> the OpenSCAD language is NOT fundamentally that it is functional. The > >>> benefit of python is NOT fundamentally that it is procedural. There are > >>> two basic problems with OpenSCAD for doing more complicated user space > >>> processing. One is the inability to gain access to geometry, so to do user > >>> space design, everything from the ground up has to be done "outside" of the > >>> OpenSCAD geometry engine. The second problem is about efficiency. > >>> OpenSCAD has no data structures. Graphics algorithms assume access to > >>> sophisticated and efficient data structures like a priority queue or a tree > >>> or other kinds of things that are impossible to implement efficiently in > >>> OpenSCAD. So, yeah, you can implement the data structure, but instead of > >>> being O(log N) or whatever it will be O(N^2). So then trying to implement > >>> that process that uses that data structure in user space becomes > >>> intractable. It's not clear to me that this limitation is fundamentally > >>> about the language being functional. > >>> > >>> Note that the filleting process displayed by Sanjeev is straight forward > >>> to implement in principle. You just find the intersection of two things > >>> and put a fillet there. Two complications arise for doing this in > >>> userspace in OpenSCAD. The first is representing the things, because > >>> again, you can't use the geometry engine to do it. Now maybe a solution to > >>> that problem is coming? The second complication is dealing with > >>> self-intersections of the resulting polyhedron, because that's intractable > >>> in OpenSCAD. Really it seems like OpenSCAD should have a primitive that > >>> accepts a series of profiles and links them together into a polyhedron, > >>> even if it's self-intersecting. > >>> > >>> Here's examples of doing the fillet problem entirely in OpenSCAD > >>> userspace. There are many examples at the link below. I show a single one > >>> in this message. > >>> > >>> > >>> https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism > >>> > >>> [image: image.png] > >>> > >>> > >>> On Sun, Jul 23, 2023 at 1:14 PM Sanjeev Prabhakar < > >>> sprabhakar2006@gmail.com> wrote: > >>> > >>>> Sure > >>>> I will try to explain the logic maybe in a day or two for the benefit > >>>> of all who maybe interested in geometry manipulations. > >>>> > >>>> > >>>> > >>>> _______________________________________________ > >>>> OpenSCAD mailing list > >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org > >>>> > >>> _______________________________________________ > >>> OpenSCAD mailing list > >>> To unsubscribe send an email to discuss-leave@lists.openscad.org > >>> > >> _______________________________________________ > >> OpenSCAD mailing list > >> To unsubscribe send an email to discuss-leave@lists.openscad.org > >> > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.