Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] What does negative CGAL::Polygon_mesh_processing::volume mean?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] What does negative CGAL::Polygon_mesh_processing::volume mean?


Chronological Thread 
  • From: Iasonm <>
  • To:
  • Subject: Re: [cgal-discuss] What does negative CGAL::Polygon_mesh_processing::volume mean?
  • Date: Wed, 27 Sep 2017 02:51:00 -0700 (MST)
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
  • Ironport-phdr: 9a23:PDFl6xQiujrjo3XZRygRn5IE1tpsv+yvbD5Q0YIujvd0So/mwa67YRaN2/xhgRfzUJnB7Loc0qyN7PCmBDRIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnZBUin4YAF6L+CwFo/JhNmszMiz/YfSakNGnmmTe7R3eTS/tgLXs4FCmJJ+LaI8zBbhrX5BeuAQzmRtcwHA1y3g79u9qcYwux9bvOgsopZN

I found the following:
volume(const TriangleMesh& tmesh, const CGAL_PMP_NP_CLASS& np)
{
......

typename GetGeomTraits<TriangleMesh, CGAL_PMP_NP_CLASS>::type::FT volume =
0.;
typename CGAL::Kernel_traits<typename property_map_value<TriangleMesh,
CGAL::vertex_point_t>::type>::Kernel::Compute_volume_3 cv3;

* BOOST_FOREACH(face_descriptor f, faces(tmesh))
{
volume += cv3(origin,
get(vpm, target(halfedge(f, tmesh), tmesh)),
get(vpm, target(next(halfedge(f, tmesh), tmesh), tmesh)),
get(vpm, target(prev(halfedge(f, tmesh), tmesh), tmesh)));
exact(volume);
}
return volume;*
}

and about cv3:

class Compute_volume_3
{
....
result_type
* operator()(const Point_3& p0, const Point_3& p1,
const Point_3& p2, const Point_3& p3) const
{
return determinant<FT>(p1.x()-p0.x(), p1.y()-p0.y(), p1.z()-p0.z(),
p2.x()-p0.x(), p2.y()-p0.y(), p2.z()-p0.z(),
p3.x()-p0.x(), p3.y()-p0.y(), p3.z()-p0.z())/6;
}
*
...
};

The above determinant compute the volume of a tetrahedron with vertices
p0,p1,p2,p3.
So if I get it right the volume of the mesh is the sum of all its pyramids
formed by every face and the origin.
I don't understand what the negative sign of the above determinant means
geometrically though..



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/



Archive powered by MHonArc 2.6.18.

Top of Page