AC
A. Craig West
Thu, Apr 18, 2019 1:05 PM
My new solution for this is:
function is_undef(o) =
undef == o;
function is_string(o) =
o == undef || len(o) == undef ?
false
:
len(str(o, o)) == len(o) * 2;
function is_list(o) =
o == undef || is_string(o) ?
false
:
len(o) != undef;
function is_bool(o) =
(o == undef || is_string(o)) ?
false
:
str(o) == "true" || str(o) == "false";
function is_num(o) =
(o == undef || is_string(o) || is_list(o) || is_bool(o)) ?
false
:
true;
I then have to comment out that part of the code if I am using a
recent version, or leave it uncommented in version 2015.
On Thu, Apr 18, 2019 at 3:38 AM Parkinbot rudolf@digitaldocument.de wrote:
My new solution for this is:
function is_undef(o) =
undef == o;
function is_string(o) =
o == undef || len(o) == undef ?
false
:
len(str(o, o)) == len(o) * 2;
function is_list(o) =
o == undef || is_string(o) ?
false
:
len(o) != undef;
function is_bool(o) =
(o == undef || is_string(o)) ?
false
:
str(o) == "true" || str(o) == "false";
function is_num(o) =
(o == undef || is_string(o) || is_list(o) || is_bool(o)) ?
false
:
true;
I then have to comment out that part of the code if I am using a
recent version, or leave it uncommented in version 2015.
On Thu, Apr 18, 2019 at 3:38 AM Parkinbot <rudolf@digitaldocument.de> wrote:
>
> Since is_list() is not available in older OpenSCAD versions I ve changed my
> codebase to use
>
> mylist = 1;
> mylist = [1];
> echo(mylist[0] != undef);
>
> This expression works down to 2015.
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
AC
A. Craig West
Thu, Apr 18, 2019 1:22 PM
I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
I have screenshots showing the two objects I am trying to union, with
a gap of a full millimetre (or unit point, I suppose) between them.
There is no way that this is not a bug in how the cgal code is
working. At this point I have no way to workaround the issue, other
than moving the entire design into userspace, which seems somewhat
ridiculous.
I am also curious why rendered polyhedrons display differently in the
console output. Objects created normally display:
Top level object is a 3D object:
Simple: yes
Vertices: 286
Halfedges: 858
Edges: 429
Halffacets: 290
Facets: 145
Volumes: 2
while polyhedrons display:
Top level object is a 3D object:
Facets: 12
Never mind, That was the solution to my problem. I am sure I remember
the documentation for polyhedron saying that faces should be clockwise
when viewed from the inside outwards, but that certainly isn't what it
says now. I am going to reverse my faces, and that should fix
everything....
On Wed, Apr 17, 2019 at 7:19 AM A. Craig West acraigwest@gmail.com wrote:
Oddly enough, even if the two shapes have no overlap at all, by even a
significant margin, I can't get them to render properly. I have tried
with a large visible gap between the two parts, and it still discard
the polyhedron, which is definitely valid.
On Wed, Apr 17, 2019 at 4:44 AM nop head nop.head@gmail.com wrote:
2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
On Wed, 17 Apr 2019, 02:24 A. Craig West, acraigwest@gmail.com wrote:
Due to issues I have had with CGAL generated shapes forming
non-manifold STL files, making them difficult to import into other
tools, I have been focusing on doing as much of my design as possible
in userspace, generating 3D polyhedrons. This has been a lot of work
due to limited support in the codebase, particularly as I am limited
to running in the 2015 version. It would definitely be nice to have
some 3d union, difference, and intersection functions for polyhedrons,
but up until now I have been making do.
I am having a couple of problems with this approach. One of these is
that the internal code-base does not always seem to be able to handle
userspace polygons properly. For example, I have a complex shape which
is totally manifold, forms a single object, and renders perfectly, if
I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
properly mirrored, but if I display both the original shape and the
mirrored one, the show properly in the preview but either go
non-manifold or vanish entirely when rendered.
I also have issues when trying to union my shape with other shapes, it
always works fine in preview, but when I render, it may work, or it
may give an assertion failure and leave my shape out of the final
rendering. Actually, in the example I am including a screenshot of,
there was no error or warning at all when it rendered, it just removed
my shape...
Does anybody have any suggestions on what I can do to work around
this? There are shapes that would be REALLY annoying for my to do in
userspace, but if I can't find a workaround or solution for this, I am
going to have to do so...
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
I have screenshots showing the two objects I am trying to union, with
a gap of a full millimetre (or unit point, I suppose) between them.
There is no way that this is not a bug in how the cgal code is
working. At this point I have no way to workaround the issue, other
than moving the entire design into userspace, which seems somewhat
ridiculous.
I am also curious why rendered polyhedrons display differently in the
console output. Objects created normally display:
Top level object is a 3D object:
Simple: yes
Vertices: 286
Halfedges: 858
Edges: 429
Halffacets: 290
Facets: 145
Volumes: 2
while polyhedrons display:
Top level object is a 3D object:
Facets: 12
Never mind, That was the solution to my problem. I am sure I remember
the documentation for polyhedron saying that faces should be clockwise
when viewed from the inside outwards, but that certainly isn't what it
says now. I am going to reverse my faces, and that should fix
everything....
On Wed, Apr 17, 2019 at 7:19 AM A. Craig West <acraigwest@gmail.com> wrote:
>
> Oddly enough, even if the two shapes have no overlap at all, by even a
> significant margin, I can't get them to render properly. I have tried
> with a large visible gap between the two parts, and it still discard
> the polyhedron, which is definitely valid.
>
> On Wed, Apr 17, 2019 at 4:44 AM nop head <nop.head@gmail.com> wrote:
> >
> > 2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
> >
> > Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
> >
> > When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
> >
> > On Wed, 17 Apr 2019, 02:24 A. Craig West, <acraigwest@gmail.com> wrote:
> >>
> >> Due to issues I have had with CGAL generated shapes forming
> >> non-manifold STL files, making them difficult to import into other
> >> tools, I have been focusing on doing as much of my design as possible
> >> in userspace, generating 3D polyhedrons. This has been a lot of work
> >> due to limited support in the codebase, particularly as I am limited
> >> to running in the 2015 version. It would definitely be nice to have
> >> some 3d union, difference, and intersection functions for polyhedrons,
> >> but up until now I have been making do.
> >> I am having a couple of problems with this approach. One of these is
> >> that the internal code-base does not always seem to be able to handle
> >> userspace polygons properly. For example, I have a complex shape which
> >> is totally manifold, forms a single object, and renders perfectly, if
> >> I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
> >> properly mirrored, but if I display both the original shape and the
> >> mirrored one, the show properly in the preview but either go
> >> non-manifold or vanish entirely when rendered.
> >> I also have issues when trying to union my shape with other shapes, it
> >> always works fine in preview, but when I render, it may work, or it
> >> may give an assertion failure and leave my shape out of the final
> >> rendering. Actually, in the example I am including a screenshot of,
> >> there was no error or warning at all when it rendered, it just removed
> >> my shape...
> >> Does anybody have any suggestions on what I can do to work around
> >> this? There are shapes that would be REALLY annoying for my to do in
> >> userspace, but if I can't find a workaround or solution for this, I am
> >> going to have to do so...
> >> _______________________________________________
> >> 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
NH
nop head
Thu, Apr 18, 2019 7:27 PM
If you don't get the Simple, Vertices, etc it means CGAL isn't involved at
all. So yes it will display invalid polyhedra. If CGAL is used it will
always complain and make the object disappear if there is anything wrong
with it. But you only get the error message once and then the empty result
is cached.
On Thu, 18 Apr 2019 at 14:23, A. Craig West acraigwest@gmail.com wrote:
I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
I have screenshots showing the two objects I am trying to union, with
a gap of a full millimetre (or unit point, I suppose) between them.
There is no way that this is not a bug in how the cgal code is
working. At this point I have no way to workaround the issue, other
than moving the entire design into userspace, which seems somewhat
ridiculous.
I am also curious why rendered polyhedrons display differently in the
console output. Objects created normally display:
Top level object is a 3D object:
Simple: yes
Vertices: 286
Halfedges: 858
Edges: 429
Halffacets: 290
Facets: 145
Volumes: 2
while polyhedrons display:
Top level object is a 3D object:
Facets: 12
Never mind, That was the solution to my problem. I am sure I remember
the documentation for polyhedron saying that faces should be clockwise
when viewed from the inside outwards, but that certainly isn't what it
says now. I am going to reverse my faces, and that should fix
everything....
On Wed, Apr 17, 2019 at 7:19 AM A. Craig West acraigwest@gmail.com
wrote:
Oddly enough, even if the two shapes have no overlap at all, by even a
significant margin, I can't get them to render properly. I have tried
with a large visible gap between the two parts, and it still discard
the polyhedron, which is definitely valid.
On Wed, Apr 17, 2019 at 4:44 AM nop head nop.head@gmail.com wrote:
2015 is so long ago l don't remember what issues it had. In general
though the way to avoid this type of issue is to make sure vertices are
either exactly numerically the same, or different by a significant margin.
Close vertices get merged and that breaks topology.
Another tip is to clear the cache before F6. Preview can cache
When objects disappear without an error it is usually because the
error was generated earlier and an empty mesh was cached.
Due to issues I have had with CGAL generated shapes forming
non-manifold STL files, making them difficult to import into other
tools, I have been focusing on doing as much of my design as possible
in userspace, generating 3D polyhedrons. This has been a lot of work
due to limited support in the codebase, particularly as I am limited
to running in the 2015 version. It would definitely be nice to have
some 3d union, difference, and intersection functions for polyhedrons,
but up until now I have been making do.
I am having a couple of problems with this approach. One of these is
that the internal code-base does not always seem to be able to handle
userspace polygons properly. For example, I have a complex shape which
is totally manifold, forms a single object, and renders perfectly, if
I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
properly mirrored, but if I display both the original shape and the
mirrored one, the show properly in the preview but either go
non-manifold or vanish entirely when rendered.
I also have issues when trying to union my shape with other shapes, it
always works fine in preview, but when I render, it may work, or it
may give an assertion failure and leave my shape out of the final
rendering. Actually, in the example I am including a screenshot of,
there was no error or warning at all when it rendered, it just removed
my shape...
Does anybody have any suggestions on what I can do to work around
this? There are shapes that would be REALLY annoying for my to do in
userspace, but if I can't find a workaround or solution for this, I am
going to have to do so...
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
If you don't get the Simple, Vertices, etc it means CGAL isn't involved at
all. So yes it will display invalid polyhedra. If CGAL is used it will
always complain and make the object disappear if there is anything wrong
with it. But you only get the error message once and then the empty result
is cached.
On Thu, 18 Apr 2019 at 14:23, A. Craig West <acraigwest@gmail.com> wrote:
> I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
>
> I have screenshots showing the two objects I am trying to union, with
> a gap of a full millimetre (or unit point, I suppose) between them.
> There is no way that this is not a bug in how the cgal code is
> working. At this point I have no way to workaround the issue, other
> than moving the entire design into userspace, which seems somewhat
> ridiculous.
> I am also curious why rendered polyhedrons display differently in the
> console output. Objects created normally display:
> Top level object is a 3D object:
> Simple: yes
> Vertices: 286
> Halfedges: 858
> Edges: 429
> Halffacets: 290
> Facets: 145
> Volumes: 2
>
> while polyhedrons display:
> Top level object is a 3D object:
> Facets: 12
>
> Never mind, That was the solution to my problem. I am sure I remember
> the documentation for polyhedron saying that faces should be clockwise
> when viewed from the inside outwards, but that certainly isn't what it
> says now. I am going to reverse my faces, and that should fix
> everything....
>
> On Wed, Apr 17, 2019 at 7:19 AM A. Craig West <acraigwest@gmail.com>
> wrote:
> >
> > Oddly enough, even if the two shapes have no overlap at all, by even a
> > significant margin, I can't get them to render properly. I have tried
> > with a large visible gap between the two parts, and it still discard
> > the polyhedron, which is definitely valid.
> >
> > On Wed, Apr 17, 2019 at 4:44 AM nop head <nop.head@gmail.com> wrote:
> > >
> > > 2015 is so long ago l don't remember what issues it had. In general
> though the way to avoid this type of issue is to make sure vertices are
> either exactly numerically the same, or different by a significant margin.
> Close vertices get merged and that breaks topology.
> > >
> > > Another tip is to clear the cache before F6. Preview can cache
> corrupted meshes.
> > >
> > > When objects disappear without an error it is usually because the
> error was generated earlier and an empty mesh was cached.
> > >
> > > On Wed, 17 Apr 2019, 02:24 A. Craig West, <acraigwest@gmail.com>
> wrote:
> > >>
> > >> Due to issues I have had with CGAL generated shapes forming
> > >> non-manifold STL files, making them difficult to import into other
> > >> tools, I have been focusing on doing as much of my design as possible
> > >> in userspace, generating 3D polyhedrons. This has been a lot of work
> > >> due to limited support in the codebase, particularly as I am limited
> > >> to running in the 2015 version. It would definitely be nice to have
> > >> some 3d union, difference, and intersection functions for polyhedrons,
> > >> but up until now I have been making do.
> > >> I am having a couple of problems with this approach. One of these is
> > >> that the internal code-base does not always seem to be able to handle
> > >> userspace polygons properly. For example, I have a complex shape which
> > >> is totally manifold, forms a single object, and renders perfectly, if
> > >> I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
> > >> properly mirrored, but if I display both the original shape and the
> > >> mirrored one, the show properly in the preview but either go
> > >> non-manifold or vanish entirely when rendered.
> > >> I also have issues when trying to union my shape with other shapes, it
> > >> always works fine in preview, but when I render, it may work, or it
> > >> may give an assertion failure and leave my shape out of the final
> > >> rendering. Actually, in the example I am including a screenshot of,
> > >> there was no error or warning at all when it rendered, it just removed
> > >> my shape...
> > >> Does anybody have any suggestions on what I can do to work around
> > >> this? There are shapes that would be REALLY annoying for my to do in
> > >> userspace, but if I can't find a workaround or solution for this, I am
> > >> going to have to do so...
> > >> _______________________________________________
> > >> 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
>
AC
A. Craig West
Thu, Apr 18, 2019 8:03 PM
I was wrong about the inverted polyhedron, unfortunately. With some
testing I have determined that the documentation is correct that the
primary requirement is for all of the faces to be consistently
oriented. The difference in how it dispays seems to be based on how
many objects there are. A single polyhedron, no matter how complex,
renders with just a count of facets. if there are multiple objects, or
two objects that have been unioned into one, it gives the complete
list.
I have narrowed my problem down to one particular section of the
polyhedron (it is generated in multiple sections, but is manifold). If
this section is on it's own, it renders properly, but if a second
shape exists anywhere in space, CGAL fails with an error (this is in
the 2015 version, I wouldn't be surprised if the line numbers were
different in the later code):
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File: /Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251
On Thu, Apr 18, 2019 at 3:28 PM nop head nop.head@gmail.com wrote:
If you don't get the Simple, Vertices, etc it means CGAL isn't involved at all. So yes it will display invalid polyhedra. If CGAL is used it will always complain and make the object disappear if there is anything wrong with it. But you only get the error message once and then the empty result is cached.
On Thu, 18 Apr 2019 at 14:23, A. Craig West acraigwest@gmail.com wrote:
I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
I have screenshots showing the two objects I am trying to union, with
a gap of a full millimetre (or unit point, I suppose) between them.
There is no way that this is not a bug in how the cgal code is
working. At this point I have no way to workaround the issue, other
than moving the entire design into userspace, which seems somewhat
ridiculous.
I am also curious why rendered polyhedrons display differently in the
console output. Objects created normally display:
Top level object is a 3D object:
Simple: yes
Vertices: 286
Halfedges: 858
Edges: 429
Halffacets: 290
Facets: 145
Volumes: 2
while polyhedrons display:
Top level object is a 3D object:
Facets: 12
Never mind, That was the solution to my problem. I am sure I remember
the documentation for polyhedron saying that faces should be clockwise
when viewed from the inside outwards, but that certainly isn't what it
says now. I am going to reverse my faces, and that should fix
everything....
On Wed, Apr 17, 2019 at 7:19 AM A. Craig West acraigwest@gmail.com wrote:
Oddly enough, even if the two shapes have no overlap at all, by even a
significant margin, I can't get them to render properly. I have tried
with a large visible gap between the two parts, and it still discard
the polyhedron, which is definitely valid.
On Wed, Apr 17, 2019 at 4:44 AM nop head nop.head@gmail.com wrote:
2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
On Wed, 17 Apr 2019, 02:24 A. Craig West, acraigwest@gmail.com wrote:
Due to issues I have had with CGAL generated shapes forming
non-manifold STL files, making them difficult to import into other
tools, I have been focusing on doing as much of my design as possible
in userspace, generating 3D polyhedrons. This has been a lot of work
due to limited support in the codebase, particularly as I am limited
to running in the 2015 version. It would definitely be nice to have
some 3d union, difference, and intersection functions for polyhedrons,
but up until now I have been making do.
I am having a couple of problems with this approach. One of these is
that the internal code-base does not always seem to be able to handle
userspace polygons properly. For example, I have a complex shape which
is totally manifold, forms a single object, and renders perfectly, if
I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
properly mirrored, but if I display both the original shape and the
mirrored one, the show properly in the preview but either go
non-manifold or vanish entirely when rendered.
I also have issues when trying to union my shape with other shapes, it
always works fine in preview, but when I render, it may work, or it
may give an assertion failure and leave my shape out of the final
rendering. Actually, in the example I am including a screenshot of,
there was no error or warning at all when it rendered, it just removed
my shape...
Does anybody have any suggestions on what I can do to work around
this? There are shapes that would be REALLY annoying for my to do in
userspace, but if I can't find a workaround or solution for this, I am
going to have to do so...
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I was wrong about the inverted polyhedron, unfortunately. With some
testing I have determined that the documentation is correct that the
primary requirement is for all of the faces to be consistently
oriented. The difference in how it dispays seems to be based on how
many objects there are. A single polyhedron, no matter how complex,
renders with just a count of facets. if there are multiple objects, or
two objects that have been unioned into one, it gives the complete
list.
I have narrowed my problem down to one particular section of the
polyhedron (it is generated in multiple sections, but is manifold). If
this section is on it's own, it renders properly, but if a second
shape exists anywhere in space, CGAL fails with an error (this is in
the 2015 version, I wouldn't be surprised if the line numbers were
different in the later code):
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File: /Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251
On Thu, Apr 18, 2019 at 3:28 PM nop head <nop.head@gmail.com> wrote:
>
> If you don't get the Simple, Vertices, etc it means CGAL isn't involved at all. So yes it will display invalid polyhedra. If CGAL is used it will always complain and make the object disappear if there is anything wrong with it. But you only get the error message once and then the empty result is cached.
>
> On Thu, 18 Apr 2019 at 14:23, A. Craig West <acraigwest@gmail.com> wrote:
>>
>> I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
>>
>> I have screenshots showing the two objects I am trying to union, with
>> a gap of a full millimetre (or unit point, I suppose) between them.
>> There is no way that this is not a bug in how the cgal code is
>> working. At this point I have no way to workaround the issue, other
>> than moving the entire design into userspace, which seems somewhat
>> ridiculous.
>> I am also curious why rendered polyhedrons display differently in the
>> console output. Objects created normally display:
>> Top level object is a 3D object:
>> Simple: yes
>> Vertices: 286
>> Halfedges: 858
>> Edges: 429
>> Halffacets: 290
>> Facets: 145
>> Volumes: 2
>>
>> while polyhedrons display:
>> Top level object is a 3D object:
>> Facets: 12
>>
>> Never mind, That was the solution to my problem. I am sure I remember
>> the documentation for polyhedron saying that faces should be clockwise
>> when viewed from the inside outwards, but that certainly isn't what it
>> says now. I am going to reverse my faces, and that should fix
>> everything....
>>
>> On Wed, Apr 17, 2019 at 7:19 AM A. Craig West <acraigwest@gmail.com> wrote:
>> >
>> > Oddly enough, even if the two shapes have no overlap at all, by even a
>> > significant margin, I can't get them to render properly. I have tried
>> > with a large visible gap between the two parts, and it still discard
>> > the polyhedron, which is definitely valid.
>> >
>> > On Wed, Apr 17, 2019 at 4:44 AM nop head <nop.head@gmail.com> wrote:
>> > >
>> > > 2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
>> > >
>> > > Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
>> > >
>> > > When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
>> > >
>> > > On Wed, 17 Apr 2019, 02:24 A. Craig West, <acraigwest@gmail.com> wrote:
>> > >>
>> > >> Due to issues I have had with CGAL generated shapes forming
>> > >> non-manifold STL files, making them difficult to import into other
>> > >> tools, I have been focusing on doing as much of my design as possible
>> > >> in userspace, generating 3D polyhedrons. This has been a lot of work
>> > >> due to limited support in the codebase, particularly as I am limited
>> > >> to running in the 2015 version. It would definitely be nice to have
>> > >> some 3d union, difference, and intersection functions for polyhedrons,
>> > >> but up until now I have been making do.
>> > >> I am having a couple of problems with this approach. One of these is
>> > >> that the internal code-base does not always seem to be able to handle
>> > >> userspace polygons properly. For example, I have a complex shape which
>> > >> is totally manifold, forms a single object, and renders perfectly, if
>> > >> I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
>> > >> properly mirrored, but if I display both the original shape and the
>> > >> mirrored one, the show properly in the preview but either go
>> > >> non-manifold or vanish entirely when rendered.
>> > >> I also have issues when trying to union my shape with other shapes, it
>> > >> always works fine in preview, but when I render, it may work, or it
>> > >> may give an assertion failure and leave my shape out of the final
>> > >> rendering. Actually, in the example I am including a screenshot of,
>> > >> there was no error or warning at all when it rendered, it just removed
>> > >> my shape...
>> > >> Does anybody have any suggestions on what I can do to work around
>> > >> this? There are shapes that would be REALLY annoying for my to do in
>> > >> userspace, but if I can't find a workaround or solution for this, I am
>> > >> going to have to do so...
>> > >> _______________________________________________
>> > >> 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
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
AC
A. Craig West
Thu, Apr 18, 2019 9:07 PM
Well, I found the actual problem, and while the behaviour is a bit
inexplicable, it was easy to fix once I found it. There was a bug in
my polygon triangularisation code which would improperly split up a
polygon that had collinear sides, if it still formed a triangle.I
suspect it was turning it into a large triangle and a degenerate
triangle. This is definitely a bug in my code, but I haver no idea why
the cgal code was okay with it as long as it was part of the only
shape in the space, but not if there exists a second shape. Magic...
On Thu, Apr 18, 2019 at 4:03 PM A. Craig West acraigwest@gmail.com wrote:
I was wrong about the inverted polyhedron, unfortunately. With some
testing I have determined that the documentation is correct that the
primary requirement is for all of the faces to be consistently
oriented. The difference in how it dispays seems to be based on how
many objects there are. A single polyhedron, no matter how complex,
renders with just a count of facets. if there are multiple objects, or
two objects that have been unioned into one, it gives the complete
list.
I have narrowed my problem down to one particular section of the
polyhedron (it is generated in multiple sections, but is manifold). If
this section is on it's own, it renders properly, but if a second
shape exists anywhere in space, CGAL fails with an error (this is in
the 2015 version, I wouldn't be surprised if the line numbers were
different in the later code):
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File: /Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251
On Thu, Apr 18, 2019 at 3:28 PM nop head nop.head@gmail.com wrote:
If you don't get the Simple, Vertices, etc it means CGAL isn't involved at all. So yes it will display invalid polyhedra. If CGAL is used it will always complain and make the object disappear if there is anything wrong with it. But you only get the error message once and then the empty result is cached.
On Thu, 18 Apr 2019 at 14:23, A. Craig West acraigwest@gmail.com wrote:
I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
I have screenshots showing the two objects I am trying to union, with
a gap of a full millimetre (or unit point, I suppose) between them.
There is no way that this is not a bug in how the cgal code is
working. At this point I have no way to workaround the issue, other
than moving the entire design into userspace, which seems somewhat
ridiculous.
I am also curious why rendered polyhedrons display differently in the
console output. Objects created normally display:
Top level object is a 3D object:
Simple: yes
Vertices: 286
Halfedges: 858
Edges: 429
Halffacets: 290
Facets: 145
Volumes: 2
while polyhedrons display:
Top level object is a 3D object:
Facets: 12
Never mind, That was the solution to my problem. I am sure I remember
the documentation for polyhedron saying that faces should be clockwise
when viewed from the inside outwards, but that certainly isn't what it
says now. I am going to reverse my faces, and that should fix
everything....
On Wed, Apr 17, 2019 at 7:19 AM A. Craig West acraigwest@gmail.com wrote:
Oddly enough, even if the two shapes have no overlap at all, by even a
significant margin, I can't get them to render properly. I have tried
with a large visible gap between the two parts, and it still discard
the polyhedron, which is definitely valid.
On Wed, Apr 17, 2019 at 4:44 AM nop head nop.head@gmail.com wrote:
2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
On Wed, 17 Apr 2019, 02:24 A. Craig West, acraigwest@gmail.com wrote:
Due to issues I have had with CGAL generated shapes forming
non-manifold STL files, making them difficult to import into other
tools, I have been focusing on doing as much of my design as possible
in userspace, generating 3D polyhedrons. This has been a lot of work
due to limited support in the codebase, particularly as I am limited
to running in the 2015 version. It would definitely be nice to have
some 3d union, difference, and intersection functions for polyhedrons,
but up until now I have been making do.
I am having a couple of problems with this approach. One of these is
that the internal code-base does not always seem to be able to handle
userspace polygons properly. For example, I have a complex shape which
is totally manifold, forms a single object, and renders perfectly, if
I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
properly mirrored, but if I display both the original shape and the
mirrored one, the show properly in the preview but either go
non-manifold or vanish entirely when rendered.
I also have issues when trying to union my shape with other shapes, it
always works fine in preview, but when I render, it may work, or it
may give an assertion failure and leave my shape out of the final
rendering. Actually, in the example I am including a screenshot of,
there was no error or warning at all when it rendered, it just removed
my shape...
Does anybody have any suggestions on what I can do to work around
this? There are shapes that would be REALLY annoying for my to do in
userspace, but if I can't find a workaround or solution for this, I am
going to have to do so...
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Well, I found the actual problem, and while the behaviour is a bit
inexplicable, it was easy to fix once I found it. There was a bug in
my polygon triangularisation code which would improperly split up a
polygon that had collinear sides, if it still formed a triangle.I
suspect it was turning it into a large triangle and a degenerate
triangle. This is definitely a bug in my code, but I haver no idea why
the cgal code was okay with it as long as it was part of the only
shape in the space, but not if there exists a second shape. Magic...
On Thu, Apr 18, 2019 at 4:03 PM A. Craig West <acraigwest@gmail.com> wrote:
>
> I was wrong about the inverted polyhedron, unfortunately. With some
> testing I have determined that the documentation is correct that the
> primary requirement is for all of the faces to be consistently
> oriented. The difference in how it dispays seems to be based on how
> many objects there are. A single polyhedron, no matter how complex,
> renders with just a count of facets. if there are multiple objects, or
> two objects that have been unioned into one, it gives the complete
> list.
> I have narrowed my problem down to one particular section of the
> polyhedron (it is generated in multiple sections, but is manifold). If
> this section is on it's own, it renders properly, but if a second
> shape exists anywhere in space, CGAL fails with an error (this is in
> the 2015 version, I wouldn't be surprised if the line numbers were
> different in the later code):
>
> ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
> violation! Expr: pe_prev->is_border() ||
> !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
> File: /Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
> Line: 251
>
> On Thu, Apr 18, 2019 at 3:28 PM nop head <nop.head@gmail.com> wrote:
> >
> > If you don't get the Simple, Vertices, etc it means CGAL isn't involved at all. So yes it will display invalid polyhedra. If CGAL is used it will always complain and make the object disappear if there is anything wrong with it. But you only get the error message once and then the empty result is cached.
> >
> > On Thu, 18 Apr 2019 at 14:23, A. Craig West <acraigwest@gmail.com> wrote:
> >>
> >> I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
> >>
> >> I have screenshots showing the two objects I am trying to union, with
> >> a gap of a full millimetre (or unit point, I suppose) between them.
> >> There is no way that this is not a bug in how the cgal code is
> >> working. At this point I have no way to workaround the issue, other
> >> than moving the entire design into userspace, which seems somewhat
> >> ridiculous.
> >> I am also curious why rendered polyhedrons display differently in the
> >> console output. Objects created normally display:
> >> Top level object is a 3D object:
> >> Simple: yes
> >> Vertices: 286
> >> Halfedges: 858
> >> Edges: 429
> >> Halffacets: 290
> >> Facets: 145
> >> Volumes: 2
> >>
> >> while polyhedrons display:
> >> Top level object is a 3D object:
> >> Facets: 12
> >>
> >> Never mind, That was the solution to my problem. I am sure I remember
> >> the documentation for polyhedron saying that faces should be clockwise
> >> when viewed from the inside outwards, but that certainly isn't what it
> >> says now. I am going to reverse my faces, and that should fix
> >> everything....
> >>
> >> On Wed, Apr 17, 2019 at 7:19 AM A. Craig West <acraigwest@gmail.com> wrote:
> >> >
> >> > Oddly enough, even if the two shapes have no overlap at all, by even a
> >> > significant margin, I can't get them to render properly. I have tried
> >> > with a large visible gap between the two parts, and it still discard
> >> > the polyhedron, which is definitely valid.
> >> >
> >> > On Wed, Apr 17, 2019 at 4:44 AM nop head <nop.head@gmail.com> wrote:
> >> > >
> >> > > 2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
> >> > >
> >> > > Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
> >> > >
> >> > > When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
> >> > >
> >> > > On Wed, 17 Apr 2019, 02:24 A. Craig West, <acraigwest@gmail.com> wrote:
> >> > >>
> >> > >> Due to issues I have had with CGAL generated shapes forming
> >> > >> non-manifold STL files, making them difficult to import into other
> >> > >> tools, I have been focusing on doing as much of my design as possible
> >> > >> in userspace, generating 3D polyhedrons. This has been a lot of work
> >> > >> due to limited support in the codebase, particularly as I am limited
> >> > >> to running in the 2015 version. It would definitely be nice to have
> >> > >> some 3d union, difference, and intersection functions for polyhedrons,
> >> > >> but up until now I have been making do.
> >> > >> I am having a couple of problems with this approach. One of these is
> >> > >> that the internal code-base does not always seem to be able to handle
> >> > >> userspace polygons properly. For example, I have a complex shape which
> >> > >> is totally manifold, forms a single object, and renders perfectly, if
> >> > >> I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
> >> > >> properly mirrored, but if I display both the original shape and the
> >> > >> mirrored one, the show properly in the preview but either go
> >> > >> non-manifold or vanish entirely when rendered.
> >> > >> I also have issues when trying to union my shape with other shapes, it
> >> > >> always works fine in preview, but when I render, it may work, or it
> >> > >> may give an assertion failure and leave my shape out of the final
> >> > >> rendering. Actually, in the example I am including a screenshot of,
> >> > >> there was no error or warning at all when it rendered, it just removed
> >> > >> my shape...
> >> > >> Does anybody have any suggestions on what I can do to work around
> >> > >> this? There are shapes that would be REALLY annoying for my to do in
> >> > >> userspace, but if I can't find a workaround or solution for this, I am
> >> > >> going to have to do so...
> >> > >> _______________________________________________
> >> > >> 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
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > Discuss@lists.openscad.org
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
AC
A. Craig West
Thu, Apr 18, 2019 9:27 PM
I am going to have to debug the code, I think. It is still have
problems, although I thought it was okay.
On Thu, Apr 18, 2019 at 5:07 PM A. Craig West acraigwest@gmail.com wrote:
Well, I found the actual problem, and while the behaviour is a bit
inexplicable, it was easy to fix once I found it. There was a bug in
my polygon triangularisation code which would improperly split up a
polygon that had collinear sides, if it still formed a triangle.I
suspect it was turning it into a large triangle and a degenerate
triangle. This is definitely a bug in my code, but I haver no idea why
the cgal code was okay with it as long as it was part of the only
shape in the space, but not if there exists a second shape. Magic...
On Thu, Apr 18, 2019 at 4:03 PM A. Craig West acraigwest@gmail.com wrote:
I was wrong about the inverted polyhedron, unfortunately. With some
testing I have determined that the documentation is correct that the
primary requirement is for all of the faces to be consistently
oriented. The difference in how it dispays seems to be based on how
many objects there are. A single polyhedron, no matter how complex,
renders with just a count of facets. if there are multiple objects, or
two objects that have been unioned into one, it gives the complete
list.
I have narrowed my problem down to one particular section of the
polyhedron (it is generated in multiple sections, but is manifold). If
this section is on it's own, it renders properly, but if a second
shape exists anywhere in space, CGAL fails with an error (this is in
the 2015 version, I wouldn't be surprised if the line numbers were
different in the later code):
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File: /Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251
On Thu, Apr 18, 2019 at 3:28 PM nop head nop.head@gmail.com wrote:
If you don't get the Simple, Vertices, etc it means CGAL isn't involved at all. So yes it will display invalid polyhedra. If CGAL is used it will always complain and make the object disappear if there is anything wrong with it. But you only get the error message once and then the empty result is cached.
On Thu, 18 Apr 2019 at 14:23, A. Craig West acraigwest@gmail.com wrote:
I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
I have screenshots showing the two objects I am trying to union, with
a gap of a full millimetre (or unit point, I suppose) between them.
There is no way that this is not a bug in how the cgal code is
working. At this point I have no way to workaround the issue, other
than moving the entire design into userspace, which seems somewhat
ridiculous.
I am also curious why rendered polyhedrons display differently in the
console output. Objects created normally display:
Top level object is a 3D object:
Simple: yes
Vertices: 286
Halfedges: 858
Edges: 429
Halffacets: 290
Facets: 145
Volumes: 2
while polyhedrons display:
Top level object is a 3D object:
Facets: 12
Never mind, That was the solution to my problem. I am sure I remember
the documentation for polyhedron saying that faces should be clockwise
when viewed from the inside outwards, but that certainly isn't what it
says now. I am going to reverse my faces, and that should fix
everything....
On Wed, Apr 17, 2019 at 7:19 AM A. Craig West acraigwest@gmail.com wrote:
Oddly enough, even if the two shapes have no overlap at all, by even a
significant margin, I can't get them to render properly. I have tried
with a large visible gap between the two parts, and it still discard
the polyhedron, which is definitely valid.
On Wed, Apr 17, 2019 at 4:44 AM nop head nop.head@gmail.com wrote:
2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
On Wed, 17 Apr 2019, 02:24 A. Craig West, acraigwest@gmail.com wrote:
Due to issues I have had with CGAL generated shapes forming
non-manifold STL files, making them difficult to import into other
tools, I have been focusing on doing as much of my design as possible
in userspace, generating 3D polyhedrons. This has been a lot of work
due to limited support in the codebase, particularly as I am limited
to running in the 2015 version. It would definitely be nice to have
some 3d union, difference, and intersection functions for polyhedrons,
but up until now I have been making do.
I am having a couple of problems with this approach. One of these is
that the internal code-base does not always seem to be able to handle
userspace polygons properly. For example, I have a complex shape which
is totally manifold, forms a single object, and renders perfectly, if
I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
properly mirrored, but if I display both the original shape and the
mirrored one, the show properly in the preview but either go
non-manifold or vanish entirely when rendered.
I also have issues when trying to union my shape with other shapes, it
always works fine in preview, but when I render, it may work, or it
may give an assertion failure and leave my shape out of the final
rendering. Actually, in the example I am including a screenshot of,
there was no error or warning at all when it rendered, it just removed
my shape...
Does anybody have any suggestions on what I can do to work around
this? There are shapes that would be REALLY annoying for my to do in
userspace, but if I can't find a workaround or solution for this, I am
going to have to do so...
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I am going to have to debug the code, I think. It is still have
problems, although I thought it was okay.
On Thu, Apr 18, 2019 at 5:07 PM A. Craig West <acraigwest@gmail.com> wrote:
>
> Well, I found the actual problem, and while the behaviour is a bit
> inexplicable, it was easy to fix once I found it. There was a bug in
> my polygon triangularisation code which would improperly split up a
> polygon that had collinear sides, if it still formed a triangle.I
> suspect it was turning it into a large triangle and a degenerate
> triangle. This is definitely a bug in my code, but I haver no idea why
> the cgal code was okay with it as long as it was part of the only
> shape in the space, but not if there exists a second shape. Magic...
>
> On Thu, Apr 18, 2019 at 4:03 PM A. Craig West <acraigwest@gmail.com> wrote:
> >
> > I was wrong about the inverted polyhedron, unfortunately. With some
> > testing I have determined that the documentation is correct that the
> > primary requirement is for all of the faces to be consistently
> > oriented. The difference in how it dispays seems to be based on how
> > many objects there are. A single polyhedron, no matter how complex,
> > renders with just a count of facets. if there are multiple objects, or
> > two objects that have been unioned into one, it gives the complete
> > list.
> > I have narrowed my problem down to one particular section of the
> > polyhedron (it is generated in multiple sections, but is manifold). If
> > this section is on it's own, it renders properly, but if a second
> > shape exists anywhere in space, CGAL fails with an error (this is in
> > the 2015 version, I wouldn't be surprised if the line numbers were
> > different in the later code):
> >
> > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
> > violation! Expr: pe_prev->is_border() ||
> > !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
> > File: /Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
> > Line: 251
> >
> > On Thu, Apr 18, 2019 at 3:28 PM nop head <nop.head@gmail.com> wrote:
> > >
> > > If you don't get the Simple, Vertices, etc it means CGAL isn't involved at all. So yes it will display invalid polyhedra. If CGAL is used it will always complain and make the object disappear if there is anything wrong with it. But you only get the error message once and then the empty result is cached.
> > >
> > > On Thu, 18 Apr 2019 at 14:23, A. Craig West <acraigwest@gmail.com> wrote:
> > >>
> > >> I am getting exactly the same issues in version 2019.01-RC4 (git 2a697e4)
> > >>
> > >> I have screenshots showing the two objects I am trying to union, with
> > >> a gap of a full millimetre (or unit point, I suppose) between them.
> > >> There is no way that this is not a bug in how the cgal code is
> > >> working. At this point I have no way to workaround the issue, other
> > >> than moving the entire design into userspace, which seems somewhat
> > >> ridiculous.
> > >> I am also curious why rendered polyhedrons display differently in the
> > >> console output. Objects created normally display:
> > >> Top level object is a 3D object:
> > >> Simple: yes
> > >> Vertices: 286
> > >> Halfedges: 858
> > >> Edges: 429
> > >> Halffacets: 290
> > >> Facets: 145
> > >> Volumes: 2
> > >>
> > >> while polyhedrons display:
> > >> Top level object is a 3D object:
> > >> Facets: 12
> > >>
> > >> Never mind, That was the solution to my problem. I am sure I remember
> > >> the documentation for polyhedron saying that faces should be clockwise
> > >> when viewed from the inside outwards, but that certainly isn't what it
> > >> says now. I am going to reverse my faces, and that should fix
> > >> everything....
> > >>
> > >> On Wed, Apr 17, 2019 at 7:19 AM A. Craig West <acraigwest@gmail.com> wrote:
> > >> >
> > >> > Oddly enough, even if the two shapes have no overlap at all, by even a
> > >> > significant margin, I can't get them to render properly. I have tried
> > >> > with a large visible gap between the two parts, and it still discard
> > >> > the polyhedron, which is definitely valid.
> > >> >
> > >> > On Wed, Apr 17, 2019 at 4:44 AM nop head <nop.head@gmail.com> wrote:
> > >> > >
> > >> > > 2015 is so long ago l don't remember what issues it had. In general though the way to avoid this type of issue is to make sure vertices are either exactly numerically the same, or different by a significant margin. Close vertices get merged and that breaks topology.
> > >> > >
> > >> > > Another tip is to clear the cache before F6. Preview can cache corrupted meshes.
> > >> > >
> > >> > > When objects disappear without an error it is usually because the error was generated earlier and an empty mesh was cached.
> > >> > >
> > >> > > On Wed, 17 Apr 2019, 02:24 A. Craig West, <acraigwest@gmail.com> wrote:
> > >> > >>
> > >> > >> Due to issues I have had with CGAL generated shapes forming
> > >> > >> non-manifold STL files, making them difficult to import into other
> > >> > >> tools, I have been focusing on doing as much of my design as possible
> > >> > >> in userspace, generating 3D polyhedrons. This has been a lot of work
> > >> > >> due to limited support in the codebase, particularly as I am limited
> > >> > >> to running in the 2015 version. It would definitely be nice to have
> > >> > >> some 3d union, difference, and intersection functions for polyhedrons,
> > >> > >> but up until now I have been making do.
> > >> > >> I am having a couple of problems with this approach. One of these is
> > >> > >> that the internal code-base does not always seem to be able to handle
> > >> > >> userspace polygons properly. For example, I have a complex shape which
> > >> > >> is totally manifold, forms a single object, and renders perfectly, if
> > >> > >> I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module, it is
> > >> > >> properly mirrored, but if I display both the original shape and the
> > >> > >> mirrored one, the show properly in the preview but either go
> > >> > >> non-manifold or vanish entirely when rendered.
> > >> > >> I also have issues when trying to union my shape with other shapes, it
> > >> > >> always works fine in preview, but when I render, it may work, or it
> > >> > >> may give an assertion failure and leave my shape out of the final
> > >> > >> rendering. Actually, in the example I am including a screenshot of,
> > >> > >> there was no error or warning at all when it rendered, it just removed
> > >> > >> my shape...
> > >> > >> Does anybody have any suggestions on what I can do to work around
> > >> > >> this? There are shapes that would be REALLY annoying for my to do in
> > >> > >> userspace, but if I can't find a workaround or solution for this, I am
> > >> > >> going to have to do so...
> > >> > >> _______________________________________________
> > >> > >> 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
> > >
> > > _______________________________________________
> > > OpenSCAD mailing list
> > > Discuss@lists.openscad.org
> > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
NH
nop head
Thu, Apr 18, 2019 9:43 PM
This is definitely a bug in my code, but I haver no idea why the cgal code
was okay with it as long as it was part of the only shape in the space,
If there is only one polyhedron CGAL is never called. OpenSCAD represents
polyhedra and the results of extrudes and primitives like cube with
PolySets. These are simple polygon soups and don't care about topology.
When you do 3D union, intersection or difference then they get converted to
NefPolhedra and passed to CGAL. This is where it matters that they are
manifold and errors are generated.
On Thu, 18 Apr 2019 at 22:28, A. Craig West acraigwest@gmail.com wrote:
I am going to have to debug the code, I think. It is still have
problems, although I thought it was okay.
On Thu, Apr 18, 2019 at 5:07 PM A. Craig West acraigwest@gmail.com
wrote:
Well, I found the actual problem, and while the behaviour is a bit
inexplicable, it was easy to fix once I found it. There was a bug in
my polygon triangularisation code which would improperly split up a
polygon that had collinear sides, if it still formed a triangle.I
suspect it was turning it into a large triangle and a degenerate
triangle. This is definitely a bug in my code, but I haver no idea why
the cgal code was okay with it as long as it was part of the only
shape in the space, but not if there exists a second shape. Magic...
On Thu, Apr 18, 2019 at 4:03 PM A. Craig West acraigwest@gmail.com
I was wrong about the inverted polyhedron, unfortunately. With some
testing I have determined that the documentation is correct that the
primary requirement is for all of the faces to be consistently
oriented. The difference in how it dispays seems to be based on how
many objects there are. A single polyhedron, no matter how complex,
renders with just a count of facets. if there are multiple objects, or
two objects that have been unioned into one, it gives the complete
list.
I have narrowed my problem down to one particular section of the
polyhedron (it is generated in multiple sections, but is manifold). If
this section is on it's own, it renders properly, but if a second
shape exists anywhere in space, CGAL fails with an error (this is in
the 2015 version, I wouldn't be surprised if the line numbers were
different in the later code):
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
/Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
If you don't get the Simple, Vertices, etc it means CGAL isn't
involved at all. So yes it will display invalid polyhedra. If CGAL is used
it will always complain and make the object disappear if there is anything
wrong with it. But you only get the error message once and then the empty
result is cached.
I am getting exactly the same issues in version 2019.01-RC4 (git
I have screenshots showing the two objects I am trying to union,
a gap of a full millimetre (or unit point, I suppose) between them.
There is no way that this is not a bug in how the cgal code is
working. At this point I have no way to workaround the issue, other
than moving the entire design into userspace, which seems somewhat
ridiculous.
I am also curious why rendered polyhedrons display differently in
console output. Objects created normally display:
Top level object is a 3D object:
Simple: yes
Vertices: 286
Halfedges: 858
Edges: 429
Halffacets: 290
Facets: 145
Volumes: 2
while polyhedrons display:
Top level object is a 3D object:
Facets: 12
Never mind, That was the solution to my problem. I am sure I
the documentation for polyhedron saying that faces should be
when viewed from the inside outwards, but that certainly isn't what
says now. I am going to reverse my faces, and that should fix
everything....
On Wed, Apr 17, 2019 at 7:19 AM A. Craig West acraigwest@gmail.com
Oddly enough, even if the two shapes have no overlap at all, by
significant margin, I can't get them to render properly. I have
with a large visible gap between the two parts, and it still
the polyhedron, which is definitely valid.
On Wed, Apr 17, 2019 at 4:44 AM nop head nop.head@gmail.com
2015 is so long ago l don't remember what issues it had. In
general though the way to avoid this type of issue is to make sure vertices
are either exactly numerically the same, or different by a significant
margin. Close vertices get merged and that breaks topology.
Another tip is to clear the cache before F6. Preview can cache
When objects disappear without an error it is usually because
the error was generated earlier and an empty mesh was cached.
Due to issues I have had with CGAL generated shapes forming
non-manifold STL files, making them difficult to import into
tools, I have been focusing on doing as much of my design as
in userspace, generating 3D polyhedrons. This has been a lot
due to limited support in the codebase, particularly as I am
to running in the 2015 version. It would definitely be nice to
some 3d union, difference, and intersection functions for
but up until now I have been making do.
I am having a couple of problems with this approach. One of
that the internal code-base does not always seem to be able to
userspace polygons properly. For example, I have a complex
is totally manifold, forms a single object, and renders
I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module,
properly mirrored, but if I display both the original shape
mirrored one, the show properly in the preview but either go
non-manifold or vanish entirely when rendered.
I also have issues when trying to union my shape with other
always works fine in preview, but when I render, it may work,
may give an assertion failure and leave my shape out of the
rendering. Actually, in the example I am including a
there was no error or warning at all when it rendered, it just
my shape...
Does anybody have any suggestions on what I can do to work
this? There are shapes that would be REALLY annoying for my to
userspace, but if I can't find a workaround or solution for
>
> This is definitely a bug in my code, but I haver no idea why the cgal code
> was okay with it as long as it was part of the only shape in the space,
If there is only one polyhedron CGAL is never called. OpenSCAD represents
polyhedra and the results of extrudes and primitives like cube with
PolySets. These are simple polygon soups and don't care about topology.
When you do 3D union, intersection or difference then they get converted to
NefPolhedra and passed to CGAL. This is where it matters that they are
manifold and errors are generated.
On Thu, 18 Apr 2019 at 22:28, A. Craig West <acraigwest@gmail.com> wrote:
> I am going to have to debug the code, I think. It is still have
> problems, although I thought it was okay.
>
> On Thu, Apr 18, 2019 at 5:07 PM A. Craig West <acraigwest@gmail.com>
> wrote:
> >
> > Well, I found the actual problem, and while the behaviour is a bit
> > inexplicable, it was easy to fix once I found it. There was a bug in
> > my polygon triangularisation code which would improperly split up a
> > polygon that had collinear sides, if it still formed a triangle.I
> > suspect it was turning it into a large triangle and a degenerate
> > triangle. This is definitely a bug in my code, but I haver no idea why
> > the cgal code was okay with it as long as it was part of the only
> > shape in the space, but not if there exists a second shape. Magic...
> >
> > On Thu, Apr 18, 2019 at 4:03 PM A. Craig West <acraigwest@gmail.com>
> wrote:
> > >
> > > I was wrong about the inverted polyhedron, unfortunately. With some
> > > testing I have determined that the documentation is correct that the
> > > primary requirement is for all of the faces to be consistently
> > > oriented. The difference in how it dispays seems to be based on how
> > > many objects there are. A single polyhedron, no matter how complex,
> > > renders with just a count of facets. if there are multiple objects, or
> > > two objects that have been unioned into one, it gives the complete
> > > list.
> > > I have narrowed my problem down to one particular section of the
> > > polyhedron (it is generated in multiple sections, but is manifold). If
> > > this section is on it's own, it renders properly, but if a second
> > > shape exists anywhere in space, CGAL fails with an error (this is in
> > > the 2015 version, I wouldn't be surprised if the line numbers were
> > > different in the later code):
> > >
> > > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
> > > violation! Expr: pe_prev->is_border() ||
> > >
> !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
> > > File:
> /Users/kintel/code/OpenSCAD/openscad-2015.03-3/../libraries/install/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
> > > Line: 251
> > >
> > > On Thu, Apr 18, 2019 at 3:28 PM nop head <nop.head@gmail.com> wrote:
> > > >
> > > > If you don't get the Simple, Vertices, etc it means CGAL isn't
> involved at all. So yes it will display invalid polyhedra. If CGAL is used
> it will always complain and make the object disappear if there is anything
> wrong with it. But you only get the error message once and then the empty
> result is cached.
> > > >
> > > > On Thu, 18 Apr 2019 at 14:23, A. Craig West <acraigwest@gmail.com>
> wrote:
> > > >>
> > > >> I am getting exactly the same issues in version 2019.01-RC4 (git
> 2a697e4)
> > > >>
> > > >> I have screenshots showing the two objects I am trying to union,
> with
> > > >> a gap of a full millimetre (or unit point, I suppose) between them.
> > > >> There is no way that this is not a bug in how the cgal code is
> > > >> working. At this point I have no way to workaround the issue, other
> > > >> than moving the entire design into userspace, which seems somewhat
> > > >> ridiculous.
> > > >> I am also curious why rendered polyhedrons display differently in
> the
> > > >> console output. Objects created normally display:
> > > >> Top level object is a 3D object:
> > > >> Simple: yes
> > > >> Vertices: 286
> > > >> Halfedges: 858
> > > >> Edges: 429
> > > >> Halffacets: 290
> > > >> Facets: 145
> > > >> Volumes: 2
> > > >>
> > > >> while polyhedrons display:
> > > >> Top level object is a 3D object:
> > > >> Facets: 12
> > > >>
> > > >> Never mind, That was the solution to my problem. I am sure I
> remember
> > > >> the documentation for polyhedron saying that faces should be
> clockwise
> > > >> when viewed from the inside outwards, but that certainly isn't what
> it
> > > >> says now. I am going to reverse my faces, and that should fix
> > > >> everything....
> > > >>
> > > >> On Wed, Apr 17, 2019 at 7:19 AM A. Craig West <acraigwest@gmail.com>
> wrote:
> > > >> >
> > > >> > Oddly enough, even if the two shapes have no overlap at all, by
> even a
> > > >> > significant margin, I can't get them to render properly. I have
> tried
> > > >> > with a large visible gap between the two parts, and it still
> discard
> > > >> > the polyhedron, which is definitely valid.
> > > >> >
> > > >> > On Wed, Apr 17, 2019 at 4:44 AM nop head <nop.head@gmail.com>
> wrote:
> > > >> > >
> > > >> > > 2015 is so long ago l don't remember what issues it had. In
> general though the way to avoid this type of issue is to make sure vertices
> are either exactly numerically the same, or different by a significant
> margin. Close vertices get merged and that breaks topology.
> > > >> > >
> > > >> > > Another tip is to clear the cache before F6. Preview can cache
> corrupted meshes.
> > > >> > >
> > > >> > > When objects disappear without an error it is usually because
> the error was generated earlier and an empty mesh was cached.
> > > >> > >
> > > >> > > On Wed, 17 Apr 2019, 02:24 A. Craig West, <acraigwest@gmail.com>
> wrote:
> > > >> > >>
> > > >> > >> Due to issues I have had with CGAL generated shapes forming
> > > >> > >> non-manifold STL files, making them difficult to import into
> other
> > > >> > >> tools, I have been focusing on doing as much of my design as
> possible
> > > >> > >> in userspace, generating 3D polyhedrons. This has been a lot
> of work
> > > >> > >> due to limited support in the codebase, particularly as I am
> limited
> > > >> > >> to running in the 2015 version. It would definitely be nice to
> have
> > > >> > >> some 3d union, difference, and intersection functions for
> polyhedrons,
> > > >> > >> but up until now I have been making do.
> > > >> > >> I am having a couple of problems with this approach. One of
> these is
> > > >> > >> that the internal code-base does not always seem to be able to
> handle
> > > >> > >> userspace polygons properly. For example, I have a complex
> shape which
> > > >> > >> is totally manifold, forms a single object, and renders
> perfectly, if
> > > >> > >> I put it in a scale([-1, 1, 1]) or mirror([1, 0, 0]) module,
> it is
> > > >> > >> properly mirrored, but if I display both the original shape
> and the
> > > >> > >> mirrored one, the show properly in the preview but either go
> > > >> > >> non-manifold or vanish entirely when rendered.
> > > >> > >> I also have issues when trying to union my shape with other
> shapes, it
> > > >> > >> always works fine in preview, but when I render, it may work,
> or it
> > > >> > >> may give an assertion failure and leave my shape out of the
> final
> > > >> > >> rendering. Actually, in the example I am including a
> screenshot of,
> > > >> > >> there was no error or warning at all when it rendered, it just
> removed
> > > >> > >> my shape...
> > > >> > >> Does anybody have any suggestions on what I can do to work
> around
> > > >> > >> this? There are shapes that would be REALLY annoying for my to
> do in
> > > >> > >> userspace, but if I can't find a workaround or solution for
> this, I am
> > > >> > >> going to have to do so...
> > > >> > >> _______________________________________________
> > > >> > >> 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
> > > >
> > > > _______________________________________________
> > > > 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
>
M
MichaelAtOz
Fri, Apr 19, 2019 12:53 AM
I haver no idea why
the cgal code was okay with it as long as it was part of the only
shape in the space, but not if there exists a second shape. Magic...
Whenever debugging polys add a cube(1); that will force a union() and hence
CGAL during render.
Also use Design/Flush_caches often, particularly if you think something is
strange, as nophead says CGAL cache prevents error messages reoccurring.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
acwest wrote
> I haver no idea why
> the cgal code was okay with it as long as it was part of the only
> shape in the space, but not if there exists a second shape. Magic...
Whenever debugging polys add a cube(1); that will force a union() and hence
CGAL during render.
Also use Design/Flush_caches often, particularly if you think something is
strange, as nophead says CGAL cache prevents error messages reoccurring.
-----
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
--
Sent from: http://forum.openscad.org/
AC
A. Craig West
Sat, Apr 20, 2019 6:53 PM
It turns out my triangulation code wasn't correctly handling convex
polygons with some collinear vertices. I found the fastest solution was to
create a point in the centre of the convex polygon, and join all of the
vertices to that point. Of course, first you need a convex polygon, but I
solved that a while ago.
On Thu, 18 Apr 2019, 20:53 MichaelAtOz, oz.at.michael@gmail.com wrote:
I haver no idea why
the cgal code was okay with it as long as it was part of the only
shape in the space, but not if there exists a second shape. Magic...
Whenever debugging polys add a cube(1); that will force a union() and hence
CGAL during render.
Also use Design/Flush_caches often, particularly if you think something is
strange, as nophead says CGAL cache prevents error messages reoccurring.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
It turns out my triangulation code wasn't correctly handling convex
polygons with some collinear vertices. I found the fastest solution was to
create a point in the centre of the convex polygon, and join all of the
vertices to that point. Of course, first you need a convex polygon, but I
solved that a while ago.
On Thu, 18 Apr 2019, 20:53 MichaelAtOz, <oz.at.michael@gmail.com> wrote:
> acwest wrote
> > I haver no idea why
> > the cgal code was okay with it as long as it was part of the only
> > shape in the space, but not if there exists a second shape. Magic...
>
> Whenever debugging polys add a cube(1); that will force a union() and hence
> CGAL during render.
> Also use Design/Flush_caches often, particularly if you think something is
> strange, as nophead says CGAL cache prevents error messages reoccurring.
>
>
>
> -----
> Admin - email* me if you need anything, or if I've done something stupid...
>
> * click on my MichaelAtOz label, there is a link to email me.
>
> Unless specifically shown otherwise above, my contribution is in the
> Public Domain; to the extent possible under law, I have waived all
> copyright and related or neighbouring rights to this work. Obviously
> inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.” Fight it!
> http://www.ourfairdeal.org/ time is running out!
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>