discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Convexity

RD
Revar Desmera
Fri, Jun 14, 2019 7:06 AM

Two outer walls, plus two inner walls for the tube.

  • Revar

On Jun 13, 2019, at 11:41 PM, Troberg troberg.anders@gmail.com 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Two outer walls, plus two inner walls for the tube. - Revar > On Jun 13, 2019, at 11:41 PM, Troberg <troberg.anders@gmail.com> 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
NH
nop head
Fri, Jun 14, 2019 7:08 AM

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 nop.head@gmail.com 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 nop.head@gmail.com 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: 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: 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 avm4@cornell.edu 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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 <nop.head@gmail.com> 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 <nop.head@gmail.com> 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: 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: 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 <avm4@cornell.edu> 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 >>> Discuss@lists.openscad.org >>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >>> >>
NH
nop head
Fri, Jun 14, 2019 7:41 AM

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

Here is it swept from 1 to 10
[image: 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 nop.head@gmail.com 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 nop.head@gmail.com 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 nop.head@gmail.com 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: 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: 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 avm4@cornell.edu 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I found on my dodgy machine having convexity higher goes wrong again. Here is it swept from 1 to 10 [image: 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 <nop.head@gmail.com> 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 <nop.head@gmail.com> 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 <nop.head@gmail.com> 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: 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: 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 <avm4@cornell.edu> 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 >>>> Discuss@lists.openscad.org >>>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >>>> >>>