cgal

CGAL, Cropped voronoi diagram confined in a rectangle

你。 提交于 2019-12-03 04:58:12
I'm using CGAL with Qt to draw Voronoi diagram. I used CGAL::Voronoi_diagram_2<DT,AT,AP> since I need the faces. This is the example code: for(Face_iterator f = VD.faces_begin(); f != VD.faces_end(); f++) { Ccb_halfedge_circulator ec_start = (f)->ccb(); Ccb_halfedge_circulator ec = ec_start; do { if (!ec->has_source()) { } else QpolyF << QPointF(((Halfedge_handle)ec)->source()->point().x(), ((Halfedge_handle)ec)->source()->point().y()); } while ( ++ec != ec_start ); VectPolygon.push_back(QpolyF); QpolyF.clear();} I need to clip the rays that has source or target in infinity. If I use the

Compute intersection area of two polygons with cgal

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Given the vertices of two convex polygons, what is the simplest way of computing the area of their intersection using cgal? 回答1: Because you are working with convex polygons, there is no need to worry about holes. So the simplest code that I can think of is basically construct the polygons, call intersection, loop over intersection and total up the area:: #include <iostream> #include <CGAL/Simple_cartesian.h> #include <CGAL/Polygon_2.h> #include <CGAL/Polygon_with_holes_2.h> #include <CGAL/Boolean_set_operations_2.h> #include <CGAL/Polygon_2

CGAL: How can I successfully compile and link CGAL examples (on Mac OS X 10.9 Mavericks)

别来无恙 提交于 2019-12-02 17:11:32
问题 I found the CGAL examples not to compile under Mac OS X 10.9 (Mavericks). You can compile the main CGAL 4.3 library successfully and also link with it, but when using certain types of the library, I am receiving errors as shown below. Specifically, I was interested in using the example Surface_reconstruction_points_3 , which I tried to build initially, receiving this error: Linking CXX executable poisson_reconstruction Undefined symbols for architecture x86_64: "CGAL::File_writer_OFF::write

CGAL: How can I successfully compile and link CGAL examples (on Mac OS X 10.9 Mavericks)

筅森魡賤 提交于 2019-12-02 11:43:52
I found the CGAL examples not to compile under Mac OS X 10.9 (Mavericks). You can compile the main CGAL 4.3 library successfully and also link with it, but when using certain types of the library, I am receiving errors as shown below. Specifically, I was interested in using the example Surface_reconstruction_points_3 , which I tried to build initially, receiving this error: Linking CXX executable poisson_reconstruction Undefined symbols for architecture x86_64: "CGAL::File_writer_OFF::write_header(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, unsigned long, unsigned long,

Customizing CGAL Kernel with my own Point class

陌路散爱 提交于 2019-12-02 03:24:11
I would like to use a custom Point class with the CGAL constrained delaunay triangulation. However, with the following MyPoint class (which should behave the exact same as a CGAL::Point_2 no?) I get segmentation faults. It works perfectly if I set the Point_2 typedef inside MyKernel to CGAL::Exact_predicates_inexact_constructions_kernel::Point_2. What am I doing wrong? template<class P> struct MyPoint : public P { MyPoint() : P() {} MyPoint(const MyPoint& p) : P(p) {} MyPoint( int x, int y) : P(x,y) {} MyPoint( double x, double y) : P(x,y) {} }; struct MyKernel : CGAL::Exact_predicates_inexact

Confusion on Delaunay Triangulation and Largest inscribed circle

流过昼夜 提交于 2019-12-01 11:01:20
I need to find a largest inscribed circle of a convex polygon, I've searched many sites and I get that this can be done by using Delaunay triangulation. I found a thread in CGAL discussion with an algorithm using CGAL: You can compute this easily with CGAL: First, compute the Delaunay triangulation of the points. Then, iterate on all the finite faces of the triangulation. For each finite face f compute its circumcenter c locate c in the triangulation (to speed up things, you can give one vertex of f as starting hint for the point location) if the face returned by locate(c,hint) is finite, then

Confusion on Delaunay Triangulation and Largest inscribed circle

孤街浪徒 提交于 2019-12-01 07:49:02
问题 I need to find a largest inscribed circle of a convex polygon, I've searched many sites and I get that this can be done by using Delaunay triangulation. I found a thread in CGAL discussion with an algorithm using CGAL: You can compute this easily with CGAL: First, compute the Delaunay triangulation of the points. Then, iterate on all the finite faces of the triangulation. For each finite face f compute its circumcenter c locate c in the triangulation (to speed up things, you can give one

Geodesic computation on triangle meshes?

泪湿孤枕 提交于 2019-12-01 04:02:55
I am trying to find the distance between two points on a triangulated surface (geodesic distance). It looks like a basic operation and is not trivial. So I am wondering if there are any libraries that do this? My google fo failed, so I would greatly appreciate any pointers. (I am aware of CGAL, scipy.spatial, but I couldn't find anything in the docs, let me know if I missed something there) There are many implementation for computing geodesic distance on triangle mesh. Some are approximate and some are exact. 1.Fast Marching method. This method is approximate and in practice the average error

Geodesic computation on triangle meshes?

老子叫甜甜 提交于 2019-12-01 01:12:21
问题 I am trying to find the distance between two points on a triangulated surface (geodesic distance). It looks like a basic operation and is not trivial. So I am wondering if there are any libraries that do this? My google fo failed, so I would greatly appreciate any pointers. (I am aware of CGAL, scipy.spatial, but I couldn't find anything in the docs, let me know if I missed something there) 回答1: There are many implementation for computing geodesic distance on triangle mesh. Some are

Compiling a basic CGAL program in C++ on Mac OS X 10.7.2

陌路散爱 提交于 2019-12-01 00:28:23
When I tried to compile Voronoi_Diagram_2 example I am getting this output: singhg@~/Programming/examples/Voronoi_diagram_2 $ cmake -DCGAL_DIR=/opt/local/lib/cmake/ CMake Error at CMakeLists.txt:20 (include): include could not find load file: /opt/local//opt/local/lib/cmake/UseCGAL.cmake CMake Error at CMakeLists.txt:22 (include): include could not find load file: CGAL_CreateSingleSourceCGALProgram CMake Error at CMakeLists.txt:26 (create_single_source_cgal_program): Unknown CMake command "create_single_source_cgal_program". -- Configuring incomplete, errors occurred! Please help! Make CGAL3.9