discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

avoiding assertion violation

DS
Dan Shriver
Wed, Jul 17, 2019 3:57 PM

Ok, I guess I made multiple errors.
For some reason I assumed that (if I input a curve or a line) I'd get the
whole volume from the y axis out to the points.
Obviously, what I actually get is just a shell of zero thickness for that
curve or line.

Is it better for me to get a full volume by adding one point to the polygon
[0.0001, 0] and then if I want a non-zero thickness shell doing subtract
with an offset of the solid.  Or is it better for me to make the polygon
with twice as many points (each point has a corresponding double that is
offset by the thickness)?  I ask because elsewhere it seemed like
difference() {} might be something one wants to avoid in OpenSCAD for
performance reasons.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Jul 17, 2019 at 11:19 AM Parkinbot rudolf@digitaldocument.de
wrote:

So your problem is clear. You try to rotate around a single vertex and get
a
singularity.

The following modification avoids this problem by introducing another point
on the y axis and creating an edge on the y axis.

function coshPolygon(multiplier, power, domain, flip, steps) =
let (flipValue = flip ? cosh( ( multiplier *(pow(domain,power))) ) : 0)
let (result = [for(i = [0.0001: (domain / steps) : domain]) [i,
flipValue - cosh(  ( multiplier *(pow(i,power)))  )] ])
concat(result, [[0, result[len(result)-1][1]]]);

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


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

Ok, I guess I made multiple errors. For some reason I assumed that (if I input a curve or a line) I'd get the whole volume from the y axis out to the points. Obviously, what I actually get is just a shell of zero thickness for that curve or line. Is it better for me to get a full volume by adding one point to the polygon [0.0001, 0] and then if I want a non-zero thickness shell doing subtract with an offset of the solid. Or is it better for me to make the polygon with twice as many points (each point has a corresponding double that is offset by the thickness)? I ask because elsewhere it seemed like difference() {} might be something one wants to avoid in OpenSCAD for performance reasons. <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, Jul 17, 2019 at 11:19 AM Parkinbot <rudolf@digitaldocument.de> wrote: > So your problem is clear. You try to rotate around a single vertex and get > a > singularity. > > The following modification avoids this problem by introducing another point > on the y axis and creating an edge on the y axis. > > function coshPolygon(multiplier, power, domain, flip, steps) = > let (flipValue = flip ? cosh( ( multiplier *(pow(domain,power))) ) : 0) > let (result = [for(i = [0.0001: (domain / steps) : domain]) [i, > flipValue - cosh( ( multiplier *(pow(i,power))) )] ]) > concat(result, [[0, result[len(result)-1][1]]]); > > > > > -- > 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
Wed, Jul 17, 2019 4:19 PM

You don't get a shell, you get a 3D solid who's cross section is the 2D
shape. The problem is if that 2D shape only touches the Y axis at a single
point then the 3D shape has a pinch point there where it has zero thickness
in the Z direction.

If you want to make a shell then the 2D shape should be the cross section
of a shell and yes that is faster made in 2D before the extrude than in 3D
with a differences after.

On Wed, 17 Jul 2019 at 16:58, Dan Shriver tabbydan@gmail.com wrote:

Ok, I guess I made multiple errors.
For some reason I assumed that (if I input a curve or a line) I'd get the
whole volume from the y axis out to the points.
Obviously, what I actually get is just a shell of zero thickness for that
curve or line.

Is it better for me to get a full volume by adding one point to the
polygon [0.0001, 0] and then if I want a non-zero thickness shell doing
subtract with an offset of the solid.  Or is it better for me to make the
polygon with twice as many points (each point has a corresponding double
that is offset by the thickness)?  I ask because elsewhere it seemed like
difference() {} might be something one wants to avoid in OpenSCAD for
performance reasons.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
<#m_2910737154312055855_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Jul 17, 2019 at 11:19 AM Parkinbot rudolf@digitaldocument.de
wrote:

So your problem is clear. You try to rotate around a single vertex and
get a
singularity.

The following modification avoids this problem by introducing another
point
on the y axis and creating an edge on the y axis.

function coshPolygon(multiplier, power, domain, flip, steps) =
let (flipValue = flip ? cosh( ( multiplier *(pow(domain,power))) ) :
0)
let (result = [for(i = [0.0001: (domain / steps) : domain]) [i,
flipValue - cosh(  ( multiplier *(pow(i,power)))  )] ])
concat(result, [[0, result[len(result)-1][1]]]);

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


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

