Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] simple transformation on Mesh_3 vertices

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] simple transformation on Mesh_3 vertices


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] simple transformation on Mesh_3 vertices
  • Date: Mon, 14 Nov 2011 18:06:54 +0100

Hamid G wrote:
On Mon, Nov 14, 2011 at 8:38 AM, Sebastien Loriot (GeometryFactory)
<>
wrote:
What do you want to do precisely?
A simple translation of the points in the mesh?


Yes, just offset them by a fixed (x0, y0, z0).


You can directly hack weighted points in vertices of the underlying
regular triangulation.

Here is an example code, assuming your kernel is K:

typedef C3t3::Triangulation::Weighted_point Weighted_point;
typrdef C3t3::Triangulation::Finite_vertices_iterator Vertices_iterator;

for (Vertices_iterator itv=c3t3.triangulation().finite_vertices_begin(),
itv_end=c3t3.triangulation().finite_vertices_end();
itv!=itv_end;++itv)
{
itv->point()=
Weighted_point(itv->point().point()+K::Vector_3(x0,y0,z0),
itv->point().weight());
}



Related documentation pages are here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Mesh_3_ref/Concept_MeshComplex_3InTriangulation_3.html
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_3_ref/Class_Regular_triangulation_3.html

Note that using offset in this context is confusing because it might
refer to the offset of a solid for example, whereas "translate" is
the perfect word here.

Sebastien.


I am using CGAL to create tetrahedral meshes off of grayscale images.
After mesh is generated I need to translate the vertices to match
coordinate system of
the imaging machine (MRI, CT, ...)

I do this by adding a fixed offset point(x,y,z) to all vertices in a
post-processing step
outside CGAL using the MEDIT file.

I was wondering if this can be done within CGAL/C++ so I don't have to use
Matlab/Python to perform this step.

thanks in advance,
Hamid


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss







Archive powered by MHonArc 2.6.16.

Top of Page