Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Computational Geometry algorithm Library CGAL under Linux

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you the relevant knowledge points about how to install the computational geometry algorithm library CGAL under Linux. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

CGAL (Computational Geometry Algorithms Library) library, Computational Geometry algorithm Library, is a large C++ geometric data structure and algorithm library, including Delaunay triangulation, mesh generation, Boolean operation polygons, various geometric processing algorithms and so on. CGAL libraries are used in various fields: computer graphics, scientific visualization, computer-aided design and modeling, geographic information systems, molecular biology, medical imaging, robotics and motion planning, and numerical methods.

1. Installation dependency

Sudo apt-get install libboost-all-dev

Sudo apt-get install libgmp-dev

Sudo apt-get install libgmp3-dev

Sudo apt-get install libmpfr-dev

Sudo apt-get install geomview

Sudo apt install freeglut3 freeglut3-dev

Sudo apt-get install binutils-gold

Sudo apt-get install libglew-dev

Sudo apt-get install gathers +

Sudo apt-get install mesa-common-dev

Sudo apt-get install build-essential

Sudo apt-get install libeigen3-dev

Sudo apt-get install libtbb-dev

Sudo apt-get install zlib1g-dev

Sudo apt-get install libqt5svg5-dev

Second, install QT

If there are multiple versions of QT:

Sudo gedit / usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

Change it to the usual one:

/ home/cyfeng/Qt5.10.1/5.10.1/gcc_64/bin

/ home/cyfeng/Qt5.10.1/5.10.1/

Third, install libQGLViewer

The libQGLViewer installation method can be installed according to the method on the official website, using the QT5 installed above.

Fourth, install CGAL

My version: cgal-releases-CGAL-4.13.1

Other version: https://github.com/CGAL/cgal

Unzip CGAL-4.13.1.zip

Cd CGAL-4.13.1

Mkdir build

Cd build

Cmake..

Make-J4

Sudo make install

Check if there is a libCGAL_Qt5.so

Ls / usr/local/lib/libCGAL*

5. Testing

Create a new Qt Widgets application project (console application project will report an error and QApplication cannot be found)

Modify QT + = core gui xml opengl and add LIBS + =-lCGAL-lCGAL_Core-lgmp-lCGAL_Qt5 in .pro file

Main.cpp (the path of corner.off is modified by itself)

# define CGAL_USE_BASIC_VIEWER#include#include#include#include#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;typedef CGAL::Polyhedron_3 Polyhedron;int main (int argc, char* argv []) {Polyhedron P; std::ifstream in1 ((argc > 1)? argv [1]: "/ home/cyfeng/cgal-releases-CGAL-4.13.1/Polyhedron/examples/Polyhedron/data/corner.off"); in1 > > P; CGAL::draw (P); return EXIT_SUCCESS;}

These are all the contents of the article "how to install Computational Geometry algorithm Library CGAL under Linux". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report