Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] About how to calculate intersection of three planes

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] About how to calculate intersection of three planes


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] About how to calculate intersection of three planes
  • Date: Fri, 17 Feb 2017 05:17:54 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:NU6Ecx0MNAh8wYmdsmDT+DRfVm0co7zxezQtwd8ZsegTKPad9pjvdHbS+e9qxAeQG96KtrQc1qGJ6eigATVGusnR9ihaMdRlbFwst4Y/p0QYGsmLCEn2frbBThcRO4B8bmJj5GyxKkNPGczzNBX4q3y26iMOSF2kbVImbre9J4jJks7i1/yu44aBJEJTlT+laPVzKg+3pEPfrI4NkI56I+EwzBXO5XBHcuATyWJzLk+IhEXA4ZK785dntihRoPk87NVoUKPgfq1+Q6YLIi4hNjV/38DhvALfTAaJrl8bSGQRjlIILAXC6RzmRIbfuyDmsfBsmWPSadbySqo1Xijk6qNDRxrhiSNBPDk8pjKEwvdshb5W9Ury7yd0xJTZNdmY
  • Organization: GeometryFactory

On 02/10/2017 03:46 PM, Iván otero wrote:
Hi Sebastien!

Thank you for your help.

I have now this.

Plane_3suelo(Point_3(0,0,0),Vector_3(0,0,-1));//Suelo

Plane_3principal(Point_3(0,0,0),Vector_3(0,1,0));//Principal

Plane_3lateral3(Point_3(0,5,0),Vector_3(-1,0,0));//Lateral3


boost::optional<boost::variant<Point_3,Line_3,Plane_3>>res=CGAL::intersection(suelo,principal,lateral3);


if(res!=boost::none)

{

if(constPlane_3*pl=boost::get<Plane_3>(&(*res)))

{


}

elseif(constLine_3*l=boost::get<Line_3>(&(*res)))

{


assert(l!=NULL);

}

elseif(constPoint_3*p=boost::get<Point_3>(&(*res)))

{


std::cout<<"elpuntoes:"<<p<<std::endl;


}


}


*What do you think about store this points an after access to this
structure?*
*
*
*In my case I want to iterate with all surface of one space and get this
points.*
*
*
Some other beginner question.

How to show or view values of vector and plane?

You can access the plane coefficients, see
http://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Plane__3.html



I use debugger of Qt and try to view this information but I cant see
them like you can see in this image (view cgal_001.png)

But p i can't see it.

p is a pointer, so you need to print *p.


Sebastien.

Could you help me?

*
*
*Thanks and best regards.*

2017-02-10 8:05 GMT+01:00 Sebastien Loriot (GeometryFactory)
<

<mailto:>>:

On 02/09/2017 05:26 PM, Iván otero wrote:


Could you recomend any post link about cgal and about how to
calculate
intersection of 3 planes.
In my case I have normal vector of plane and centroide.

I need to know the know how of cgal to calculate this point
I know mathematics to calculate it but I would like to get this
point
with cgal.

On the other hand If I have a group of data with normal vector and
centroide that are part of a space.

I define space like a bedroom.
I mean a group of six vectors with its six centroids.

Then I would like to calculate all the eight edges of this space.

Thanks and best regards


There is a dedicated intersection function:

http://doc.cgal.org/latest/Kernel_23/group__intersection__linear__grp.html

<http://doc.cgal.org/latest/Kernel_23/group__intersection__linear__grp.html>

you can do something like this:

typedef CGAL:Exact_predicates_exact_construtions_kernel K;
typedef K::Plane_3 Plane_3;
typedef K::Point_3 Point_3;
typedef K::Vector_3 Vector_3;


Plane_3 p1(Vector_3(x,y,x), Point_3(a,b,c));
Plane_3 p2(.....);
Plane_3 p3(.....);


boost::optional< boost::variant< Point_3, Line_3, Plane_3 > > res =
CGAL::intersection(p1, p2, p3);

if (res!=boost::none)
{
if (const Point_3* pt = boost::get<Point_3>(&(*res)))
{
// pt is the intersection point of the 3 planes
}
else
{
if (const Plane_3* pl = boost::get<Plane_3>(&(*res)))
{
}
else
{
const Line_3* l = boost::get<Line_3>(&(*res));
assert(l!=NULL);
}
}
}

Sebastien.



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
<https://sympa.inria.fr/sympa/info/cgal-discuss>





--
Iván Otero González
Skype: ivanoterouvigo
Tlf. Lab. 222: 813499
Tlf. Lab. 218: 813998
Research Line : ARCHITECTURE AND BUILDING

GeoTech

/Applied Geotechnologies Research Group | Geotech__/

Universidade de Vigo

E.E. Minas

36310 Vigo (Spain)






Archive powered by MHonArc 2.6.18.

Top of Page