CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   libnurbs++ (https://www.cfd-online.com/Forums/openfoam-solving/100330-libnurbs.html)

kuczmas April 24, 2012 03:51

libnurbs++
 
Dear forumers!

I want to create a NURBS surface from a cloud of points, using the least squares method. As far as I am concerned, such capabilities are available in libnurbs++ library, which I downloaded from:
http://libnurbs.sourceforge.net/old/index.shtml
Even I managed to compile it, after some manipulations.
I wanted to ask if anyone used this library to create and manipulate nurbs surfaces? Any help would be much appreciated!

Thanks in advance!

olivierG April 24, 2012 11:15

hello,

I have not tested by myself, but you may take a look at MeshLab.

regards,
olivier

hannes April 25, 2012 14:25

Hello,

I have used it in for creating surfaces from sample points.
For visualization and further processing I convert the resulting data into OpenCASCADE data structures.
Initially, I tried to do the job using OpenCASCADE interpolation functions, but nurbs++ work a lot better for this.

Regards, Hannes

kuczmas May 8, 2012 11:07

Many thanks for quick reply!

Hannes, this is exactly what I intend to do, but I have got some problems just at the beginning during compilation of the library (I have gcc 4.4.3). The error message is the following:

Code:

d_surface.cpp:29: error: explicit instantiation of 'class  BasicList<PLib::InterPoint<double, 2> >' in namespace 'PLib'  (which does not enclose namespace '::')
d_surface.cpp:30: error: explicit instantiation of 'class  BasicList<PLib::InterPoint<double, 3> >' in namespace 'PLib'  (which does not enclose namespace '::')

When I erase those lines in the d_surface.cpp file, the compilation of the library goes fine. But then when I try to compile a simple program, which uses libnurbs, then I got the following error:

Code:

/home/pakuc/libnurbs/lib/libnurbsd.so: undefined reference to `BasicList<PLib::InterPoint<double, 2> >::add(PLib::InterPoint<double, 2> const&)'
/home/pakuc/libnurbs/lib/libnurbsd.so: undefined reference to `BasicList<PLib::InterPoint<double, 2> >::reset()'
/home/pakuc/libnurbs/lib/libnurbsd.so: undefined reference to `BasicList<PLib::InterPoint<double, 3> >::reset()'
/home/pakuc/libnurbs/lib/libnurbsd.so: undefined reference to `BasicList<PLib::InterPoint<double, 3> >::add(PLib::InterPoint<double, 3> const&)'

So it seems that lines which include BasicList<>::... functions can not be simply ommited. I've heard that there are some compilation issues of the libnurbs library with newer versions of gcc. Have you encountered simillar problems?

hannes May 8, 2012 15:37

Hello Pawel,

If I remember right, I didn't compile it myself but installed a *.deb-Package from the "cae-team" ppa.

I guess, it was this: https://launchpad.net/~cae-team/+archive/ppa

Regards, Hannes

Bandfrosch May 9, 2012 18:47

1 Attachment(s)
Hello Pawel,

you may also try this patch for nurbs++.
It makes gcc version 4.6.2 on OpenSUSE happy.
All is based on the Zip file found here:
http://libnurbs.sourceforge.net/old/index.shtml


* copy libnurbs++-3.0.11.patch.gz to the nurbs++ source directory
* gunzip it
* apply patch ( in terminal )

patch -p0 < libnurbs++-3.0.11.patch

* rebuild nurbs++ via make

Good luck !

kuczmas May 10, 2012 04:52

Thanks for help!

I have successfully installed the libnurbs++ from ppa archive and it works fine :-).

kuczmas May 14, 2012 06:33

Dear All,

What now I intend to do is to visualize the geometry, created by libnurbs++. I know there is an openGL extension to that library. I have encountered a problem when compiling a sample program topengl (which is provided with the libnurbs++ library), which uses some functions from rnubsGL.h file. The error message is the following:
Code:

g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-40 -I/usr/include/nurbs++ -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC Make/linux64GccDPDebug/my_topengl_v01.o -L/opt/openfoam171/lib/linux64GccDPDebug \
        -L/usr/lib    -lmatrix    -lmatrixI    -lmatrixN    -lnurbsd    -lnurbsf    -lGL    -lGLU    -lglut -lOpenFOAM -liberty -ldl  -ggdb3 -DFULLDEBUG -lm -o /home/pakuc/OpenFOAM/pakuc-1.7.1/applications/bin/linux64GccDPDebug/my_opengl_v01
