Subject: CGAL users discussion list
List archive
- From: "Benjamin schwarz" <>
- To:
- Subject: [cgal-discuss] skin surfaces : subdivision is *very* slow, is this normal ?
- Date: Fri, 21 Nov 2008 10:02:35 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=oSFXf4+WrwJEmySmhCnmZ0qu+xWCWpcmdAaUCJQAPklSDMTrW+cM4l2KS/NspP6qb8 7tzz8Nw08Dbpy3m/oYXJ2l5QgH5IbqsKBTDLwuzGz0Q8jtJJD2ZNObZPFOel61hRIHsK tVGEXEEJZjkdAIfKoQ+EwtTdJELJJPgpTPvz0=
Hello list,
I am currently testing the skin package provided in CGAL (thanks a
lot Nico). My computations seem far less efficient than those
exhibited in the CGAL manual or in Nico's papers. I guess I did
something wrong. Maybe another magic compilation variable like
-DNDEBUG ?
I pasted the code a few lines below. It only consists in reading
atom, skin it, get a coarse mesh and refine this mesh twice. The times
for these four steps on a 28 atoms molecule :
create skin in : 0.16001
mesh skin0 in : 0.012001
mesh skin1 in : 11.7727
mesh skin2 in : 11.7887
Is this normal ?
My computer is a bit old : laptop 1.6GHz
under linux debian lenny
latest cgal installed through dpkg (thanks Sylvain)
gcc version 4.3.2 (Debian 4.3.2-1)
Compilation lines :
g++ -Wall -frounding-math -g -O2 -I/usr/include/qt3 -DCGAL_USE_F2C
-DCGAL_USE_F2C -I /home/schwarz/include -O2 -DNDEBUG -c -o
test-skins.o test-skins.cpp
g++ -o test-skins test-skins.o -lCGAL -lCGALcore++ -lCGALQt
-lCGALimageIO -lCGALPDB -lqt-mt -llapack -lGL -lGLU -llapack -lf77blas
-lcblas -latlas -lz -lmpfr -lgmpxx -lgmp -lX11
-lboost_program_options-mt -lm -O2 -lm
----------My code------------
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Geomview_stream.h>
#include <CGAL/IO/Polyhedron_geomview_ostream.h>
//#include "skin_surface_writer.h"
#include <CGAL/Skin_surface_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/mesh_skin_surface_3.h>
#include <CGAL/subdivide_skin_surface_mesh_3.h>
#include <CGAL/Timer.h>
#include <list>
#include <iostream>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Skin_surface_traits_3<K> Traits;
typedef CGAL::Skin_surface_3<Traits> Skin_surface_3;
typedef Skin_surface_3::FT FT;
typedef Skin_surface_3::Weighted_point Weighted_point;
typedef K::Point_3 Point;
typedef K::Vector_3 Vector;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef Polyhedron::Halfedge_handle
Halfedge_handle;
int main(int argc, char **argv) {
std::list<Weighted_point> l;
double shrinkfactor = 0.5;
CGAL::Timer ben_t;
// first command line arg is a "x y z w" formated file
std::ifstream in(argv[1],std::ios::in);
int i=0;
double x,y,z,w;
while (in>>x) {++i;
std::cerr<<"-->"<<x<<std::endl;
in >> y; in >> z; in >> w;
l.push_back(Weighted_point(Point(x,y,z),w));
}
std::cerr<<"got "<<i<<" atoms"<<std::endl;
Polyhedron p;
CGAL::Geomview_stream gv(CGAL::Bbox_3(-100, -100, -100, 100, 100, 100));
gv.set_bg_color(CGAL::Color(0, 200, 200));
gv.clear();
int geomId=0;
double time_coarse = ben_t.time(); ben_t.start();
Skin_surface_3 skin_surface(l.begin(), l.end(), shrinkfactor);
ben_t.stop();time_coarse = ben_t.time() - time_coarse;
double time_meshcoarse = ben_t.time(); ben_t.start();
CGAL::mesh_skin_surface_3(skin_surface, p);
ben_t.stop();time_meshcoarse = ben_t.time() - time_coarse;
std::cout<<"skin mesh..."<<std::endl;
std::cerr<<" done"<<std::endl;
gv<<CGAL::Color(100,100,100);
gv<<p;
gv<<"(name-object g"<<++geomId<<" skin0)";
std::cout<<"mesh subdivide 1..."<<std::endl;
double time_subdiv1 = ben_t.time(); ben_t.start();
CGAL::subdivide_skin_surface_mesh_3(skin_surface, p, 1);
ben_t.stop();time_subdiv1 = ben_t.time() - time_coarse;
gv<<CGAL::Color(100,100,200);
gv<<p;
gv<<"(name-object g"<<++geomId<<" skin1)";
double time_subdiv2 = ben_t.time(); ben_t.start();
CGAL::mesh_skin_surface_3(skin_surface, p);
ben_t.stop();time_subdiv2 = ben_t.time() - time_coarse;
gv<<CGAL::Color(100,100,200);
gv<<p;
gv<<"(name-object g"<<++geomId<<" skin2)";
std::cout<<std::endl;
std::cout<<"create skin in : "<<time_coarse<<std::endl;
std::cout<<"mesh skin0 in : "<<time_meshcoarse<<std::endl;
std::cout<<"mesh skin1 in : "<<time_subdiv1<<std::endl;
std::cout<<"mesh skin2 in : "<<time_subdiv2<<std::endl;
std::cout<<"press a key to finish"<<std::endl;
char c;std::cin>>c;
std::cout<<c<<std::endl;
return 0;
}
--
--Benjamin SCHWARZ
____________________________________________________
IGBMC
Département de Biologie et de Génomique Structurales
Parc d'Innovation, 1 rue Laurent Fries
BP 10142, 67404 ILLKIRCH CEDEX, France
E-mail :
Phone : 03 88 65 57 95
____________________________________________________
- [cgal-discuss] skin surfaces : subdivision is *very* slow, is this normal ?, Benjamin schwarz, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Sylvain Pion, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Benjamin schwarz, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Nico Kruithof, 11/23/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Nico Kruithof, 11/30/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Nico Kruithof, 11/23/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Benjamin schwarz, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is this normal ?, Laurent Rineau, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is this normal ?, Benjamin schwarz, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Sylvain Pion, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Nico Kruithof, 11/23/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is this normal ?, Nico Kruithof, 11/23/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is this normal ?, Benjamin schwarz, 11/23/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Sylvain Pion, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is this normal ?, Benjamin schwarz, 11/21/2008
- Re: [cgal-discuss] skin surfaces : subdivision is *very* slow, is, Sylvain Pion, 11/21/2008
Archive powered by MHonArc 2.6.16.