Convexity

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

Convexity

nophead
What is the correct convexity for a simple tube?

I ask because I used three and it works on two of my PC but on an old laptop with Intel graphics it needs to be four.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

RevarBat
A line could possibly pass through a maximum of four walls of a tube, so convexity should be 4.

- Revar


> On Jun 13, 2019, at 8:51 AM, nop head <[hidden email]> wrote:
>
> What is the correct convexity for a simple tube?
>
> I ask because I used three and it works on two of my PC but on an old laptop with Intel graphics it needs to be four.
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

nophead
Not sure because convexity defaults to 1 and that is sufficient for a cylinder.

On Thu, 13 Jun 2019, 21:44 Revar Desmera, <[hidden email]> wrote:
A line could possibly pass through a maximum of four walls of a tube, so convexity should be 4.

- Revar


> On Jun 13, 2019, at 8:51 AM, nop head <[hidden email]> wrote:
>
> What is the correct convexity for a simple tube?
>
> I ask because I used three and it works on two of my PC but on an old laptop with Intel graphics it needs to be four.
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

JordanBrown
Is there a significant penalty to setting it to a large number, like 10?  That's what I usually do when I notice a rendering problem, and I haven't noticed any performance problems, but maybe I've been working with simple cases.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

nophead
I don't know. I will do some experiments tomorrow. Odd it needs to be one more on Intel graphics.

On Thu, 13 Jun 2019, 21:58 Jordan Brown, <[hidden email]> wrote:
Is there a significant penalty to setting it to a large number, like 10?  That's what I usually do when I notice a rendering problem, and I haven't noticed any performance problems, but maybe I've been working with simple cases.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

adrianv
In reply to this post by JordanBrown
I hadn't really paid attention to convexity and hadn't realized that there
was a solution to my models having sections that disappear as I rotate them
in preview.  I did a test run and found that setting convexity to 10 had no
effect on my run time and it increased the geometry cache by about 10%.
Basically, no obvious penalty.  




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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

Troberg
In reply to this post by RevarBat
RevarBat wrote
> A line could possibly pass through a maximum of four walls of a tube, so
> convexity should be 4.

I can't see how a straight line could pass through more than two walls. How
would it pass through four???



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

lar3ry
In reply to this post by adrianv
Incredible. I was sort of accepting the idea that previewing objects with parts cut out of them  
was going to just give me a mess because that's the way Preview is. Thank You! Now I can
do this sort of thing a WHOLE lot easier.

On 13 Jun 2019 at 14:55, adrianv wrote:

> I hadn't really paid attention to convexity and hadn't realized that there
> was a solution to my models having sections that disappear as I rotate them
> in preview.  I did a test run and found that setting convexity to 10 had no
> effect on my run time and it increased the geometry cache by about 10%.
> Basically, no obvious penalty.  
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>


--
Magic trumps science for most people,
and wishful thinking drives a lot of decision-making.
    - Joe Haldeman


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

nophead
In reply to this post by adrianv
This is a distilled version of the code I was having a problem with:

for(c = [1:4])
    translate([c * 40, 0])
        difference () {
            linear_extrude(height = 50, center = true, convexity = c)
                difference() {
                   circle(5);
                   circle(4);
                }
               
            translate([0, 0, 20])
                cube(20, center = true);
           
        }

This is how it looks on my old laptop:

 
image.png

And this is how it looks on my normal desktop machine, which also has Intel graphics but it never gives me problems. Goldfeather makes no difference.

image.png

It seems 2 is sufficient on this machine but the old machine needs 4.

The manual says "Integer number of "inward" curves, ie. expected path crossings of an arbitrary line through the polygon." in one place and "The convexity parameter specifies the maximum number of front sides (back sides) a ray intersecting the object might penetrate" in another.

Neither statement is clear to me. What does " front sides (back sides)" mean?

If it is simply the maximum number of edges a line can pass through then I agree it should be 4 for a tube.

On Thu, 13 Jun 2019 at 22:56, adrianv <[hidden email]> wrote:
I hadn't really paid attention to convexity and hadn't realized that there
was a solution to my models having sections that disappear as I rotate them
in preview.  I did a test run and found that setting convexity to 10 had no
effect on my run time and it increased the geometry cache by about 10%.
Basically, no obvious penalty. 




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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

nophead
However if that was the case why doesn't it default to 2, because for a convex shape 2 in the minimum. And why isn't it called concavity as it is concave shapes that go wrong?

On Fri, 14 Jun 2019 at 08:00, nop head <[hidden email]> wrote:
This is a distilled version of the code I was having a problem with:

for(c = [1:4])
    translate([c * 40, 0])
        difference () {
            linear_extrude(height = 50, center = true, convexity = c)
                difference() {
                   circle(5);
                   circle(4);
                }
               
            translate([0, 0, 20])
                cube(20, center = true);
           
        }

This is how it looks on my old laptop:

 
image.png

And this is how it looks on my normal desktop machine, which also has Intel graphics but it never gives me problems. Goldfeather makes no difference.

image.png

It seems 2 is sufficient on this machine but the old machine needs 4.

The manual says "Integer number of "inward" curves, ie. expected path crossings of an arbitrary line through the polygon." in one place and "The convexity parameter specifies the maximum number of front sides (back sides) a ray intersecting the object might penetrate" in another.