You don't get a shell, you get a 3D solid who's cross section is the 2D shape. The problem is if that 2D shape only touches the Y axis at a single point then the 3D shape has a pinch point there where it has zero thickness in the Z direction. If you want to make a shell then the 2D shape should be the cross section of a shell and yes that is faster made in 2D before the extrude than in 3D with a differences after. On Wed, 17 Jul 2019 at 16:58, Dan Shriver <tabbydan@gmail.com> wrote: > Ok, I guess I made multiple errors. > For some reason I assumed that (if I input a curve or a line) I'd get the > whole volume from the y axis out to the points. > Obviously, what I actually get is just a shell of zero thickness for that > curve or line. > > Is it better for me to get a full volume by adding one point to the > polygon [0.0001, 0] and then if I want a non-zero thickness shell doing > subtract with an offset of the solid. Or is it better for me to make the > polygon with twice as many points (each point has a corresponding double > that is offset by the thickness)? I ask because elsewhere it seemed like > difference() {} might be something one wants to avoid in OpenSCAD for > performance reasons. > > > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon> Virus-free. > www.avast.com > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link> > <#m_2910737154312055855_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > On Wed, Jul 17, 2019 at 11:19 AM Parkinbot <rudolf@digitaldocument.de> > wrote: > >> So your problem is clear. You try to rotate around a single vertex and >> get a >> singularity. >> >> The following modification avoids this problem by introducing another >> point >> on the y axis and creating an edge on the y axis. >> >> function coshPolygon(multiplier, power, domain, flip, steps) = >> let (flipValue = flip ? cosh( ( multiplier *(pow(domain,power))) ) : >> 0) >> let (result = [for(i = [0.0001: (domain / steps) : domain]) [i, >> flipValue - cosh( ( multiplier *(pow(i,power))) )] ]) >> concat(result, [[0, result[len(result)-1][1]]]); >> >> >> >> >> -- >> Sent from: http://forum.openscad.org/ >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
A
arnholm@arnholm.org
Wed, Jul 17, 2019 4:30 PM

On 2019-07-17 17:32, Bruno Boettcher wrote:

heh happily swimming in my ignorance and incompetence......
still..... you mention a tool polyfix that repairs the stl??
some pointer please?
thanks!
Bruno

It is bundled with AngelCAD, to get a binary use the downloads link at
https://arnholm.github.io/angelcad-docs/

Regards
Carsten Arnholm

On 2019-07-17 17:32, Bruno Boettcher wrote: > heh happily swimming in my ignorance and incompetence...... > still..... you mention a tool polyfix that repairs the stl?? > some pointer please? > thanks! > Bruno It is bundled with AngelCAD, to get a binary use the downloads link at https://arnholm.github.io/angelcad-docs/ Regards Carsten Arnholm
DS
Dan Shriver
Wed, Jul 17, 2019 9:22 PM

Nop_head: when I did my original hypDome() {code given earlier in the
thread} it looked hollow but that could be some weird artifact.  I am using
the 2018 release of OpenSCAD (not the latest one) and I see this:

[image: image.png]

For a shell with thickness I simply make a new function that assigns
coshPolygon() to a vector, then I make a second vector taking the elements
of the first vector (in reverse order) and subtracting the "thickness" from
the y value (which isn't exactly correct as it should be on an angle with
both x & y values altered).

On Wed, Jul 17, 2019 at 12:20 PM nop head nop.head@gmail.com wrote:

You don't get a shell, you get a 3D solid who's cross section is the 2D
shape. The problem is if that 2D shape only touches the Y axis at a single
point then the 3D shape has a pinch point there where it has zero thickness
in the Z direction.

If you want to make a shell then the 2D shape should be the cross section
of a shell and yes that is faster made in 2D before the extrude than in 3D
with a differences after.

On Wed, 17 Jul 2019 at 16:58, Dan Shriver tabbydan@gmail.com wrote:

Ok, I guess I made multiple errors.
For some reason I assumed that (if I input a curve or a line) I'd get the
whole volume from the y axis out to the points.
Obviously, what I actually get is just a shell of zero thickness for that
curve or line.

Is it better for me to get a full volume by adding one point to the
polygon [0.0001, 0] and then if I want a non-zero thickness shell doing
subtract with an offset of the solid.  Or is it better for me to make the
polygon with twice as many points (each point has a corresponding double
that is offset by the thickness)?  I ask because elsewhere it seemed like
difference() {} might be something one wants to avoid in OpenSCAD for
performance reasons.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
<#m_8551169469257401297_m_2910737154312055855_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Jul 17, 2019 at 11:19 AM Parkinbot rudolf@digitaldocument.de
wrote:

So your problem is clear. You try to rotate around a single vertex and
get a
singularity.

The following modification avoids this problem by introducing another
point
on the y axis and creating an edge on the y axis.

function coshPolygon(multiplier, power, domain, flip, steps) =
let (flipValue = flip ? cosh( ( multiplier *(pow(domain,power))) ) :
0)
let (result = [for(i = [0.0001: (domain / steps) : domain]) [i,
flipValue - cosh(  ( multiplier *(pow(i,power)))  )] ])
concat(result, [[0, result[len(result)-1][1]]]);

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


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

