From d4f068e4e0da7ad11380ffb011a89e3a3e3dd543 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Thu, 6 Jul 2006 12:39:51 +0000 Subject: [PATCH] adde barycenter() --- vcg/space/tetra3.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vcg/space/tetra3.h b/vcg/space/tetra3.h index f9fc6466..9f1caac4 100644 --- a/vcg/space/tetra3.h +++ b/vcg/space/tetra3.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.13 2006/06/06 14:35:31 zifnab1974 +Changes for compilation on linux AMD64. Some remarks: Linux filenames are case-sensitive. _fileno and _filelength do not exist on linux + Revision 1.12 2006/03/01 15:59:34 pietroni added InterpolationParameters function @@ -477,6 +480,13 @@ ScalarType ComputeAspectRatio() }; //end Class +// compute the barycenter +template +Point3 Barycenter(const Tetra3 &t) +{ + return ((t.cP(0)+t.cP(1)+t.cP(2)+t.cP(3))/(ScalarType) 4.0); +} + // compute and return the volume of a tetrahedron template typename TetraType::ScalarType ComputeVolume( const TetraType & t){