Subject: CGAL users discussion list
List archive
- From: yoapvol <>
- To:
- Subject: [cgal-discuss] Issue with moving a point in 2D periodic Delaunay triangulation
- Date: Sun, 15 Jul 2018 09:05:12 -0700 (MST)
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
- Ironport-phdr: 9a23:RXIHuBMfpXjLo1CaitUl6mtUPXoX/o7sNwtQ0KIMzox0LPX+rarrMEGX3/hxlliBBdydt6oazbKO+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxlJiTanfb9+MAi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0yRD+s7bpkSAXwhSkJNzA37mLZhNF/g61HrxysvAB/zozIbI2JKPZyYr3RcNUHTmRBRMZRUClBD5u8bosIFeUBJfhYr475p1ATqha/BQ6sC/nxyj9QgX/22bY30+skEQ7c3QwgG8gCv2jTrNXwLaofV/2+wqfPzTXGdfxW2DH95ZDOch87uv6DRrZwftTLxUYzEAPFi1OdopHmMTONzukBrmmW4/R6We6xi2MqpRt9riWhy8oikIXEhJwZx1bZ/itj2ok1P8e3SEtjbN6kDpRQsyaaOpNwQs4tWW1ovjw1xaYdtp6/YicG0ogoxxnaa/CfcoiI5AzsVPqJLDtlhX9pZqiziwiy/EWu0OHwS8e53VhQoidHjNXArnUN2AbS6siDRPt95ECh2TOX2gHT7eFLO140lbLcK54l2bMwmZ8Tvl7CHi/ygkn5kKiWdkA89uiy9+vneqnmpoObN4Jslg7+Pb4hmsimDeslMwgORHSU+fmn1L345kD5W7VLjvgukqbDqpzaJMIbprS4AwBPyIoj5Qy/XH+a14ETknADaV5EYxmalJPBOlfUIfm+A+3srU6rlWJ6wPneILrlSsHcKXHdiLDlVbl44k9YjgE0yIYMtNpvFrgdLaerCQfKv9vCA0phal3m86PcENx4k7gmdyeKC66dPrnVtAbRtO0qKuiIIoQSvWSmcqR317vVlXY83GQlU+yxx5JOMSK3G/1nJwOSZn++2o5cQ1dPhRI3SanRsHPHUTNXYC/vDaRgoDcyAoiiAMHIQYX/2bE=
I am constructing a simulation of point particles and using CGAL Delaunay
triangulation to determine the particle neighbors. In my implementation each
vertex has extra info corresponding to (unsigned int) particle index.
When not using periodic boundaries it works.
When I then try to switch to periodic boundaries I have a problem.
The initial Delaunay Triangulation is OK, but when I try to use
move_if_no_collision or move_point I get unexpected behaviour.
Here is the code I'm using:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_traits_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel
Kernel;
typedef CGAL::Periodic_2_Delaunay_triangulation_traits_2<Kernel>
GT;
typedef CGAL::Periodic_2_triangulation_vertex_base_2<GT>
Vb;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned int, GT, Vb>
VbInfo;
typedef CGAL::Periodic_2_triangulation_face_base_2<GT>
Fb;
typedef CGAL::Triangulation_data_structure_2<VbInfo, Fb>
Tds;
typedef CGAL::Periodic_2_Delaunay_triangulation_2<GT, Tds>
Delaunay;
typedef Delaunay::Point
CGAL_Point;
typedef Delaunay::Vertex_handle
Vertex;
Delaunay Dtriangulation;
Dtriangulation.insert(particlesNormTriangData.begin(),
particlesNormTriangData.end());
generateDelaunayVerticesHandlesVector(); //This function generates the
vector VerticesHandlesVector that holds handles to vertices
Vertex v=VerticesHandlesVector[particle->get_Index()];
//Here are two ways I tried to change vertex position in my code:
Vertex test_v = Dtriangulation.move_if_no_collision(v, newPosition);
//alternative option:
Dtriangulation.move_point(v, newPosition);
When I apply one of these functions to a vertex, it changes the info of the
vertex to be 3435973836 (seems to be always the same value).
Specifically when using move_if_no_collision function, it returns a
different vertex handle which is supposed to indicate that the new position
overlaps with an existing vertex. This is however not the case. {I checked
this for example by using the nearest_vertex() function before applying the
move (with the new position as input). The nearest vertex to the new
position is the vertex that's being moved (since it's a small
displacement).}
Here is the working code for the non periodic case:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel
Kernel;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned int, Kernel>
Vb;
typedef CGAL::Triangulation_data_structure_2<Vb>
Tds;
typedef CGAL::Delaunay_triangulation_2<Kernel, Tds>
Delaunay;
typedef Kernel::Point_2
CGAL_Point;
typedef Delaunay::Vertex_handle
Vertex;
Delaunay Dtriangulation;
Dtriangulation.insert(particlesNormTriangData.begin(),
particlesNormTriangData.end());
generateDelaunayVerticesHandlesVector(); //This function generates the
vector VerticesHandlesVector that holds handles to vertices
Vertex test_v = Dtriangulation.move_if_no_collision(v, newPosition);
Can any one help me figure out what's wrong?
--
Sent from: http://cgal-discuss.949826.n4.nabble.com/
- [cgal-discuss] Issue with moving a point in 2D periodic Delaunay triangulation, yoapvol, 07/15/2018
- Re: [cgal-discuss] Issue with moving a point in 2D periodic Delaunay triangulation, yoapvol, 07/15/2018
- Re: [cgal-discuss] Issue with moving a point in 2D periodic Delaunay triangulation, yoapvol, 07/20/2018
Archive powered by MHonArc 2.6.18.