Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL Examples using Eigen

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL Examples using Eigen


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL Examples using Eigen
  • Date: Thu, 07 Jul 2016 10:26:20 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:KcLJJhzstzRmDELXCy+O+j09IxM/srCxBDY+r6Qd0e8UIJqq85mqBkHD//Il1AaPBtSDragUw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdJs/yahXor2Go6nZKQ1OkZFIzfLS9M7WRpvz/7/q19ZzXblcArxuGSpQ2Ei+Lqx7MvNIdm4poJ/V54BLIpnxVZ7YenjswdhrA1yr7s8y/9Zom/yVLsO867OZBV7/7duI2V+92FjMjZioO6cfirgXCQA3HwnwGU2IK2lpnDg/A4Q3gT7n4uTf9rPs8kmHOJsnxV7EzRXKn649kTRbpjGEMMDtvozKfsdB5kK8O+EHpnBd42YOBOIw=
  • Organization: GeometryFactory

Code looks OK except normals.
We need to see the "24 unresolved externals" to help here.


On 07/07/2016 09:39 AM, Kelvin_Piroddi wrote:
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.





Archive powered by MHonArc 2.6.18.

Top of Page