Neither statement is clear to me. What does " front sides (back sides)" mean?

If it is simply the maximum number of edges a line can pass through then I agree it should be 4 for a tube.

On Thu, 13 Jun 2019 at 22:56, adrianv <[hidden email]> wrote:
I hadn't really paid attention to convexity and hadn't realized that there
was a solution to my models having sections that disappear as I rotate them
in preview.  I did a test run and found that setting convexity to 10 had no
effect on my run time and it increased the geometry cache by about 10%.
Basically, no obvious penalty. 




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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

RevarBat
In reply to this post by Troberg
Two outer walls, plus two inner walls for the tube.


- Revar



On Jun 13, 2019, at 11:41 PM, Troberg <[hidden email]> wrote:

RevarBat wrote
A line could possibly pass through a maximum of four walls of a tube, so
convexity should be 4.

I can't see how a straight line could pass through more than two walls. How
would it pass through four???



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

nophead
In reply to this post by nophead
This is what OpenCSG says: 

"The convexity of a primitive is the maximum number of front (or back) faces of the primitive at a single position. For example, the convexity of a sphere is one and the convexity of a torus is two. "

So it it seems 2 is the correct value for a tube and the OpenSCAD manual is misleading.

On Fri, 14 Jun 2019 at 08:04, nop head <[hidden email]> wrote:
However if that was the case why doesn't it default to 2, because for a convex shape 2 in the minimum. And why isn't it called concavity as it is concave shapes that go wrong?

On Fri, 14 Jun 2019 at 08:00, nop head <[hidden email]> wrote:
This is a distilled version of the code I was having a problem with:

for(c = [1:4])
    translate([c * 40, 0])
        difference () {
            linear_extrude(height = 50, center = true, convexity = c)
                difference() {
                   circle(5);
                   circle(4);
                }
               
            translate([0, 0, 20])
                cube(20, center = true);
           
        }

This is how it looks on my old laptop:

 
image.png

And this is how it looks on my normal desktop machine, which also has Intel graphics but it never gives me problems. Goldfeather makes no difference.

image.png

It seems 2 is sufficient on this machine but the old machine needs 4.

The manual says "Integer number of "inward" curves, ie. expected path crossings of an arbitrary line through the polygon." in one place and "The convexity parameter specifies the maximum number of front sides (back sides) a ray intersecting the object might penetrate" in another.

Neither statement is clear to me. What does " front sides (back sides)" mean?

If it is simply the maximum number of edges a line can pass through then I agree it should be 4 for a tube.

On Thu, 13 Jun 2019 at 22:56, adrianv <[hidden email]> wrote:
I hadn't really paid attention to convexity and hadn't realized that there
was a solution to my models having sections that disappear as I rotate them
in preview.  I did a test run and found that setting convexity to 10 had no
effect on my run time and it increased the geometry cache by about 10%.
Basically, no obvious penalty. 




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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Convexity

nophead
I found on my dodgy machine having convexity higher goes wrong again.

Here is it swept from 1 to 10
image.png

4, 5, 8 and 9 work.

The actual tube is correct for 2 onward, as it should be, but the back faces of the subtrahend get displayed for some values of convexity. That never happens on my good machine.

On Fri, 14 Jun 2019 at 08:08, nop head <[hidden email]> wrote:
This is what OpenCSG says: 

"The convexity of a primitive is the maximum number of front (or back) faces of the primitive at a single position. For example, the convexity of a sphere is one and the convexity of a torus is two. "

So it it seems 2 is the correct value for a tube and the OpenSCAD manual is misleading.

On Fri, 14 Jun 2019 at 08:04, nop head <[hidden email]> wrote:
However if that was the case why doesn't it default to 2, because for a convex shape 2 in the minimum. And why isn't it called concavity as it is concave shapes that go wrong?

On Fri, 14 Jun 2019 at 08:00, nop head <[hidden email]> wrote:
This is a distilled version of the code I was having a problem with:

for(c = [1:4])
    translate([c * 40, 0])
        difference () {
            linear_extrude(height = 50, center = true, convexity = c)
                difference() {
                   circle(5);
                   circle(4);
                }
               
            translate([0, 0, 20])
                cube(20, center = true);
           
        }

This is how it looks on my old laptop:

 
image.png

And this is how it looks on my normal desktop machine, which also has Intel graphics but it never gives me problems. Goldfeather makes no difference.

image.png

It seems 2 is sufficient on this machine but the old machine needs 4.

The manual says "Integer number of "inward" curves, ie. expected path crossings of an arbitrary line through the polygon." in one place and "The convexity parameter specifies the maximum number of front sides (back sides) a ray intersecting the object might penetrate" in another.

Neither statement is clear to me. What does " front sides (back sides)" mean?

If it is simply the maximum number of edges a line can pass through then I agree it should be 4 for a tube.

On Thu, 13 Jun 2019 at 22:56, adrianv <[hidden email]> wrote:
I hadn't really paid attention to convexity and hadn't realized that there
was a solution to my models having sections that disappear as I rotate them
in preview.  I did a test run and found that setting convexity to 10 had no
effect on my run time and it increased the geometry cache by about 10%.
Basically, no obvious penalty. 




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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org