hull() issue? (or is it me?)

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

hull() issue? (or is it me?)

jazzjohn



When I try to use the hull() function, it misses four of the six objects as shown in the bottom screen shot.

Code:

module front(diameter)  { rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.5);}
module back(diameter)  { rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.5);}

module top()
    {
    translate([3000,600,400]) back(250);  
    translate([0,0,400])front(500);
    translate([3000,-600,400]) back(250);
    }
   
module bottom()    
    {
    front(500);
    translate([3000,-600,0]) back(250);
    translate([3000,600,0]) back(250);
    }    
   
   
//hull()  //When uncommented, hull misses the back() objects called in top() and bottom().
    {
    bottom();    
    top();    
    }


Reply | Threaded
Open this post in threaded view
|

Re: hull() issue? (or is it me?)

Parkinbot
seems to be an issue. An obvious workaround is:

module top()
 hull()
    {
    translate([3000,600,400])  back(250);  
    translate([0,0,400])       front(500);
    translate([3000,-600,400]) back(250);
    }
   
module bottom()    
    hull()
    {
    front(500);
    translate([3000,-600,0]) back(250);
    translate([3000,600,0]) back(250);
    }    
   
hull()
    {
    bottom();    
    top();    
    }
tp3
Reply | Threaded
Open this post in threaded view
|

Re: hull() issue? (or is it me?)

tp3
In reply to this post by jazzjohn
On 06/15/2017 07:24 PM, jazzjohn wrote:
> When I try to use the hull() function, it misses four of the six
> objects as shown in the bottom screen shot.
>
There's probably a CGAL error in the console window?

I guess rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.5);
is producing non-manifold geometry due to rotating a circle that
touches the rotation axis at one point.

See https://github.com/openscad/openscad/issues/1081

ciao,
  Torsten.


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

Re: hull() issue? (or is it me?)

Parkinbot
Thorsten you are right. The following code works as intended,

module front(diameter)  { rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}
module back(diameter)  { rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}
Nevertheless, no CGAL error is reported, which IS an issue. And my workaround seems to work, despite the non-manifoldness you mentioned ...  
Reply | Threaded
Open this post in threaded view
|

Re: hull() issue? (or is it me?)

Ronaldo
It seems that CGAL does not check for manifoldness of clear disjoint union specially involving polyhedra (I assume that rotate_extrude is expressed  internally as a polyhedron). In some odd cases of differences involving some non-manifold polyhedron, CGAL may even generate a non-waterproof model without an access violation error although it advises for possible non-manifoldness. It is a CGAL bug indeed. 

Em 15 de jun de 2017 19:23, "Parkinbot" <[hidden email]> escreveu:
Thorsten you are right. The following code works as intended,


> module front(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}
> module back(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}

Nevertheless, no CGAL error is reported, which IS an issue. And my
workaround seems to work, despite the non-manifoldness you mentioned ...



--
View this message in context: http://forum.openscad.org/hull-issue-or-is-it-me-tp21696p21704.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

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

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

Re: hull() issue? (or is it me?)

nophead
Hull is an operation where manifoldness is irrelevant. It is an operation on points, not edges or surfaces.

On 16 June 2017 at 14:46, Ronaldo Persiano <[hidden email]> wrote:
It seems that CGAL does not check for manifoldness of clear disjoint union specially involving polyhedra (I assume that rotate_extrude is expressed  internally as a polyhedron). In some odd cases of differences involving some non-manifold polyhedron, CGAL may even generate a non-waterproof model without an access violation error although it advises for possible non-manifoldness. It is a CGAL bug indeed. 

Em 15 de jun de 2017 19:23, "Parkinbot" <[hidden email]> escreveu:
Thorsten you are right. The following code works as intended,


> module front(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}
> module back(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}

Nevertheless, no CGAL error is reported, which IS an issue. And my
workaround seems to work, despite the non-manifoldness you mentioned ...



--
View this message in context: http://forum.openscad.org/hull-issue-or-is-it-me-tp21696p21704.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

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

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



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

Re: hull() issue? (or is it me?)