Nop_head: when I did my original hypDome() {code given earlier in the thread} it looked hollow but that could be some weird artifact. I am using the 2018 release of OpenSCAD (not the latest one) and I see this: [image: image.png] For a shell with thickness I simply make a new function that assigns coshPolygon() to a vector, then I make a second vector taking the elements of the first vector (in reverse order) and subtracting the "thickness" from the y value (which isn't exactly correct as it should be on an angle with both x & y values altered). On Wed, Jul 17, 2019 at 12:20 PM nop head <nop.head@gmail.com> wrote: > You don't get a shell, you get a 3D solid who's cross section is the 2D > shape. The problem is if that 2D shape only touches the Y axis at a single > point then the 3D shape has a pinch point there where it has zero thickness > in the Z direction. > > If you want to make a shell then the 2D shape should be the cross section > of a shell and yes that is faster made in 2D before the extrude than in 3D > with a differences after. > > On Wed, 17 Jul 2019 at 16:58, Dan Shriver <tabbydan@gmail.com> wrote: > >> Ok, I guess I made multiple errors. >> For some reason I assumed that (if I input a curve or a line) I'd get the >> whole volume from the y axis out to the points. >> Obviously, what I actually get is just a shell of zero thickness for that >> curve or line. >> >> Is it better for me to get a full volume by adding one point to the >> polygon [0.0001, 0] and then if I want a non-zero thickness shell doing >> subtract with an offset of the solid. Or is it better for me to make the >> polygon with twice as many points (each point has a corresponding double >> that is offset by the thickness)? I ask because elsewhere it seemed like >> difference() {} might be something one wants to avoid in OpenSCAD for >> performance reasons. >> >> >> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon> Virus-free. >> www.avast.com >> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link> >> <#m_8551169469257401297_m_2910737154312055855_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> >> On Wed, Jul 17, 2019 at 11:19 AM Parkinbot <rudolf@digitaldocument.de> >> wrote: >> >>> So your problem is clear. You try to rotate around a single vertex and >>> get a >>> singularity. >>> >>> The following modification avoids this problem by introducing another >>> point >>> on the y axis and creating an edge on the y axis. >>> >>> function coshPolygon(multiplier, power, domain, flip, steps) = >>> let (flipValue = flip ? cosh( ( multiplier *(pow(domain,power))) ) : >>> 0) >>> let (result = [for(i = [0.0001: (domain / steps) : domain]) [i, >>> flipValue - cosh( ( multiplier *(pow(i,power))) )] ]) >>> concat(result, [[0, result[len(result)-1][1]]]); >>> >>> >>> >>> >>> -- >>> Sent from: http://forum.openscad.org/ >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> Discuss@lists.openscad.org >>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
RP
Ronaldo Persiano
Wed, Jul 17, 2019 9:44 PM

Em qua, 17 de jul de 2019 às 15:00, Carsten Arnholm arnholm@arnholm.org
escreveu:

Therefore, the problem seen in OpenSCAD is not really in rotate_extrude,
but how the model is interpreted when subject to union using CGAL. The
same union using Carve works fine as should be expected.

CGAL seems to be very strict: it doesn't do boolean operations with a
non-manifold. Considering your experiment, I am led to believe that Carve
is complacent with some non-manifoldness when doing boolean operations.

To confirm it, I have examined the OFF file exported by OpenSCAD for your
rotate_extrude() example (without the cube(), of course). The topological
information in the OFF file indicates that there are 12 faces incident to
vertex index 0. Those faces are the triangles pointing to [0,0,0] from the
top (6) and from the bottom (6). So no neighborhood of the vertex 0 is
homeomorphic to a disc in the plane. So, the topology represented in the
OFF file generated by OpenSCAD is not of a manifold.

Summarizing, OpenSCAD may generate and export non-manifold objects. CGAL
doesn't accept to do boolean operations involving non-manifold. Carve seems
to be complacent with some non-manifoldness even in boolean operations. It
is worth to observe that the union of the cube to the rotate_extrude is
still a non-manifold object.

Em qua, 17 de jul de 2019 às 15:00, Carsten Arnholm <arnholm@arnholm.org> escreveu: > Therefore, the problem seen in OpenSCAD is not really in rotate_extrude, > but how the model is interpreted when subject to union using CGAL. The > same union using Carve works fine as should be expected. > CGAL seems to be very strict: it doesn't do boolean operations with a non-manifold. Considering your experiment, I am led to believe that Carve is complacent with some non-manifoldness when doing boolean operations. To confirm it, I have examined the OFF file exported by OpenSCAD for your rotate_extrude() example (without the cube(), of course). The topological information in the OFF file indicates that there are 12 faces incident to vertex index 0. Those faces are the triangles pointing to [0,0,0] from the top (6) and from the bottom (6). So no neighborhood of the vertex 0 is homeomorphic to a disc in the plane. So, the topology represented in the OFF file generated by OpenSCAD is not of a manifold. Summarizing, OpenSCAD may generate and export non-manifold objects. CGAL doesn't accept to do boolean operations involving non-manifold. Carve seems to be complacent with some non-manifoldness even in boolean operations. It is worth to observe that the union of the cube to the rotate_extrude is still a non-manifold object.