mirror of https://github.com/CGAL/cgal
Added traces of the memory currently allocated (using CGAL::Memory_sizer)
This commit is contained in:
parent
31d5835495
commit
54c707b1b0
|
|
@ -446,6 +446,8 @@ Surface_reconstruction_3/doc_doxygen
|
|||
Surface_reconstruction_3/doc_html
|
||||
Surface_reconstruction_3/doc_pdf
|
||||
Surface_reconstruction_3/doc_ps
|
||||
Surface_reconstruction_3/examples/Surface_reconstruction_3/polygirl_apss.off
|
||||
Surface_reconstruction_3/examples/Surface_reconstruction_3/polygirl_poisson.off
|
||||
Surface_reconstruction_3/test/Surface_reconstruction_3/*.kdev*
|
||||
Surface_reconstruction_3/test/Surface_reconstruction_3/*.ncb
|
||||
Surface_reconstruction_3/test/Surface_reconstruction_3/*.suo
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include <CGAL/IO/File_scanner_OFF.h>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
|
||||
// This package
|
||||
#include <CGAL/IO/surface_reconstruction_read_off_point_cloud.h>
|
||||
|
|
@ -326,7 +327,7 @@ BOOL CPoissonDoc::OnOpenDocument(LPCTSTR lpszPathName)
|
|||
m_points.invalidate_bounding_box();
|
||||
m_edit_mode = POINT_SET;
|
||||
|
||||
status_message("Load point set...done (%lf s)", task_timer.time());
|
||||
status_message("Load point set...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
return TRUE;
|
||||
|
|
@ -477,8 +478,12 @@ void CPoissonDoc::update_status()
|
|||
CString selected_points;
|
||||
selected_points.Format("%d selected",m_points.nb_selected_points());
|
||||
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
|
||||
// write message to cerr
|
||||
std::cerr << "=> " << points << " (" << selected_points << ")" << std::endl;
|
||||
std::cerr << "=> " << points << " (" << selected_points << "), "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
|
||||
// Update status bar
|
||||
pStatus->SetPaneText(1,points);
|
||||
|
|
@ -495,8 +500,12 @@ void CPoissonDoc::update_status()
|
|||
CString tets;
|
||||
tets.Format("%d tets",m_poisson_dt->number_of_cells());
|
||||
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
|
||||
// write message to cerr
|
||||
std::cerr << "=> " << vertices << " and " << tets << std::endl;
|
||||
std::cerr << "=> " << vertices << ", " << tets << ", "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
|
||||
// Update status bar
|
||||
pStatus->SetPaneText(1,vertices);
|
||||
|
|
@ -597,7 +606,7 @@ void CPoissonDoc::OnAlgorithmsEstimateNormalsByPCA()
|
|||
m_points.normals_begin(),
|
||||
m_number_of_neighbours);
|
||||
|
||||
status_message("Estimate Normals Direction by PCA...done (%lf s)", task_timer.time());
|
||||
status_message("Estimate Normals Direction by PCA...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -619,7 +628,7 @@ void CPoissonDoc::OnAlgorithmsEstimateNormalsByJetFitting()
|
|||
m_points.normals_begin(),
|
||||
m_number_of_neighbours);
|
||||
|
||||
status_message("Estimate Normals Direction by Jet Fitting...done (%lf s)", task_timer.time());
|
||||
status_message("Estimate Normals Direction by Jet Fitting...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -649,7 +658,7 @@ void CPoissonDoc::OnAlgorithmsOrientNormalsWithMST()
|
|||
if ( ! m_points[i].normal().is_oriented() )
|
||||
m_points.select(&m_points[i]);
|
||||
|
||||
status_message("Orient Normals with MST...done (%lf s)", task_timer.time());
|
||||
status_message("Orient Normals with MST...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -684,7 +693,7 @@ void CPoissonDoc::OnAlgorithmsOrientNormalsWrtCameras()
|
|||
if (m_points[i].normal().get_vector() * normals_copy[i].get_vector() < 0)
|
||||
m_points.select(&m_points[i]);
|
||||
|
||||
status_message("Orient Normals wrt Cameras...done (%lf s)", task_timer.time());
|
||||
status_message("Orient Normals wrt Cameras...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -720,7 +729,7 @@ void CPoissonDoc::OnCreatePoissonTriangulation()
|
|||
m_triangulation_refined = false; // Need to apply Delaunay refinement
|
||||
m_poisson_solved = false; // Need to solve Poisson equation
|
||||
|
||||
status_message("Create Poisson Triangulation...done (%lf s)", task_timer.time());
|
||||
status_message("Create Poisson Triangulation...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -752,7 +761,8 @@ void CPoissonDoc::OnReconstructionDelaunayRefinement()
|
|||
unsigned int nb_vertices_added = m_poisson_function->delaunay_refinement(quality,max_vertices,enlarge_ratio,50000);
|
||||
m_triangulation_refined = true;
|
||||
|
||||
status_message("Delaunay refinement...done (%lf s, %d vertices inserted)", task_timer.time(),nb_vertices_added);
|
||||
status_message("Delaunay refinement...done (%.2lf s, %d vertices inserted)",
|
||||
task_timer.time(), nb_vertices_added);
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -779,7 +789,8 @@ void CPoissonDoc::OnAlgorithmsRefineInShell()
|
|||
unsigned int nb_vertices_added = m_poisson_function->delaunay_refinement_shell(m_dr_shell_size,m_dr_sizing,m_dr_max_vertices);
|
||||
m_triangulation_refined = true;
|
||||
|
||||
status_message("Delaunay refinement in surface shell...done (%lf s, %d vertices inserted)", task_timer.time(),nb_vertices_added);
|
||||
status_message("Delaunay refinement in surface shell...done (%.2lf s, %d vertices inserted)",
|
||||
task_timer.time(), nb_vertices_added);
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -803,7 +814,7 @@ void CPoissonDoc::OnAlgorithmsExtrapolatenormals()
|
|||
|
||||
m_poisson_function->extrapolate_normals();
|
||||
|
||||
status_message("Extrapolate the normals field...done (%lf s)", task_timer.time());
|
||||
status_message("Extrapolate the normals field...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -835,11 +846,10 @@ void CPoissonDoc::OnReconstructionPoisson()
|
|||
m_poisson_function->set_contouring_value(m_poisson_function->median_value_at_input_vertices());
|
||||
m_contouring_value = 0.0;
|
||||
|
||||
double total_duration = task_timer.time();
|
||||
if (!m_poisson_solved)
|
||||
status_message("Solve Poisson equation...solver failed");
|
||||
else
|
||||
status_message("Solve Poisson equation...done (%lf s)", total_duration);
|
||||
status_message("Solve Poisson equation...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -865,11 +875,10 @@ void CPoissonDoc::OnReconstructionPoissonNormalized()
|
|||
m_poisson_function->set_contouring_value(m_poisson_function->median_value_at_input_vertices());
|
||||
m_contouring_value = 0.0;
|
||||
|
||||
double total_duration = task_timer.time();
|
||||
if (!m_poisson_solved)
|
||||
status_message("Solve Poisson equation...solver failed");
|
||||
else
|
||||
status_message("Solve Poisson equation...done (%lf s)", total_duration);
|
||||
status_message("Solve Poisson equation...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -926,10 +935,13 @@ void CPoissonDoc::OnReconstructionPoissonSurfaceMeshing()
|
|||
m_sm_radius*size, // upper bound of Delaunay balls radii
|
||||
m_sm_distance_poisson*size); // upper bound of distance to surface
|
||||
|
||||
std::cerr << "Implicit_surface_3(dichotomy error="<<m_sm_error_bound*size << ")\n";
|
||||
std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radius="<<sm_sphere_radius << "},\n"
|
||||
<< " criteria={angle="<<m_sm_angle << ", radius="<<m_sm_radius*size << ", distance="<<m_sm_distance_poisson*size << "},\n"
|
||||
<< " Non_manifold_tag())...\n";
|
||||
std::cerr << " make_surface_mesh(dichotomy error="<<m_sm_error_bound<<" * point set radius,\n"
|
||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||
<< " angle="<<m_sm_angle << " degrees,\n"
|
||||
<< " radius="<<m_sm_radius<<" * p.s.r.,\n"
|
||||
<< " distance="<<m_sm_distance_poisson<<" * p.s.r.,\n"
|
||||
<< " Non_manifold_tag)\n";
|
||||
|
||||
// meshing surface
|
||||
CGAL::make_surface_mesh(m_surface_mesher_c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||
|
|
@ -943,7 +955,7 @@ std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radiu
|
|||
m_poisson_function->set_contouring_value(0.0);
|
||||
|
||||
// Print status
|
||||
status_message("Surface meshing...done (%d vertices, %lf s)",
|
||||
status_message("Surface meshing...done (%d output vertices, %.2lf s)",
|
||||
m_surface_mesher_dt.number_of_vertices(), task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
|
|
@ -972,7 +984,8 @@ void CPoissonDoc::OnAlgorithmsMarchingTetContouring()
|
|||
int nb = m_poisson_dt->marching_tet(std::back_inserter(triangles), m_contouring_value);
|
||||
m_contour.insert(m_contour.end(), triangles.begin(), triangles.end());
|
||||
|
||||
status_message("Marching tet contouring...done (%d triangles, %lf s)",nb, task_timer.time());
|
||||
status_message("Marching tet contouring...done (%d triangles, %.2lf s)",
|
||||
nb, task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -1027,7 +1040,7 @@ void CPoissonDoc::OnAlgorithmsSmoothUsingJetFitting()
|
|||
m_points[i].set_position(output[i]);
|
||||
m_points.invalidate_bounding_box();
|
||||
|
||||
status_message("Smooth Point Set...done (%lf s)", task_timer.time());
|
||||
status_message("Smooth Point Set...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -1103,7 +1116,7 @@ void CPoissonDoc::OnOneStepPoissonReconstruction()
|
|||
OnReconstructionPoisson();
|
||||
OnReconstructionPoissonSurfaceMeshing();
|
||||
|
||||
status_message("1-step Poisson reconstruction...done (%lf s)", task_timer.time());
|
||||
status_message("1-step Poisson reconstruction...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -1127,7 +1140,7 @@ void CPoissonDoc::OnOneStepPoissonReconstructionWithNormalizedDivergence()
|
|||
OnReconstructionPoissonNormalized();
|
||||
OnReconstructionPoissonSurfaceMeshing();
|
||||
|
||||
status_message("1-step Poisson reconstruction with normalized divergence...done (%lf s)", task_timer.time());
|
||||
status_message("1-step Poisson reconstruction with normalized divergence...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -1147,7 +1160,7 @@ void CPoissonDoc::OnAlgorithmsOutliersRemovalWrtCamerasConeAngle()
|
|||
m_min_cameras_cone_angle*M_PI/180.0);
|
||||
m_points.select(first_iterator_to_remove, m_points.end(), true);
|
||||
|
||||
status_message("Remove outliers / cameras cone's angle is low...done (%lf s)", task_timer.time());
|
||||
status_message("Remove outliers / cameras cone's angle is low...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -1177,7 +1190,7 @@ void CPoissonDoc::OnOutliersRemovalWrtAvgKnnSqDist()
|
|||
m_threshold_percent_avg_knn_sq_dst);
|
||||
m_points.select(first_iterator_to_remove, m_points.end(), true);
|
||||
|
||||
status_message("Remove outliers wrt average squared distance to knn...done (%lf s)", task_timer.time());
|
||||
status_message("Remove outliers wrt average squared distance to knn...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -1223,6 +1236,7 @@ void CPoissonDoc::OnReconstructionApssReconstruction()
|
|||
m_surface.clear();
|
||||
|
||||
// Create implicit function
|
||||
std::cerr << " APSS_implicit_function(knn="<<m_number_of_neighbours << ")\n";
|
||||
m_apss_function = new APSS_implicit_function(m_points.begin(), m_points.end(),
|
||||
m_number_of_neighbours);
|
||||
|
||||
|
|
@ -1253,11 +1267,13 @@ void CPoissonDoc::OnReconstructionApssReconstruction()
|
|||
m_sm_radius*size, // upper bound of Delaunay balls radii
|
||||
m_sm_distance_apss*size); // upper bound of distance to surface
|
||||
|
||||
std::cerr << "APSS_implicit_function(knn="<<m_number_of_neighbours << ")\n";
|
||||
std::cerr << "Implicit_surface_3(dichotomy error="<<m_sm_error_bound*size << ")\n";
|
||||
std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radius="<<sm_sphere_radius << "},\n"
|
||||
<< " criteria={angle="<<m_sm_angle << ", radius="<<m_sm_radius*size << ", distance="<<m_sm_distance_apss*size << "},\n"
|
||||
<< " Non_manifold_tag())...\n";
|
||||
std::cerr << " make_surface_mesh(dichotomy error="<<m_sm_error_bound<<" * point set radius,\n"
|
||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||
<< " angle="<<m_sm_angle << " degrees,\n"
|
||||
<< " radius="<<m_sm_radius<<" * p.s.r.,\n"
|
||||
<< " distance="<<m_sm_distance_apss<<" * p.s.r.,\n"
|
||||
<< " Non_manifold_tag)\n";
|
||||
|
||||
// meshing surface
|
||||
CGAL::make_surface_mesh(m_surface_mesher_c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||
|
|
@ -1271,7 +1287,7 @@ std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radiu
|
|||
m_edit_mode = APSS;
|
||||
|
||||
// Print status
|
||||
status_message("APSS reconstruction...done (%d vertices, %lf s)",
|
||||
status_message("APSS reconstruction...done (%d vertices, %.2lf s)",
|
||||
m_surface_mesher_dt.number_of_vertices(), task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
|
|
@ -1387,7 +1403,7 @@ void CPoissonDoc::OnPointCloudSimplificationByClustering()
|
|||
m_clustering_step*size);
|
||||
m_points.select(first_iterator_to_remove, m_points.end(), true);
|
||||
|
||||
status_message("Point cloud simplification by clustering...done (%lf s)", task_timer.time());
|
||||
status_message("Point cloud simplification by clustering...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
@ -1411,7 +1427,7 @@ void CPoissonDoc::OnPointCloudSimplificationRandom()
|
|||
m_random_simplification_percentage);
|
||||
m_points.select(first_iterator_to_remove, m_points.end(), true);
|
||||
|
||||
status_message("Random point cloud simplification...done (%lf s)", task_timer.time());
|
||||
status_message("Random point cloud simplification...done (%.2lf s)", task_timer.time());
|
||||
update_status();
|
||||
UpdateAllViews(NULL);
|
||||
EndWaitCursor();
|
||||
|
|
|
|||
|
|
@ -44,12 +44,13 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE;CGAL_USE_TAUCS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
|
@ -69,7 +70,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
@ -133,12 +134,12 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;NDEBUG;CGAL_USE_TAUCS"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
BrowseInformation="0"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
|
|
@ -157,7 +158,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
@ -316,10 +317,6 @@
|
|||
RelativePath=".\include\RedirectIOToConsole.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RedirectIOToConsole.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\remove_outliers_wrt_camera_cone_angle_3.h"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <CGAL/basic.h> // include basic.h before testing #defines
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
|
||||
// Surface mesher
|
||||
|
|
@ -65,43 +66,18 @@ typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
|
|||
typedef CGAL::Implicit_surface_3<Kernel, APSS_implicit_function&> Surface_3;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
//// Scale point set to [-1,1]^3
|
||||
//void reshape(PointList& pwns)
|
||||
//{
|
||||
// Point cmin = pwns[0];
|
||||
// Point cmax = pwns[0];
|
||||
// for (unsigned int i=1 ; i<pwns.size() ; ++i)
|
||||
// {
|
||||
// cmin = CGAL::min(cmin,pwns[i]);
|
||||
// cmax = CGAL::max(cmax,pwns[i]);
|
||||
// }
|
||||
//
|
||||
// Point mid = midpoint(cmax,cmin);
|
||||
// Vector diag = cmax-cmin;
|
||||
// FT s = 2./(diag.x()>diag.y() ? (diag.x()>diag.z() ? diag.x() : diag.z()) : (diag.y()>diag.z() ? diag.y() : diag.z()));
|
||||
// for (unsigned int i=0 ; i<pwns.size() ; ++i)
|
||||
// {
|
||||
// pwns[i] = CGAL::ORIGIN + s * (pwns[i] - mid);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// main()
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
std::cerr << "RECONSTRUCTION" << std::endl;
|
||||
std::cerr << "APSS reconstruction method." << std::endl;
|
||||
std::cerr << "RECONSTRUCTION" << std::endl;
|
||||
std::cerr << "APSS reconstruction method." << std::endl;
|
||||
|
||||
//***************************************
|
||||
// decode parameters
|
||||
//***************************************
|
||||
//***************************************
|
||||
// decode parameters
|
||||
//***************************************
|
||||
|
||||
if (argc<3)
|
||||
{
|
||||
|
|
@ -109,12 +85,12 @@ int main(int argc, char * argv[])
|
|||
std::cerr << "Input file formats are .off and .xyz.\n";
|
||||
std::cerr << "Output file format is .off.\n";
|
||||
std::cerr << "Options:\n";
|
||||
std::cerr << " -sm_radius <float> Radius upper bound (default = 0.1 * point set radius)\n";
|
||||
std::cerr << " -sm_distance <float> Distance upper bound (default = 0.005 * point set radius)\n";
|
||||
std::cerr << " -k <int> Number of neighbors (default = 7)\n";
|
||||
std::cerr << " - should be greater than 7,\n";
|
||||
std::cerr << " - high numbers lead to smoother surfaces.\n";
|
||||
return(EXIT_FAILURE);
|
||||
std::cerr << " -sm_radius <float> Radius upper bound (default=0.1 * point set radius)\n";
|
||||
std::cerr << " -sm_distance <float> Distance upper bound (default=0.005 * point set radius)\n";
|
||||
std::cerr << " -k <int> Number of neighbors (default=7)\n";
|
||||
std::cerr << " - should be greater than 7,\n";
|
||||
std::cerr << " - high numbers lead to smoother surfaces.\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Default APSS options
|
||||
|
|
@ -221,21 +197,30 @@ int main(int argc, char * argv[])
|
|||
}
|
||||
|
||||
//***************************************
|
||||
// Create implicit function
|
||||
// Compute implicit function
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Compute implicit function...\n";
|
||||
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
|
||||
//reshape(pwns); // Scale point set to [-1,1]^3
|
||||
|
||||
// Create implicit function
|
||||
std::cerr << " APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
||||
APSS_implicit_function apss_function(pwns.begin(), pwns.end(),
|
||||
number_of_neighbours);
|
||||
|
||||
// Print status
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Compute implicit function: " << task_timer.time() << " seconds, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
//***************************************
|
||||
// Surface mesh generation
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Surface meshing...\n";
|
||||
STr tr; // 3D-Delaunay triangulation
|
||||
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation
|
||||
|
||||
|
|
@ -264,19 +249,23 @@ int main(int argc, char * argv[])
|
|||
CGAL::Surface_mesh_default_criteria_3<STr> criteria(sm_angle, // lower bound of facets angles (degrees)
|
||||
sm_radius*size, // upper bound of Delaunay balls radii
|
||||
sm_distance*size); // upper bound of distance to surface
|
||||
|
||||
std::cerr << "APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
||||
std::cerr << "Implicit_surface_3(dichotomy error="<<sm_error_bound*size << ")\n";
|
||||
std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radius="<<sm_sphere_radius << "},\n"
|
||||
<< " criteria={angle="<<sm_angle << ", radius="<<sm_radius*size << ", distance="<<sm_distance*size << "},\n"
|
||||
<< " Non_manifold_tag())...\n";
|
||||
|
||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||
<< " angle="<<sm_angle << " degrees,\n"
|
||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||
<< " Non_manifold_tag)\n";
|
||||
|
||||
// meshing surface
|
||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||
|
||||
// Print status
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Surface meshing: " << task_timer.time() << " seconds, "
|
||||
<< tr.number_of_vertices() << " vertices"
|
||||
<< tr.number_of_vertices() << " output vertices, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
|
|
@ -287,6 +276,6 @@ std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radiu
|
|||
// Print status
|
||||
std::cerr << "Write file " << argv[2] << std::endl << std::endl;
|
||||
|
||||
return 0;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
// CGAL
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
|
||||
// Surface mesher
|
||||
|
|
@ -73,12 +74,12 @@ typedef CGAL::Implicit_surface_3<Kernel, Poisson_implicit_function&> Surface_3;
|
|||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
std::cerr << "RECONSTRUCTION" << std::endl;
|
||||
std::cerr << "Poisson Delaunay Reconstruction method" << std::endl;
|
||||
std::cerr << "RECONSTRUCTION" << std::endl;
|
||||
std::cerr << "Poisson Delaunay Reconstruction method" << std::endl;
|
||||
|
||||
//***************************************
|
||||
// decode parameters
|
||||
//***************************************
|
||||
//***************************************
|
||||
// decode parameters
|
||||
//***************************************
|
||||
|
||||
if (argc<3)
|
||||
{
|
||||
|
|
@ -86,9 +87,9 @@ int main(int argc, char * argv[])
|
|||
std::cerr << "Input file formats are .off and .xyz.\n";
|
||||
std::cerr << "Output file format is .off.\n";
|
||||
std::cerr << "Options:\n";
|
||||
std::cerr << " -sm_radius <float> Radius upper bound (default = 0.1 * point set radius)\n";
|
||||
std::cerr << " -sm_distance <float> Distance upper bound (default = 0.002 * point set radius)\n";
|
||||
return(EXIT_FAILURE);
|
||||
std::cerr << " -sm_radius <float> Radius upper bound (default=0.1 * point set radius)\n";
|
||||
std::cerr << " -sm_distance <float> Distance upper bound (default=0.002 * point set radius)\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Default Surface Mesher options
|
||||
|
|
@ -197,6 +198,8 @@ int main(int argc, char * argv[])
|
|||
// Compute implicit function
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Compute implicit function...\n";
|
||||
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
|
||||
// Create implicit function
|
||||
|
|
@ -211,15 +214,20 @@ int main(int argc, char * argv[])
|
|||
}
|
||||
|
||||
// Print status
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
int nb_vertices2 = dt.number_of_vertices();
|
||||
std::cerr << "Solve Poisson equation: "
|
||||
<< "(added " << nb_vertices2-nb_vertices << " vertices)"
|
||||
<< std::endl;
|
||||
std::cerr << "Compute implicit function: " << "added " << nb_vertices2-nb_vertices << " Steiner points, "
|
||||
<< task_timer.time() << " seconds, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
//***************************************
|
||||
// Surface mesh generation
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Surface meshing...\n";
|
||||
|
||||
STr tr; // 3D-Delaunay triangulation
|
||||
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation
|
||||
|
||||
|
|
@ -248,18 +256,23 @@ int main(int argc, char * argv[])
|
|||
CGAL::Surface_mesh_default_criteria_3<STr> criteria(sm_angle, // lower bound of facets angles (degrees)
|
||||
sm_radius*size, // upper bound of Delaunay balls radii
|
||||
sm_distance*size); // upper bound of distance to surface
|
||||
|
||||
std::cerr << "Implicit_surface_3(dichotomy error="<<sm_error_bound*size << ")\n";
|
||||
std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radius="<<sm_sphere_radius << "},\n"
|
||||
<< " criteria={angle="<<sm_angle << ", radius="<<sm_radius*size << ", distance="<<sm_distance*size << "},\n"
|
||||
<< " Non_manifold_tag())...\n";
|
||||
|
||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||
<< " angle="<<sm_angle << " degrees,\n"
|
||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||
<< " Non_manifold_tag)\n";
|
||||
|
||||
// meshing surface
|
||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||
|
||||
// Print status
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Surface meshing: " << task_timer.time() << " seconds, "
|
||||
<< tr.number_of_vertices() << " vertices"
|
||||
<< tr.number_of_vertices() << " output vertices, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
|
|
@ -270,7 +283,7 @@ std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radiu
|
|||
// Print status
|
||||
std::cerr << "Write file " << argv[2] << std::endl << std::endl;
|
||||
|
||||
return 0;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ public:
|
|||
|
||||
/// Normal vector is (0,0,0) by default.
|
||||
/// Normal is oriented by default.
|
||||
Oriented_normal_3(Null_vector = NULL_VECTOR)
|
||||
Oriented_normal_3(Null_vector = NULL_VECTOR, bool oriented = true)
|
||||
{
|
||||
m_pNormal = NULL;
|
||||
m_oriented = true;
|
||||
m_oriented = oriented;
|
||||
}
|
||||
Oriented_normal_3(const Vector& vector, bool oriented = true)
|
||||
{
|
||||
|
|
@ -88,7 +88,7 @@ public:
|
|||
/// Destructor
|
||||
~Oriented_normal_3()
|
||||
{
|
||||
delete m_pNormal;
|
||||
delete m_pNormal; m_pNormal = NULL;
|
||||
}
|
||||
|
||||
/// Get normal vector.
|
||||
|
|
@ -97,27 +97,32 @@ public:
|
|||
if(m_pNormal != NULL)
|
||||
return *m_pNormal;
|
||||
else
|
||||
return CGAL::NULL_VECTOR;
|
||||
return NULL_VECTOR;
|
||||
}
|
||||
|
||||
/// Get normal orientation.
|
||||
bool is_oriented() const { return m_oriented; }
|
||||
|
||||
/// Set normal (vector + orientation).
|
||||
void set(Null_vector, bool oriented = true)
|
||||
{
|
||||
delete m_pNormal; m_pNormal = NULL;
|
||||
m_oriented = oriented;
|
||||
}
|
||||
void set(const Vector& vector, bool oriented = true)
|
||||
{
|
||||
if(m_pNormal == NULL)
|
||||
m_pNormal = new Vector(vector);
|
||||
else
|
||||
*m_pNormal = vector;
|
||||
|
||||
m_oriented = oriented;
|
||||
}
|
||||
|
||||
// Data
|
||||
private:
|
||||
|
||||
// PA: why is normal optional here? to save memory?
|
||||
Vector *m_pNormal; // normal vector (optional)
|
||||
Vector *m_pNormal; // normal vector (optional to save memory)
|
||||
bool m_oriented;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,12 +25,23 @@
|
|||
#include <CGAL/Orthogonal_k_neighbor_search.h>
|
||||
#include <CGAL/Monge_via_jet_fitting.h>
|
||||
#include <CGAL/Oriented_normal_3.h>
|
||||
#include <CGAL/surface_reconstruction_assertions.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
|
||||
#include <iterator>
|
||||
#include <list>
|
||||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
// Traces?
|
||||
//#define CGAL_TRACE printf
|
||||
|
||||
#ifndef CGAL_TRACE
|
||||
#define CGAL_TRACE if (false) printf
|
||||
#endif
|
||||
|
||||
|
||||
/// Estimate normal direction using jet fitting
|
||||
/// on the K nearest neighbors.
|
||||
///
|
||||
|
|
@ -66,12 +77,11 @@ estimate_normal_jet_fitting_3(const typename Kernel::Point_3& query, ///< 3D poi
|
|||
typedef typename CGAL::Monge_via_jet_fitting<Kernel> Monge_jet_fitting;
|
||||
typedef typename Monge_jet_fitting::Monge_form Monge_form;
|
||||
|
||||
// gather set of (KNN+1) neighboring points
|
||||
// Gather set of (KNN+1) neighboring points.
|
||||
// Perform KNN+1 queries (as in point set, the query point is
|
||||
// output first). Search may be aborted when KNN is greater
|
||||
// than number of input points.
|
||||
std::vector<Point> points;
|
||||
|
||||
// performs KNN + 1 queries (if unique the query point is
|
||||
// output first). search may be aborted when KNN is greater
|
||||
// than number of input points
|
||||
Neighbor_search search(tree,query,KNN+1);
|
||||
Search_iterator search_iterator = search.begin();
|
||||
unsigned int i;
|
||||
|
|
@ -120,6 +130,8 @@ estimate_normals_jet_fitting_3(InputIterator first, ///< input points
|
|||
const Kernel& /*kernel*/,
|
||||
const unsigned int degre_fitting = 2)
|
||||
{
|
||||
CGAL_TRACE("Call estimate_normals_jet_fitting_3()\n");
|
||||
|
||||
// value_type_traits is a workaround as back_insert_iterator's value_type is void
|
||||
typedef typename value_type_traits<OutputIterator>::type Normal;
|
||||
|
||||
|
|
@ -127,7 +139,6 @@ estimate_normals_jet_fitting_3(InputIterator first, ///< input points
|
|||
typedef typename CGAL::Search_traits_3<Kernel> Tree_traits;
|
||||
typedef typename CGAL::Orthogonal_k_neighbor_search<Tree_traits> Neighbor_search;
|
||||
typedef typename Neighbor_search::Tree Tree;
|
||||
typedef typename Neighbor_search::iterator Search_iterator;
|
||||
|
||||
// precondition: at least one element in the container.
|
||||
// to fix: should have at least three distinct points
|
||||
|
|
@ -137,9 +148,15 @@ estimate_normals_jet_fitting_3(InputIterator first, ///< input points
|
|||
// precondition: at least 2 nearest neighbors
|
||||
CGAL_surface_reconstruction_precondition(KNN >= 2);
|
||||
|
||||
long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
|
||||
CGAL_TRACE(" Create KD-tree\n");
|
||||
|
||||
// instanciate a KD-tree search
|
||||
Tree tree(first,beyond);
|
||||
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
|
||||
CGAL_TRACE(" Compute normals\n");
|
||||
|
||||
// iterate over input points, compute and output normal
|
||||
// vectors (already normalized)
|
||||
InputIterator it;
|
||||
|
|
@ -148,6 +165,10 @@ estimate_normals_jet_fitting_3(InputIterator first, ///< input points
|
|||
*normals = estimate_normal_jet_fitting_3<Kernel,Tree,Normal>(*it,tree,KNN,degre_fitting);
|
||||
normals++;
|
||||
}
|
||||
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
|
||||
CGAL_TRACE("End of estimate_normals_jet_fitting_3()\n");
|
||||
|
||||
return normals;
|
||||
}
|
||||
|
||||
|
|
@ -178,6 +199,9 @@ estimate_normals_jet_fitting_3(InputIterator first, ///< input points
|
|||
}
|
||||
|
||||
|
||||
// Avoid clash with other header
|
||||
#undef CGAL_TRACE
|
||||
|
||||
CGAL_END_NAMESPACE
|
||||
|
||||
#endif // CGAL_ESTIMATE_NORMALS_JET_FITTING_3_H
|
||||
|
|
|
|||
|
|
@ -26,12 +26,22 @@
|
|||
#include <CGAL/linear_least_squares_fitting_3.h>
|
||||
#include <CGAL/Oriented_normal_3.h>
|
||||
#include <CGAL/surface_reconstruction_assertions.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
|
||||
#include <iterator>
|
||||
#include <list>
|
||||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
// Traces?
|
||||
//#define CGAL_TRACE printf
|
||||
|
||||
#ifndef CGAL_TRACE
|
||||
#define CGAL_TRACE if (false) printf
|
||||
#endif
|
||||
|
||||
|
||||
/// Estimate normal direction using linear least
|
||||
/// squares fitting of a plane on the K nearest neighbors.
|
||||
///
|
||||
|
|
@ -63,12 +73,11 @@ estimate_normal_pca_3(const typename Kernel::Point_3& query, ///< 3D point whose
|
|||
typedef typename CGAL::Orthogonal_k_neighbor_search<Tree_traits> Neighbor_search;
|
||||
typedef typename Neighbor_search::iterator Search_iterator;
|
||||
|
||||
// gather set of (KNN+1) neighboring points
|
||||
std::list<Point> points;
|
||||
|
||||
// performs KNN + 1 queries (if unique the query point is
|
||||
// output first). search may be aborted when KNN is greater
|
||||
// than number of input points
|
||||
// Gather set of (KNN+1) neighboring points.
|
||||
// Perform KNN+1 queries (as in point set, the query point is
|
||||
// output first). Search may be aborted when KNN is greater
|
||||
// than number of input points.
|
||||
std::vector<Point> points;
|
||||
Neighbor_search search(tree,query,KNN+1);
|
||||
Search_iterator search_iterator = search.begin();
|
||||
unsigned int i;
|
||||
|
|
@ -83,11 +92,7 @@ estimate_normal_pca_3(const typename Kernel::Point_3& query, ///< 3D point whose
|
|||
|
||||
// performs plane fitting by point-based PCA
|
||||
Plane plane;
|
||||
#ifndef CGAL_DIMENSION_H // if CGAL 3.3.1
|
||||
linear_least_squares_fitting_3(points.begin(),points.end(),plane);
|
||||
#else // if CGAL >= 3.4
|
||||
linear_least_squares_fitting_3(points.begin(),points.end(),plane,Dimension_tag<0>());
|
||||
#endif
|
||||
|
||||
// output normal vector (already normalized by PCA)
|
||||
return OrientedNormal_3(plane.orthogonal_vector(),
|
||||
|
|
@ -118,6 +123,8 @@ estimate_normals_pca_3(InputIterator first, ///< input points
|
|||
const unsigned int KNN, ///< number of neighbors
|
||||
const Kernel& /*kernel*/)
|
||||
{
|
||||
CGAL_TRACE("Call estimate_normals_pca_3()\n");
|
||||
|
||||
// value_type_traits is a workaround as back_insert_iterator's value_type is void
|
||||
typedef typename value_type_traits<OutputIterator>::type Normal;
|
||||
|
||||
|
|
@ -134,9 +141,15 @@ estimate_normals_pca_3(InputIterator first, ///< input points
|
|||
// precondition: at least 2 nearest neighbors
|
||||
CGAL_surface_reconstruction_precondition(KNN >= 2);
|
||||
|
||||
long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
|
||||
CGAL_TRACE(" Create KD-tree\n");
|
||||
|
||||
// instanciate a KD-tree search
|
||||
Tree tree(first,beyond);
|
||||
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
|
||||
CGAL_TRACE(" Compute normals\n");
|
||||
|
||||
// iterate over input points, compute and output normal
|
||||
// vectors (already normalized)
|
||||
InputIterator it;
|
||||
|
|
@ -145,6 +158,10 @@ estimate_normals_pca_3(InputIterator first, ///< input points
|
|||
*normals = estimate_normal_pca_3<Kernel,Tree,Normal>(*it,tree,KNN);
|
||||
normals++;
|
||||
}
|
||||
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
|
||||
CGAL_TRACE("End of estimate_normals_pca_3()\n");
|
||||
|
||||
return normals;
|
||||
}
|
||||
|
||||
|
|
@ -174,6 +191,9 @@ estimate_normals_pca_3(InputIterator first, ///< input points
|
|||
}
|
||||
|
||||
|
||||
// Avoid clash with other header
|
||||
#undef CGAL_TRACE
|
||||
|
||||
CGAL_END_NAMESPACE
|
||||
|
||||
#endif // CGAL_ESTIMATE_NORMALS_PCA_3_H
|
||||
|
|
|
|||
|
|
@ -57,10 +57,11 @@ compute_avg_knn_sq_distance_3(
|
|||
typedef typename Neighbor_search::iterator Search_iterator;
|
||||
|
||||
// Gather set of (KNN+1) neighboring points.
|
||||
// Perform KNN + 1 queries (if in point set, the query point is
|
||||
// Perform KNN+1 queries (if in point set, the query point is
|
||||
// output first). Search may be aborted when KNN is greater
|
||||
// than number of input points.
|
||||
std::vector<Point> points;
|
||||
points.reserve(KNN+1);
|
||||
Neighbor_search search(tree,query,KNN+1);
|
||||
Search_iterator search_iterator = search.begin();
|
||||
unsigned int i;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
//----------------------------------------------------------
|
||||
// Test the APSS reconstruction method
|
||||
// No output
|
||||
// Input files are .off and .xyz
|
||||
// Input file formats are .off and .xyz.
|
||||
// No output.
|
||||
//----------------------------------------------------------
|
||||
// APSS_reconstruction_test mesh1.off point_set2.xyz...
|
||||
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
#include <CGAL/basic.h> // include basic.h before testing #defines
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
|
||||
// Surface mesher
|
||||
|
|
@ -64,31 +65,6 @@ typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
|
|||
typedef CGAL::Implicit_surface_3<Kernel, APSS_implicit_function&> Surface_3;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
//// Scale point set to [-1,1]^3
|
||||
//void reshape(PointList& pwns)
|
||||
//{
|
||||
// Point cmin = pwns[0];
|
||||
// Point cmax = pwns[0];
|
||||
// for (unsigned int i=1 ; i<pwns.size() ; ++i)
|
||||
// {
|
||||
// cmin = CGAL::min(cmin,pwns[i]);
|
||||
// cmax = CGAL::max(cmax,pwns[i]);
|
||||
// }
|
||||
//
|
||||
// Point mid = midpoint(cmax,cmin);
|
||||
// Vector diag = cmax-cmin;
|
||||
// FT s = 2./(diag.x()>diag.y() ? (diag.x()>diag.z() ? diag.x() : diag.z()) : (diag.y()>diag.z() ? diag.y() : diag.z()));
|
||||
// for (unsigned int i=0 ; i<pwns.size() ; ++i)
|
||||
// {
|
||||
// pwns[i] = CGAL::ORIGIN + s * (pwns[i] - mid);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// main()
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
@ -97,7 +73,6 @@ int main(int argc, char * argv[])
|
|||
{
|
||||
std::cerr << "RECONSTRUCTION" << std::endl;
|
||||
std::cerr << "Test the APSS reconstruction method" << std::endl;
|
||||
std::cerr << "No output" << std::endl;
|
||||
|
||||
//***************************************
|
||||
// decode parameters
|
||||
|
|
@ -106,7 +81,9 @@ int main(int argc, char * argv[])
|
|||
if (argc-1 == 0)
|
||||
{
|
||||
std::cerr << "Usage: " << argv[0] << " mesh1.off point_set2.xyz ..." << std::endl;
|
||||
return(EXIT_FAILURE);
|
||||
std::cerr << "Input file formats are .off and .xyz.\n";
|
||||
std::cerr << "No output." << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// APSS options
|
||||
|
|
@ -122,21 +99,24 @@ int main(int argc, char * argv[])
|
|||
// Accumulated errors
|
||||
int accumulated_fatal_err = EXIT_SUCCESS;
|
||||
|
||||
//***************************************
|
||||
// Process each input file
|
||||
//***************************************
|
||||
|
||||
for (int arg_index = 1; arg_index <= argc-1; arg_index++)
|
||||
{
|
||||
std::cerr << std::endl;
|
||||
|
||||
//***************************************
|
||||
// Load mesh/point set
|
||||
//***************************************
|
||||
|
||||
// File name is:
|
||||
std::string input_filename = argv[arg_index];
|
||||
|
||||
// get extension
|
||||
std::string extension = input_filename.substr(input_filename.find_last_of('.'));
|
||||
|
||||
//***************************************
|
||||
// Load mesh/point set
|
||||
//***************************************
|
||||
|
||||
PointList pwns;
|
||||
|
||||
if (extension == ".off" || extension == ".OFF")
|
||||
|
|
@ -208,25 +188,36 @@ int main(int argc, char * argv[])
|
|||
if ( ! (points_have_normals && normals_are_oriented) )
|
||||
{
|
||||
std::cerr << "FATAL ERROR: this reconstruction method requires oriented normals" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
accumulated_fatal_err = EXIT_FAILURE;
|
||||
continue;
|
||||
}
|
||||
|
||||
//***************************************
|
||||
// Create implicit function
|
||||
// Compute implicit function
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Compute implicit function...\n";
|
||||
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
|
||||
//reshape(pwns); // Scale point set to [-1,1]^3
|
||||
|
||||
// Create implicit function
|
||||
std::cerr << " APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
||||
APSS_implicit_function apss_function(pwns.begin(), pwns.end(),
|
||||
number_of_neighbours);
|
||||
|
||||
// Print status
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Compute implicit function: " << task_timer.time() << " seconds, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
//***************************************
|
||||
// Surface mesh generation
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Surface meshing...\n";
|
||||
|
||||
STr tr; // 3D-Delaunay triangulation
|
||||
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation
|
||||
|
||||
|
|
@ -256,19 +247,23 @@ int main(int argc, char * argv[])
|
|||
CGAL::Surface_mesh_default_criteria_3<STr> criteria(sm_angle, // lower bound of facets angles (degrees)
|
||||
sm_radius*size, // upper bound of Delaunay balls radii
|
||||
sm_distance*size); // upper bound of distance to surface
|
||||
|
||||
std::cerr << "APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
||||
std::cerr << "Implicit_surface_3(dichotomy error="<<sm_error_bound*size << ")\n";
|
||||
std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radius="<<sm_sphere_radius << "},\n"
|
||||
<< " criteria={angle="<<sm_angle << ", radius="<<sm_radius*size << ", distance="<<sm_distance*size << "},\n"
|
||||
<< " Non_manifold_tag())...\n";
|
||||
|
||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||
<< " angle="<<sm_angle << " degrees,\n"
|
||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||
<< " Non_manifold_tag)\n";
|
||||
|
||||
// meshing surface
|
||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||
|
||||
// Print status
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Surface meshing: " << task_timer.time() << " seconds, "
|
||||
<< tr.number_of_vertices() << " vertices"
|
||||
<< tr.number_of_vertices() << " output vertices, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib""
|
||||
|
|
@ -122,11 +124,12 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;NDEBUG"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
|
|
@ -143,7 +146,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib""
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib""
|
||||
|
|
@ -122,11 +124,12 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
|
|
@ -143,7 +146,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib""
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE;CGAL_USE_LAPACK"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
@ -122,11 +124,12 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE;CGAL_USE_LAPACK"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
|
|
@ -143,7 +146,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib""
|
||||
|
|
@ -122,11 +124,12 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
|
|
@ -143,7 +146,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib""
|
||||
|
|
|
|||
|
|
@ -40,12 +40,13 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE;CGAL_USE_TAUCS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
|
@ -63,6 +64,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
@ -121,11 +123,12 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE;CGAL_USE_TAUCS"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;NDEBUG;CGAL_USE_TAUCS"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
|
|
@ -142,7 +145,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE;CGAL_USE_LAPACK"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
@ -122,11 +124,12 @@
|
|||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm900"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
AdditionalIncludeDirectories="..\include;..\..\..\include;..\..\..\..\Spatial_searching\include;..\..\..\..\Jet_fitting_3\include;"$(CGALROOT)\include\CGAL\config\msvc";"$(CGALROOT)\include";"$(CGALROOT)\auxiliary\gmp\include";"$(CGALROOT)\auxiliary\taucs\include";"$(BOOSTROOT)""
|
||||
PreprocessorDefinitions="WIN32;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;CGAL_USE_GMP;CGAL_SURFACE_RECONSTRUCTION_CHECK_EXPENSIVE;CGAL_USE_LAPACK"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
|
|
@ -143,7 +146,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="Psapi.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(CGALROOT)\lib";"$(CGALROOT)\auxiliary\gmp\lib";"$(CGALROOT)\auxiliary\taucs\lib""
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
// CGAL
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Timer.h>
|
||||
|
||||
// This package
|
||||
#include <CGAL/average_spacing_3.h>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// normal_estimation_test.cpp
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// USAGE EXAMPLES
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
@ -20,6 +21,7 @@
|
|||
// CGAL
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
|
||||
// This package
|
||||
|
|
@ -57,18 +59,30 @@ void test_pca(const std::vector<Point>& points, // input point set
|
|||
std::vector<Normal>& normals, // computed normals
|
||||
unsigned int k) // number of neighbors
|
||||
{
|
||||
std::cerr << " Estimate normals using KNN and point-based PCA...";
|
||||
std::cerr << "Estimate normals using KNN and point-based PCA..." << std::endl;
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
|
||||
CGAL::estimate_normals_pca_3(points.begin(),points.end(),std::back_inserter(normals),k);
|
||||
std::cerr << "ok" << std::endl;
|
||||
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "ok: " << task_timer.time() << " seconds, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void test_jet_fitting(const std::vector<Point>& points, // input point set
|
||||
std::vector<Normal>& normals, // computed normals
|
||||
unsigned int k) // number of neighbors)
|
||||
std::vector<Normal>& normals, // computed normals
|
||||
unsigned int k) // number of neighbors)
|
||||
{
|
||||
std::cerr << " Estimate normals using KNN and jet fitting...";
|
||||
std::cerr << "Estimate normals using KNN and jet fitting..." << std::endl;
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
|
||||
CGAL::estimate_normals_jet_fitting_3(points.begin(),points.end(),std::back_inserter(normals),k);
|
||||
std::cerr << "ok" << std::endl;
|
||||
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "ok: " << task_timer.time() << " seconds, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void test_orient_normals_MST(
|
||||
|
|
@ -76,7 +90,8 @@ void test_orient_normals_MST(
|
|||
std::vector<Normal>& normals, // normals to orient
|
||||
unsigned int k) // number of neighbors
|
||||
{
|
||||
std::cerr << " Orient normals using a minimum spanning tree...";
|
||||
std::cerr << "Orient normals using a minimum spanning tree..." << std::endl;
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
|
||||
// orient_normals_minimum_spanning_tree_3() requires an iterator over points
|
||||
// + property maps to access each point's index, position and normal.
|
||||
|
|
@ -89,7 +104,11 @@ void test_orient_normals_MST(
|
|||
boost::make_iterator_property_map(normals.begin(), index_id), // index -> normal prop. map
|
||||
k);
|
||||
|
||||
std::cerr << "ok" << std::endl;
|
||||
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "ok: " << task_timer.time() << " seconds, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -101,9 +120,11 @@ int main(int argc, char * argv[])
|
|||
{
|
||||
std::cerr << "Normal estimation test" << std::endl;
|
||||
std::cerr << "No output" << std::endl;
|
||||
|
||||
char* leak1 = new char[100];
|
||||
|
||||
// decode parameters
|
||||
if(argc < 2)
|
||||
if (argc-1 == 0)
|
||||
{
|
||||
std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz ..." << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -119,9 +140,11 @@ int main(int argc, char * argv[])
|
|||
{
|
||||
std::cerr << std::endl;
|
||||
|
||||
char* leak2 = new char[20];
|
||||
|
||||
// Load point set
|
||||
std::vector<Point> points;
|
||||
std::cerr << " Open " << argv[i] << " for reading...";
|
||||
std::cerr << "Open " << argv[i] << " for reading..." << std::endl;
|
||||
if(CGAL::surface_reconstruction_read_xyz(argv[i],
|
||||
std::back_inserter(points),
|
||||
false /*skip normals*/))
|
||||
|
|
@ -135,7 +158,7 @@ int main(int argc, char * argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cerr << " FATAL ERROR: cannot read file " << argv[i] << std::endl;
|
||||
std::cerr << "FATAL ERROR: cannot read file " << argv[i] << std::endl;
|
||||
accumulated_fatal_err = EXIT_FAILURE;
|
||||
}
|
||||
} // for each input file
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
// CGAL
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
|
||||
// This package
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
//----------------------------------------------------------
|
||||
// Test the Poisson Delaunay Reconstruction method
|
||||
// No output
|
||||
// Input files are .off and .xyz
|
||||
// Input file formats are .off and .xyz.
|
||||
// No output.
|
||||
//----------------------------------------------------------
|
||||
// poisson_reconstruction_test mesh1.off point_set2.xyz...
|
||||
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
// CGAL
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Memory_sizer.h>
|
||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
|
||||
// Surface mesher
|
||||
|
|
@ -74,7 +75,6 @@ int main(int argc, char * argv[])
|
|||
{
|
||||
std::cerr << "RECONSTRUCTION" << std::endl;
|
||||
std::cerr << "Test the Poisson Delaunay Reconstruction method" << std::endl;
|
||||
std::cerr << "No output" << std::endl;
|
||||
|
||||
//***************************************
|
||||
// decode parameters
|
||||
|
|
@ -83,33 +83,38 @@ int main(int argc, char * argv[])
|
|||
if (argc-1 == 0)
|
||||
{
|
||||
std::cerr << "Usage: " << argv[0] << " mesh1.off point_set2.xyz ..." << std::endl;
|
||||
return(EXIT_FAILURE);
|
||||
std::cerr << "Input file formats are .off and .xyz.\n";
|
||||
std::cerr << "No output." << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Surface Mesher options
|
||||
FT sm_angle = 20.0; // theorical guaranty if angle >= 30, but slower
|
||||
FT sm_radius = 0.1; // as suggested by LR
|
||||
FT sm_distance = 0.002; // AG: was 0.005 (upper bound of distance to surface/Poisson)
|
||||
FT sm_error_bound = 1e-3;
|
||||
// Surface Mesher options
|
||||
FT sm_angle = 20.0; // theorical guaranty if angle >= 30, but slower
|
||||
FT sm_radius = 0.1; // as suggested by LR
|
||||
FT sm_distance = 0.002; // AG: was 0.005 (upper bound of distance to surface/Poisson)
|
||||
FT sm_error_bound = 1e-3;
|
||||
|
||||
// Accumulated errors
|
||||
int accumulated_fatal_err = EXIT_SUCCESS;
|
||||
|
||||
//***************************************
|
||||
// Process each input file
|
||||
//***************************************
|
||||
|
||||
for (int arg_index = 1; arg_index <= argc-1; arg_index++)
|
||||
{
|
||||
std::cerr << std::endl;
|
||||
|
||||
//***************************************
|
||||
// Load mesh/point set
|
||||
//***************************************
|
||||
|
||||
// File name is:
|
||||
std::string input_filename = argv[arg_index];
|
||||
|
||||
// get extension
|
||||
std::string extension = input_filename.substr(input_filename.find_last_of('.'));
|
||||
|
||||
//***************************************
|
||||
// Load mesh/point set
|
||||
//***************************************
|
||||
|
||||
Dt3 dt;
|
||||
|
||||
if (extension == ".off" || extension == ".OFF")
|
||||
|
|
@ -194,6 +199,8 @@ int main(int argc, char * argv[])
|
|||
// Compute implicit function
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Compute implicit function...\n";
|
||||
|
||||
CGAL::Timer task_timer; task_timer.start();
|
||||
|
||||
// Create implicit function
|
||||
|
|
@ -203,21 +210,26 @@ int main(int argc, char * argv[])
|
|||
/// at each vertex of the triangulation
|
||||
if ( ! poisson_function.compute_implicit_function() )
|
||||
{
|
||||
std::cerr << "FATAL ERROR: cannot solve Poisson equation" << std::endl;
|
||||
std::cerr << "FATAL ERROR: cannot compute implicit function" << std::endl;
|
||||
accumulated_fatal_err = EXIT_FAILURE;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Print status
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
int nb_vertices2 = dt.number_of_vertices();
|
||||
std::cerr << "Solve Poisson equation: "
|
||||
<< "(added " << nb_vertices2-nb_vertices << " vertices)"
|
||||
<< std::endl;
|
||||
std::cerr << "Compute implicit function: " << "added " << nb_vertices2-nb_vertices << " Steiner points, "
|
||||
<< task_timer.time() << " seconds, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
//***************************************
|
||||
// Surface mesh generation
|
||||
//***************************************
|
||||
|
||||
std::cerr << "Surface meshing...\n";
|
||||
|
||||
STr tr; // 3D-Delaunay triangulation
|
||||
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation
|
||||
|
||||
|
|
@ -247,18 +259,23 @@ int main(int argc, char * argv[])
|
|||
CGAL::Surface_mesh_default_criteria_3<STr> criteria(sm_angle, // lower bound of facets angles (degrees)
|
||||
sm_radius*size, // upper bound of Delaunay balls radii
|
||||
sm_distance*size); // upper bound of distance to surface
|
||||
|
||||
std::cerr << "Implicit_surface_3(dichotomy error="<<sm_error_bound*size << ")\n";
|
||||
std::cerr << "make_surface_mesh(sphere={center=("<<sm_sphere_center << "), radius="<<sm_sphere_radius << "},\n"
|
||||
<< " criteria={angle="<<sm_angle << ", radius="<<sm_radius*size << ", distance="<<sm_distance*size << "},\n"
|
||||
<< " Non_manifold_tag())...\n";
|
||||
|
||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||
<< " angle="<<sm_angle << " degrees,\n"
|
||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||
<< " Non_manifold_tag)\n";
|
||||
|
||||
// meshing surface
|
||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||
|
||||
// Print status
|
||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Surface meshing: " << task_timer.time() << " seconds, "
|
||||
<< tr.number_of_vertices() << " vertices"
|
||||
<< tr.number_of_vertices() << " output vertices, "
|
||||
<< (memory>>20) << " Mb allocated"
|
||||
<< std::endl;
|
||||
task_timer.reset();
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
// CGAL
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Timer.h>
|
||||
|
||||
// This package
|
||||
#include <CGAL/smooth_jet_fitting_3.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue