Subject: CGAL users discussion list
List archive
- From: "zengming" <>
- To: "" <>
- Subject: Re: Re: Re: [cgal-discuss] how to output a point's coordinate
- Date: Fri, 6 Mar 2009 21:24:30 +0800
Hi Pedro,
Thank you very much. You are so nice!
![]() 2009-03-06
zengming
发件人:
Pedro_Machado_Manh�es_de_Castro
发送时间: 2009-03-06 21:20:21
收件人:
抄送:
主题: Re: Re: Re: [cgal-discuss]
how to output a point's coordinate
Hi Zengming,
Those are the "ugly" output of the root_of_2 function, you probably would prefer to output like that: #include <CGAL/Exact_spherical_kernel_3.h> #include <CGAL/Spherical_kernel_intersections.h> #include <CGAL/Circular_arc_point_3.h> typedef CGAL::Exact_spherical_kernel_3 Spherical_k; typedef CGAL::Point_3<Spherical_k> Point_3; typedef CGAL::Sphere_3<Spherical_k> Sphere_3; typedef std::pair< CGAL::Circular_arc_point_3<Spherical_k>, unsigned> Point_pair; int main() { Sphere_3 s1 = Sphere_3(Point_3(1.0,0.0,0.0), 1.0); Sphere_3 s2 = Sphere_3(Point_3(0.0,1.0,0.0), 1.0); Sphere_3 s3 = Sphere_3(Point_3(0.0,0.0,1.0), 1.0); std::vector< CGAL::Object > intersecs; CGAL::intersection(s1, s2, s3, std::back_inserter(intersecs)); std::cout<<intersecs.size()<<std::endl; const Point_pair *p[2]; for(int i=0; i<intersecs.size(); ++i) { if( p[i] = CGAL::object_cast<Point_pair>(&intersecs[i]) ) { std::cout<<p[i]->second<<std::endl; //std::cout<<(p[i]->first).x()<<" "<<(p[i]->first).y()<<" "<<(p[i]->first).z()<<" "<<std::endl; double x = CGAL_NTS to_double((p[i]->first).x()); double y = CGAL_NTS to_double((p[i]->first).y()); double z = CGAL_NTS to_double((p[i]->first).z()); std::cout << x << " " << y << " " << z << std::endl; } } return 0; } However when you convert to double you lose the accuracy, be aware of that. Best regards, Pedro On Fri, Mar 6, 2009 at 2:00 PM, zengming <>
wrote:
|
- [cgal-discuss] how to output a point's coordinate, zengming, 03/06/2009
- Re: [cgal-discuss] how to output a point's coordinate, Samuel Hornus, 03/06/2009
- Re: Re: [cgal-discuss] how to output a point's coordinate, zengming, 03/06/2009
- Re: Re: [cgal-discuss] how to output a point's coordinate, Pedro Machado Manhães de Castro, 03/06/2009
- Re: Re: Re: [cgal-discuss] how to output a point's coordinate, zengming, 03/06/2009
- Re: Re: Re: [cgal-discuss] how to output a point's coordinate, zengming, 03/06/2009
- Re: Re: Re: [cgal-discuss] how to output a point's coordinate, Pedro Machado Manhães de Castro, 03/06/2009
- Re: Re: Re: [cgal-discuss] how to output a point's coordinate, zengming, 03/06/2009
- Re: Re: Re: [cgal-discuss] how to output a point's coordinate, Pedro Machado Manhães de Castro, 03/06/2009
- [cgal-discuss] How to rotate Segment_2, naresh, 03/06/2009
- [cgal-discuss] Sweep Line Running slow, naresh, 03/07/2009
- Re: [cgal-discuss] Sweep Line Running slow, Ophir Setter, 03/07/2009
- [cgal-discuss] Point Rotation problem or Bug ?, naresh, 03/12/2009
- [cgal-discuss] How to find center of mass and principal inertial axis of 3D model?, Samay Kumar, 03/13/2009
- Re: [cgal-discuss] How to find center of mass and principal inertial axis of 3D model?, naresh, 03/13/2009
- Re: [cgal-discuss] How to find center of mass and principal inertial, Ashwin N, 03/14/2009
- Re: [cgal-discuss] How to find center of mass and principal inertial, Pierre Alliez, 03/25/2009
- Re: [cgal-discuss] Point Rotation problem or Bug ?, Ashwin N, 03/14/2009
- [cgal-discuss] Point Rotation problem or Bug ?, naresh, 03/12/2009
- [cgal-discuss] Alpaha shape question, naresh, 03/18/2009
- Re: [cgal-discuss] Sweep Line Running slow, Ophir Setter, 03/07/2009
- [cgal-discuss] Sweep Line Running slow, naresh, 03/07/2009
- Re: Re: [cgal-discuss] how to output a point's coordinate, Pedro Machado Manhães de Castro, 03/06/2009
- Re: Re: [cgal-discuss] how to output a point's coordinate, zengming, 03/06/2009
- Re: [cgal-discuss] how to output a point's coordinate, Samuel Hornus, 03/06/2009
Archive powered by MHonArc 2.6.16.