# About how to calculate intersection of three planes

5 messages
Open this post in threaded view
|
Report Content as Inappropriate

## About how to calculate intersection of three planes

 This post was updated on . CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: About how to calculate intersection of three planes

 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.htmlyou 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(&(*res)))    {      // pt is the intersection point of the 3 planes    }    else    {      if (const Plane_3* pl = boost::get(&(*res)))      {      }      else      {        const Line_3* l = boost::get(&(*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
Open this post in threaded view
|
Report Content as Inappropriate

## Re: About how to calculate intersection of three planes

 This post was updated on . Hi Sebastien! Thank you for your help. I have now this.     Plane_3 suelo(Point_3(0,0,0), Vector_3(0,0,-1));    // Suelo     Plane_3 principal( Point_3(0,0,0),Vector_3(0,1,0)); // Principal     Plane_3 lateral3(Point_3(0,5,0),Vector_3(-1,0,0)); // Lateral 3     boost::optional> res = CGAL::intersection(suelo, principal, lateral3);     if (res!=boost::none)     {         if (const Plane_3* pl = boost::get(&(*res)))         {         }         else if ( const Line_3* l = boost::get(&(*res)))         {             assert(l!=NULL);         }         else if ( const Point_3* p = boost::get(&(*res)))         {              std::cout<<"el punto es:"<
Open this post in threaded view
|
Report Content as Inappropriate

## Re: About how to calculate intersection of three planes

 This post was updated on . Hi again! I debug this code and I have this result. On the other hand. Then I am wrong to to that? I need all values (x,y,z) of this p = point intersection but I can't see them. Could you tell me how? On the other hand. I have this. Some points like here:     Point_3D p1(0.0, 5.0, 3.0);     Point_3D p2(0.0, 5.0, 0.0);     Point_3D p3(0.0, 0.0, 3.0);     Point_3D p4(0.0, 0.0, 0.0); And I cant access to them like this:     int x01 = p1.x();     int y01 = p1.y();     int z01 = p1.z(); What I do in wrong way?