Make/linux64GccDPDebug/my_topengl_v01.o: In function `NurbsViewer::initNurbsObjects(GLUnurbs*)':
/home/pakuc/OpenFOAM/pakuc-1.7.1/applications/my_tests/my_topengl_v01/my_topengl_v01.cpp:47: undefined reference to `PLib::NurbsCurveGL::read(std::basic_ifstream<char, std::char_traits<char> >&)'
/home/pakuc/OpenFOAM/pakuc-1.7.1/applications/my_tests/my_topengl_v01/my_topengl_v01.cpp:54: undefined reference to `PLib::NurbsCurveGL::read(std::basic_ifstream<char, std::char_traits<char> >&)'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `NurbsViewer::display()':
/home/pakuc/OpenFOAM/pakuc-1.7.1/applications/my_tests/my_topengl_v01/my_topengl_v01.cpp:94: undefined reference to `PLib::NurbsSurfaceGL::gluNurbs() const'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `NurbsCpolygonGL':
/usr/include/nurbs++/nurbsGL.h:691: undefined reference to `PLib::ObjectGL::ObjectGL()'
/usr/include/nurbs++/nurbsGL.h:691: undefined reference to `vtable for PLib::NurbsCpolygonGL'
/usr/include/nurbs++/nurbsGL.h:691: undefined reference to `PLib::cPolygonColorDefault'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `NurbsSpolygonGL':
/usr/include/nurbs++/nurbsGL.h:707: undefined reference to `PLib::ObjectGL::ObjectGL()'
/usr/include/nurbs++/nurbsGL.h:707: undefined reference to `vtable for PLib::NurbsSpolygonGL'
/usr/include/nurbs++/nurbsGL.h:707: undefined reference to `PLib::cPolygonColorDefault'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `~BoundingBoxGL':
/usr/include/nurbs++/nurbsGL.h:722: undefined reference to `vtable for PLib::BoundingBoxGL'
/usr/include/nurbs++/nurbsGL.h:722: undefined reference to `PLib::ObjectGL::~ObjectGL()'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `~NurbsGL':
/usr/include/nurbs++/nurbsGL.h:747: undefined reference to `vtable for PLib::NurbsGL'
/usr/include/nurbs++/nurbsGL.h:747: undefined reference to `PLib::ObjectListGL::~ObjectListGL()'
/usr/include/nurbs++/nurbsGL.h:747: undefined reference to `PLib::ObjectListGL::~ObjectListGL()'
/usr/include/nurbs++/nurbsGL.h:747: undefined reference to `PLib::ObjectListGL::~ObjectListGL()'
/usr/include/nurbs++/nurbsGL.h:747: undefined reference to `PLib::ObjectListGL::~ObjectListGL()'
/usr/include/nurbs++/nurbsGL.h:747: undefined reference to `PLib::ObjectGL::~ObjectGL()'
/usr/include/nurbs++/nurbsGL.h:747: undefined reference to `PLib::ObjectGL::~ObjectGL()'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `NurbsCurveGL':
/usr/include/nurbs++/nurbsGL.h:834: undefined reference to `PLib::NurbsGL::NurbsGL()'
/usr/include/nurbs++/nurbsGL.h:834: undefined reference to `vtable for PLib::NurbsCurveGL'
/usr/include/nurbs++/nurbsGL.h:834: undefined reference to `vtable for PLib::NurbsCurveGL'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `NurbsSurfaceGL':
/usr/include/nurbs++/nurbsGL.h:872: undefined reference to `PLib::NurbsGL::NurbsGL()'
/usr/include/nurbs++/nurbsGL.h:872: undefined reference to `vtable for PLib::NurbsSurfaceGL'
/usr/include/nurbs++/nurbsGL.h:872: undefined reference to `vtable for PLib::NurbsSurfaceGL'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `~NurbsSurfaceGL':
/usr/include/nurbs++/nurbsGL.h:877: undefined reference to `vtable for PLib::NurbsSurfaceGL'
/usr/include/nurbs++/nurbsGL.h:877: undefined reference to `vtable for PLib::NurbsSurfaceGL'
Make/linux64GccDPDebug/my_topengl_v01.o: In function `~NurbsCurveGL':
/usr/include/nurbs++/nurbsGL.h:832: undefined reference to `vtable for PLib::NurbsCurveGL'
/usr/include/nurbs++/nurbsGL.h:832: undefined reference to `vtable for PLib::NurbsCurveGL'
collect2: ld returned 1 exit status
make: *** [/home/pakuc/OpenFOAM/pakuc-1.7.1/applications/bin/linux64GccDPDebug/my_opengl_v01] Błąd 1

Has anyone used openGL together with libnurbs++? Hannes, have you used openGL, or exlusively openCASCADE for visualization?


All times are GMT -4. The time now is 11:14.