Ronaldo
True, but the render of original front() hull is just the hull of the large torus without any complaint. 

Em 16 de jun de 2017 10:51, "nop head" <[hidden email]> escreveu:
Hull is an operation where manifoldness is irrelevant. It is an operation on points, not edges or surfaces.

On 16 June 2017 at 14:46, Ronaldo Persiano <[hidden email]> wrote:
It seems that CGAL does not check for manifoldness of clear disjoint union specially involving polyhedra (I assume that rotate_extrude is expressed  internally as a polyhedron). In some odd cases of differences involving some non-manifold polyhedron, CGAL may even generate a non-waterproof model without an access violation error although it advises for possible non-manifoldness. It is a CGAL bug indeed. 

Em 15 de jun de 2017 19:23, "Parkinbot" <[hidden email]> escreveu:
Thorsten you are right. The following code works as intended,


> module front(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}
> module back(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}

Nevertheless, no CGAL error is reported, which IS an issue. And my
workaround seems to work, despite the non-manifoldness you mentioned ...



--
View this message in context: http://forum.openscad.org/hull-issue-or-is-it-me-tp21696p21704.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

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

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



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


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

Re: hull() issue? (or is it me?)

Ronaldo
Sorry, I should have said the hull of the original top().

2017-06-16 11:00 GMT-03:00 Ronaldo Persiano <[hidden email]>:
True, but the render of original front() hull is just the hull of the large torus without any complaint. 

Em 16 de jun de 2017 10:51, "nop head" <[hidden email]> escreveu:
Hull is an operation where manifoldness is irrelevant. It is an operation on points, not edges or surfaces.

On 16 June 2017 at 14:46, Ronaldo Persiano <[hidden email]> wrote:
It seems that CGAL does not check for manifoldness of clear disjoint union specially involving polyhedra (I assume that rotate_extrude is expressed  internally as a polyhedron). In some odd cases of differences involving some non-manifold polyhedron, CGAL may even generate a non-waterproof model without an access violation error although it advises for possible non-manifoldness. It is a CGAL bug indeed. 

Em 15 de jun de 2017 19:23, "Parkinbot" <[hidden email]> escreveu:
Thorsten you are right. The following code works as intended,


> module front(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}
> module back(diameter)  {
> rotate_extrude()translate([diameter/2-62.5,0,0])circle(62.499);}

Nevertheless, no CGAL error is reported, which IS an issue. And my
workaround seems to work, despite the non-manifoldness you mentioned ...



--
View this message in context: http://forum.openscad.org/hull-issue-or-is-it-me-tp21696p21704.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

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

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



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



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

Re: hull() issue? (or is it me?)

Parkinbot
In reply to this post by nophead
nophead wrote
Hull is an operation where manifoldness is irrelevant. It is an operation
on points, not edges or surfaces.
Good point. This explains, why the workaround to also hull top() and bottom() works, while the original version does a union first. Since 3D hull calls into CGAL also the union has to be done in CGAL and fails because of the non-manifolds.
Reply | Threaded
Open this post in threaded view
|

Re: hull() issue? (or is it me?)

kintel
Administrator
In reply to this post by Parkinbot
> On Jun 15, 2017, at 18:23, Parkinbot <[hidden email]> wrote:
>
> Nevertheless, no CGAL error is reported, which IS an issue. And my
> workaround seems to work, despite the non-manifoldness you mentioned …  
>
The CGAL problem is reported - perhaps you were hit by the error-messages-not-being-cached issue?

 -Marius


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

Re: hull() issue? (or is it me?)

Parkinbot
Marius,

the issue was clarified by nophead's explanation that "hull() doesn't care about manifoldness". Therefore it is OK that my "obvious" work-around is in fact a work-around and no error is reported.  
What remains is just a tiny inconsistancy: Logically, a hull-of-a-union should be equivalent to the hull-of-a-union-of-hulls over the same elements. In this specific case is wasn't, because hull-of-a-union triggered a CGAL error while a hull-of-a-union-of-hulls didn't. This confused me.

kintel wrote
The CGAL problem is reported - perhaps you were hit by the error-messages-not-being-cached issue?