Subject: CGAL users discussion list
List archive
- From: Kelvin_Piroddi <>
- To:
- Subject: Re: [cgal-discuss] CGAL Examples using Eigen
- Date: Thu, 7 Jul 2016 00:39:18 -0700 (PDT)
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=None
- Ironport-phdr: 9a23:++dhPh2T9OSCO2iismDT+DRfVm0co7zxezQtwd8ZsegVLPad9pjvdHbS+e9qxAeQG96Ks7Qe1KGP6f2ocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+kQsiI0I/ujb360qaQSj0AvCC6b7J2IUf+hiTqne5Sv7FfLL0swADCuHpCdrce72ppIVWOg0S0vZ/or9YwuxhX7vku/soFXaThdLkjVpRZCi4nOiY7/p7Frx7GGCiC4mUdVFIukwBPDwTEpEX5RpbrtSf2t8Jy3SCbOYv9SrViCmfq1LtiVBK90HRPDDU+6myC0sE=
The Code is:
#define CGAL_EIGEN3_ENABLED
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/pca_estimate_normals.h>
#include <CGAL/mst_orient_normals.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/read_xyz_points.h>
#include <CGAL/Poisson_reconstruction_function.h>
#include <CGAL/trace.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Implicit_surface_3.h>
#include <CGAL/IO/output_surface_facets_to_polyhedron.h>
#include <CGAL/Point_with_normal_3.h>
#include <CGAL/compute_average_spacing.h>
#include <Eigen/Eigen>
#include <CGAL/Eigen_solver_traits.h>
#include <utility> // defines std::pair
#include <list>
#include <fstream>
// Types
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef CGAL::Poisson_reconstruction_function<Kernel>
Poisson_reconstruction_function;
typedef CGAL::Surface_mesh_default_triangulation_3 STr;
typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
typedef CGAL::Implicit_surface_3<Kernel, Poisson_reconstruction_function>
Surface_3;
// Concurrency
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// Point with normal vector stored in a std::pair.
typedef std::pair<Point, Vector> PointVectorPair;
int main()
{
// Reads a .txt point set file in points[].
std::list<PointVectorPair> points;
std::cout << "Begin Reading" << std::endl;
std::ifstream stream("Apples1.txt");
if (!stream ||
!CGAL::read_xyz_points(stream,
std::back_inserter(points),
CGAL::First_of_pair_property_map<PointVectorPair>()))
std::cout << "reading done" << std::endl;
const int nb_neighbors = 18;
CGAL::pca_estimate_normals<Concurrency_tag>(points.begin(),
points.end(),
CGAL::First_of_pair_property_map<PointVectorPair>(),
CGAL::Second_of_pair_property_map<PointVectorPair>(),
nb_neighbors);
std::list<PointVectorPair>::iterator unoriented_points_begin =
CGAL::mst_orient_normals(points.begin(), points.end(),
CGAL::First_of_pair_property_map<PointVectorPair>(),
CGAL::Second_of_pair_property_map<PointVectorPair>(),
nb_neighbors);
// Optional: delete points with an unoriented normal
// if you plan to call a reconstruction algorithm that expects oriented
normals.
points.erase(unoriented_points_begin, points.end());
std::cout << points.size() << std::endl;
//std::cout << points[0].first.x() << std::endl;
Poisson_reconstruction_function function(points.begin(), points.end(),
CGAL::First_of_pair_property_map<PointVectorPair>(),
CGAL::Second_of_pair_property_map<PointVectorPair>());
// Computes the Poisson indicator function f()
// at each vertex of the triangulation.
if (!function.compute_implicit_function() )
return EXIT_FAILURE;
return 0;
}
My profile file looks like this:
QT += core
QT -= gui
CONFIG += c++11
TARGET = begin
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:/boost_1_61_0/boost_1_61_0
INCLUDEPATH += C:/dev/CGAL-4.8.1/include
INCLUDEPATH += C:/dev/CGAL-4.8.1/auxiliary/gmp/include
INCLUDEPATH += C:eigen/eigen
INCLUDEPATH += C:/dev/CGAL-4.8.1/buildnew/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/./release/
-lCGAL_Core-vc140-mt-gd-4.8.1
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/./debug/
-lCGAL_Core-vc140-mt-gd-4.8.1
INCLUDEPATH += $$PWD/debug
DEPENDPATH += $$PWD/debug
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/./release/
-lCGAL-vc140-mt-gd-4.8.1
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/./debug/
-lCGAL-vc140-mt-gd-4.8.1
INCLUDEPATH += $$PWD/debug
DEPENDPATH += $$PWD/debug
The Compilation error:
debug\begin.exe : fatal error LNK1120: 24 unresolved externals
jom: C:\Thesis\Start_code\begin\Makefile.Debug [debug\begin.exe] Error 1120
jom: C:\Thesis\Start_code\begin\Makefile [debug] Error 2
10:19:25: The process "C:\Qt\Qt5.7.0\Tools\QtCreator\bin\jom.exe" exited
with code 2.
Error while building/deploying project begin (kit: Desktop Qt 5.7.0 MSVC2015
32bit)
When executing step "Make"
Thank you
Kelvin Piroddi
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/CGAL-Examples-using-Eigen-tp4662030p4662036.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/06/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Kelvin_Piroddi, 07/07/2016
- Re: [cgal-discuss] CGAL Examples using Eigen, Sebastien Loriot (GeometryFactory), 07/07/2016
Archive powered by MHonArc 2.6.18.