Subject: CGAL users discussion list
List archive
- From: Benjamin McWhorter <>
- To:
- Subject: Re: [cgal-discuss] Problems with Nef_Polyhedron
- Date: Wed, 15 Jun 2011 11:23:38 -0400
Hi Sebastian,
Sorry if I wasn't clear on my problem. I have attached my original input
.obj files and the resulting converted .off files.
The problem that I am having is this, while I get an intersection and a
resulting join that is valid between 2 of the 3, CGAL does not find a valid
and simple join between the result of that join and the other nef_polyhedron
(hopefully thats clear). My process for performing the join is like this:
convert .obj to .off
create nef_polyhedron from .off using the off_to_nef3 constructor.
test if there is an intersection between the two nef_polyhedron
if there is test if the result of a join between the two would give a simple
and valid result
if so, join them.
I then convert back to polyhedron and write the output to a file using
print_polyhedron_wavefront
The problem is that running the program on the attached 3 inputs gives 2
resulting nef_polyhedron. If I run the program again, (using the output from
the first run as input), then it will join the two polyhedron (after
discarding the facets you mentioned when constructing the Nef_polyhedron).
So I basically have two questions -- why is it that these nef_polyhedron do
not get joined in the first place?
Second -- why is CGAL's output (from print_polyhedron_wavefront) is giving me
Polyhedron with degeneracies, when I do not get that problem from the
attached input -- only CGAL produced input.
I hope that all makes sense and as always I very much appreciate your help.
Thanks,
Ben
Attachment:
3.obj
Description: Binary data
Attachment:
2.obj
Description: Binary data
Attachment:
1.obj
Description: Binary data
Attachment:
output5.OFF
Description: Binary data
Attachment:
output4.OFF
Description: Binary data
Attachment:
output3.OFF
Description: Binary data
On Jun 15, 2011, at 3:36 AM, Sebastien Loriot (GeometryFactory) wrote:
> If you are using the construction from polyhedron,
> nef assumes that the input is a valid polyhedron.
> Your input output4.OFF contains facets made only of collinear
> points.
>
> The following code detect these facets:
>
> for (Polyhedron::Facet_iterator f=poly.facets_begin();
> f!=poly.facets_end();++f)
> {
> Kernel::Point_3 pt1,pt2,pt3;
> pt1=f->halfedge()->vertex()->point();
> pt2=f->halfedge()->next()->vertex()->point();
> Polyhedron::Halfedge_handle h=f->halfedge()->next();
> do{
> pt3=f->halfedge()->next()->next()->vertex()->point();
> if (! CGAL::collinear(pt1,pt2,pt3) ) break;
> h=h->next();
> }
> while(h!=f->halfedge());
> if( h==f->halfedge() )
> std::cerr<<"Error degenerate facet" << std::endl;
> }
>
> In order to remove this kind of degeneracies, you can use the
> function CGAL::OFF_to_nef_3 documented here:
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Nef_3_ref/Function_OFF_to_nef_3.html
>
> Using this function I was able to make the union of your
> inputs with CGAL-3.8.
>
> Sebastien.
>
>
> Benjamin McWhorter wrote:
>> Hello All,
>> I have been having some trouble correctly joining Nef_Polyhedron. I have
>> attached some .off files that should recreate the error. I have been
>> trying to join a large number of Polyhedron using CGAL and ran into many
>> problems along the way. I found that I cannot simply join the simple and
>> valid nef_polyhedron and expect a simple and valid result. The only way I
>> was able to accurately join them was by testing if the result of the join
>> was simple and valid after checking if there was an intersection and if it
>> passed all three tests, then perform the join.
>> It seems that the order in which I joined them had a lot to do with it
>> working out.
>> Anyhow, on to my actual issue. I ran the join and expected the following
>> two polyhedron to be joined, but they were not. After the join I convert
>> back to Polyhedron and then use the print_polyhedron_wavefront function to
>> write the output in an .obj file.
>> These .OFF files that I attached are simply print_polyhedron_wavefront
>> .objs that I have converted to .OFF. These two were not joined during
>> execution, however, when I ran the program again with these two as input,
>> I get the following (sorry if I put too much). I am wondering why CGAL is
>> discarding facets that were created by the print_polyhedron_wavefront
>> function and 2, why these two were not joined in the first place. Any
>> help is much appreciated.
>> Thanks,
>> Ben
>> ------------------------------------------------------------------------
>> output4.OFF
>> Conversion from vertex cycle to Nef_polyhedron_3 was not successful. Error
>> history: -> function parameter 'normal' is NULL_VECTOR (this can be a
>> symptom of an error). Now, direction of projection is 'x'. -> Same vertex
>> appears multiple in cycle. Now, direction of projection is 'y'. -> Same
>> vertex appears multiple in cycle. Now, direction of projection is 'z'. ->
>> Same vertex appears multiple in cycle. Finally, empty Nef_polyhedron_3 was
>> constructed.
>> Hence, discard input facet 14 (enumerated beginning with 1). Check
>> semantics!
>> Conversion from vertex cycle to Nef_polyhedron_3 was not successful. Error
>> history: -> function parameter 'normal' is NULL_VECTOR (this can be a
>> symptom of an error). Now, direction of projection is 'x'. -> Same vertex
>> appears multiple in cycle. Now, direction of projection is 'y'. -> Same
>> vertex appears multiple in cycle. Now, direction of projection is 'z'. ->
>> Same vertex appears multiple in cycle. Finally, empty Nef_polyhedron_3 was
>> constructed.
>> Hence, discard input facet 21 (enumerated beginning with 1). Check
>> semantics!
>> Conversion from vertex cycle to Nef_polyhedron_3 was not successful. Error
>> history: -> function parameter 'normal' is NULL_VECTOR (this can be a
>> symptom of an error). Now, direction of projection is 'x'. Now, direction
>> of projection is 'y'. Now, direction of projection is 'z'. -> Different
>> vertices are projected to same location! Finally, empty Nef_polyhedron_3
>> was constructed.
>> Hence, discard input facet 29 (enumerated beginning with 1). Check
>> semantics!
>> Conversion from vertex cycle to Nef_polyhedron_3 was not successful. Error
>> history: -> function parameter 'normal' is NULL_VECTOR (this can be a
>> symptom of an error). Now, direction of projection is 'x'. -> Same vertex
>> appears multiple in cycle. Now, direction of projection is 'y'. -> Same
>> vertex appears multiple in cycle. Now, direction of projection is 'z'. ->
>> Different vertices are projected to same location! Finally, empty
>> Nef_polyhedron_3 was constructed.
>> Hence, discard input facet 30 (enumerated beginning with 1). Check
>> semantics!
>> Conversion from vertex cycle to Nef_polyhedron_3 was not successful. Error
>> history: -> function parameter 'normal' is NULL_VECTOR (this can be a
>> symptom of an error). Now, direction of projection is 'x'. -> Same vertex
>> appears multiple in cycle. Now, direction of projection is 'y'. -> Same
>> vertex appears multiple in cycle. Now, direction of projection is 'z'. ->
>> Different vertices are projected to same location! Finally, empty
>> Nef_polyhedron_3 was constructed.
>> Hence, discard input facet 51 (enumerated beginning with 1). Check
>> semantics!
>> output4.OFF is simple
>> output4.OFF is valid
>> output3.OFF
>> output3.OFF is simple
>> output3.OFF is valid
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
- [cgal-discuss] Problems with Nef_Polyhedron, Benjamin McWhorter, 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Sebastien Loriot (GeometryFactory), 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Benjamin McWhorter, 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Sebastien Loriot (GeometryFactory), 06/15/2011
- Message not available
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Sebastien Loriot (GeometryFactory), 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Ben McWhorter, 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Sebastien Loriot (GeometryFactory), 06/16/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Benjamin McWhorter, 06/21/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Ben McWhorter, 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Sebastien Loriot (GeometryFactory), 06/15/2011
- Message not available
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Sebastien Loriot (GeometryFactory), 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Benjamin McWhorter, 06/15/2011
- Re: [cgal-discuss] Problems with Nef_Polyhedron, Sebastien Loriot (GeometryFactory), 06/15/2011
Archive powered by MHonArc 2.6.16.