Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] From Plane_3 to Surface_3

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] From Plane_3 to Surface_3


Chronological Thread 
  • From: Samer Afach <>
  • To:
  • Subject: Re: [cgal-discuss] From Plane_3 to Surface_3
  • Date: Wed, 24 Mar 2010 10:51:51 +0100

But I've seen in the envelope program that it already supports triangles
just like it supports planes with two different examples with similar
outputs, isn't this the case? what's the difference between the
implementation of triangles or planes equations? and I went through the
functions in the reference manual in that class and couldn't find the
function I need. Could you please tell me what's the name of that
function if you know it?

Thank you,
Samer


wrote:
> One way to do it is to triangulate the polyhedron facets (in case they
> are not triangles to start with) and then compute the envelope of all
> triangles. Consult the manual for further information. There are also
> examples you can use as a starting point.
>
> Quoting "Samer Afach"
> <>:
>
>> Exactly! That's what I'm looking for actually! But could you please tell
>> me how to implement it? does the envelope class have such a function?
>>
>> Thank you,
>> Samer
>>
>>
>>
>> wrote:
>>> If you are looking for a function that accepts a polyhedron and a
>>> point in the plane and returns the point on the lower envelope of the
>>> polyhedron, the vertical projection of which coincides with the input
>>> point, then you can implement it using the existing functionality.
>>> Otherwise, I don't understand your question.
>>>
>>> Quoting "Samer Afach"
>>> <>:
>>>
>>>> Thank you for your reply.
>>>>
>>>> Actually I'm concerned now before this with the question whether the
>>>> envelope algorithm offers the envelope as a function and not surfaces,
>>>> because I couldn't find a single function in the corresponding class
>>>> that does that. Does it do that? I mean I would like to give it a
>>>> polyhedron, and on the other side using minimum and maximum get the
>>>> envelopes as functions of x and y, is that possible?
>>>>
>>>> I'd appreciate any efforts so much,
>>>> Thank you,
>>>> Samer
>>>>
>>>>
>>>>
>>>> wrote:
>>>>> You need to use an exact-predicate and exact-construction kernel. If
>>>>> you do that and the problem still occurs, please send the entire
>>>>> (small) program that reproduces the problem.
>>>>>
>>>>> Quoting
>>>>> :
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I eventually have found that the planes are being taken in the
>>>>>> right way
>>>>>> by dereferencing the iterator, but the program is failing in giving
>>>>>> the
>>>>>> right envelope, and giving an unexplainable exception, I started to
>>>>>> believe that the algorithm has a problem... here's the part of the
>>>>>> code,
>>>>>> where P is a closed polyhedron object
>>>>>>
>>>>>>
>>>>>> for(plane_it = P.planes_begin(); plane_it !=
>>>>>> P.planes_end();++plane_it)
>>>>>> {
>>>>>> planes.push_back(Surface_3(*plane_it));
>>>>>> cout<<*plane_it<<endl;
>>>>>> }
>>>>>>
>>>>>> /*
>>>>>> //this is a part where the example inserted the points
>>>>>> planes.push_back (Surface_3(Plane_3(-1, 0, 1, 0)));
>>>>>> planes.push_back (Surface_3(Plane_3(0, 1 , 1, 0)));
>>>>>> planes.push_back (Surface_3(Plane_3(1, 0, 1, 0)));
>>>>>> */
>>>>>>
>>>>>> // Compute and print the minimization diagram.
>>>>>> Envelope_diagram_2 min_diag;
>>>>>>
>>>>>> CGAL::lower_envelope_3 (planes.begin(), planes.end(), min_diag);
>>>>>>
>>>>>> std::cout << std::endl << "The minimization diagram:" <<
>>>>>> std::endl;
>>>>>> print_diagram (min_diag);
>>>>>>
>>>>>> // Compute and print the maximization diagram.
>>>>>> Envelope_diagram_2 max_diag;
>>>>>>
>>>>>> CGAL::upper_envelope_3 (planes.begin(), planes.end(), max_diag);
>>>>>>
>>>>>> std::cout << std::endl << "The maximization diagram:" <<
>>>>>> std::endl;
>>>>>> print_diagram (max_diag);
>>>>>>
>>>>>> The polyhedron I'm using has like 30 facets or more, and is
>>>>>> closed and
>>>>>> follow the Euler characteristic, and I could view it using
>>>>>> Geomview. So
>>>>>> I'm very confused and don't know where the error could be. The
>>>>>> exception
>>>>>> differs everytime because I'm every time generating a new polyhedron
>>>>>> that
>>>>>> fulfills the conditions mention. here's the error I'm getting in
>>>>>> Terminal:
>>>>>>
>>>>>> terminate called after throwing an instance of
>>>>>> 'CGAL::Precondition_exception'
>>>>>> what(): CGAL ERROR: precondition violation!
>>>>>> Expr: cv.has_left()
>>>>>> File: /usr/local/include/CGAL/Arr_linear_traits_2.h
>>>>>> Line: 682
>>>>>> Aborted
>>>>>>
>>>>>> and here's another one too:
>>>>>> terminate called after throwing an instance of
>>>>>> 'CGAL::Precondition_exception'
>>>>>> what(): CGAL ERROR: precondition violation!
>>>>>> Expr: f == f2
>>>>>> File:
>>>>>> /usr/local/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h
>>>>>>
>>>>>> Line: 2639
>>>>>> Explanation: The two halfedges must share the same incident face.
>>>>>> Aborted
>>>>>>
>>>>>> This last error I can't understand, what does the envelope thing
>>>>>> have to
>>>>>> do with the halfedges? I'm giving the program plane equations and
>>>>>> it has
>>>>>> nothing to do with my polyhedron.
>>>>>>
>>>>>> Any effort is highly appreciated,
>>>>>>
>>>>>> Thank you,
>>>>>> Samer Afach
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hello programmers,
>>>>>>>
>>>>>>> I have a question since I'm not a professional C++ programmer. I'm
>>>>>>> trying to apply the 3D envelope example 32.3.3 in
>>>>>>>
>>>>>>> http://www.cgal.org/Manual/last/doc_html/cgal_manual/Envelope_3/Chapter_main.html
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> but I'm taking the planes from a polyhedron, and I have them in the
>>>>>>> type
>>>>>>> Plane_3 through the iterator Polyhedron::begin() to end(). The
>>>>>>> example
>>>>>>> takes them in the form Surface_3(Plane_3()), how can I do this
>>>>>>> transformation? I tried to use std::transform for this but I
>>>>>>> failed.
>>>>>>> The example provides it using the 4 coefficients of a plane, I can
>>>>>>> see
>>>>>>> these coefficients of my Plane_3 object on a cout stream, but I
>>>>>>> can't
>>>>>>> extract them alone one by one.
>>>>>>>
>>>>>>> Could you please either tell me the correct transformation
>>>>>>> method for
>>>>>>> this or tell me how to extract the coefficients from my Plane_3
>>>>>>> object?
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Samer Afach
>>>>>>>
>>>>>>> --
>>>>>>> You are currently subscribed to cgal-discuss.
>>>>>>> To unsubscribe or access the archives, go to
>>>>>>> https://lists-sop.inria.fr/wws/info/cgal-discuss
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> You are currently subscribed to cgal-discuss.
>>>>>> To unsubscribe or access the archives, go to
>>>>>> https://lists-sop.inria.fr/wws/info/cgal-discuss
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> You are currently subscribed to cgal-discuss.
>>>> To unsubscribe or access the archives, go to
>>>> https://lists-sop.inria.fr/wws/info/cgal-discuss
>>>>
>>>
>>>
>>>
>>
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://lists-sop.inria.fr/wws/info/cgal-discuss
>>
>
>
>




Archive powered by MHonArc 2.6.16.

Top of Page