Subject: CGAL users discussion list
List archive
- From: Rasmus Bach Nielsen <>
- To:
- Subject: Re: [cgal-discuss] Moving points in Mesh3
- Date: Wed, 05 Jan 2011 16:26:00 +0100
Hi Sebastien, Thanks for the quick reply. I use a wrapper-class Mesh which contains the following function: void Mesh::move_vertex(C3t3::Vertex_handle v, Vector u)
{
Point_3 location(v->point().x() + u[0], v->point().y() + u[1], v->point().z() + u[2]);
c3t3.triangulation().move(v, location);
}
this is called from main using: for (C3t3::Facet_iterator iter = m.facets_begin();iter != m.facets_end(); ++iter) { C3t3::Cell_handle c1 = iter->first; for(int i = 0; i < 4; i++) { C3t3::Vertex_handle v = c1->vertex(i); if(!m.is_infinite(v) && (v->in_dimension() == 2)) { Vector_3 current_pos = v->point() - Point_3(CGAL::ORIGIN); Vector u(3); u[0] = current_pos.x(); u[1] = current_pos.y(); u[2] = current_pos.z(); cout << "Vertex dimension: " << v->in_dimension() << endl; cout << "Vertex position: " << v->point().x() << ", " << v->point().y() << ", " << v->point().z() << endl; cout << "Displacement vector: " << u[0] << ", " << u[1] << ", " << u[2] << endl; m.move_vertex(v, u); moved_vertex = true; cout << "Vertex position after move: " << v->point() << endl; break; } } if(moved_vertex) break; } The expected result is that 1 vertex on the surface of the mesh has its distance to CGAL::ORIGIN doubled The actual result seems to be a hole in the mesh. My suspicion is that I am somehow turning some tetrahedron inside out or something of the sort. The breaks are there because the Facet_iterator is invalidated by the move (or rather: I get an exception indicating something of that sort). Regards Rasmus On 05-01-2011 16:02, Sebastien Loriot (GeometryFactory) wrote: Rasmus Bach Nielsen wrote: |
- [cgal-discuss] Moving points in Mesh3, Rasmus Bach Nielsen, 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Sebastien Loriot (GeometryFactory), 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Rasmus Bach Nielsen, 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Sebastien Loriot (GeometryFactory), 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Rasmus Bach Nielsen, 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Laurent Rineau (GeometryFactory), 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Rasmus Bach Nielsen, 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Sebastien Loriot (GeometryFactory), 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Rasmus Bach Nielsen, 01/05/2011
- Re: [cgal-discuss] Moving points in Mesh3, Sebastien Loriot (GeometryFactory), 01/05/2011
Archive powered by MHonArc 2.6.16.