Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 24, 2026·3 min de lectura

CGAL — Computational Geometry Algorithms Library

CGAL provides reliable and efficient geometric algorithms in C++ for applications in meshing, point cloud processing, shape analysis, and scientific computing.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
CGAL
Comando de instalación directa
npx -y tokrepo@latest install 4d8c3370-87a2-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

CGAL is an open-source C++ library that provides robust, efficient implementations of geometric algorithms. Used across academia and industry for meshing, shape reconstruction, geometry processing, and spatial indexing, it emphasizes exact computation to avoid floating-point failures.

What CGAL Does

  • Computes Delaunay triangulations, Voronoi diagrams, and convex hulls in 2D and 3D
  • Generates surface and volume meshes with quality guarantees for simulation workflows
  • Processes point clouds with reconstruction, simplification, and normal estimation
  • Performs Boolean operations on polygonal meshes (union, intersection, difference)
  • Provides spatial search structures including kd-trees and range trees

Architecture Overview

CGAL is organized as a collection of packages, each implementing a family of geometric algorithms. It uses exact arithmetic kernels (via GMP/MPFR) to guarantee correct geometric predicates, avoiding robustness issues that plague floating-point geometry. A traits-based design lets users swap kernels for performance vs. exactness tradeoffs.

Self-Hosting & Configuration

  • Install headers and link against CGAL, GMP, and MPFR libraries
  • Available through apt, Homebrew, vcpkg, Conan, and conda-forge
  • Header-only for many packages; only a few require compiled library components
  • Choose between exact (Exact_predicates_exact_constructions_kernel) and fast (Exact_predicates_inexact_constructions_kernel) computation kernels
  • Integrates with CMake via find_package(CGAL)

Key Features

  • Exact geometric computation prevents robustness failures in degenerate cases
  • Comprehensive coverage: triangulations, meshes, arrangements, Boolean ops, and more
  • Industrial-grade mesh generation for FEM, CFD, and 3D printing applications
  • Extensive point cloud processing for LiDAR and photogrammetry pipelines
  • Active development with regular releases and long-term maintenance

Comparison with Similar Tools

  • Boost.Geometry — Boost.Geometry covers basic 2D operations; CGAL provides deeper algorithms including 3D meshing and exact computation
  • Open3D — Open3D focuses on 3D data visualization and learning; CGAL specializes in rigorous computational geometry
  • libigl — libigl targets geometry processing research with Eigen integration; CGAL offers broader algorithm coverage with exactness guarantees
  • VTK — VTK is a visualization toolkit; CGAL provides the underlying geometric computation that VTK can display

FAQ

Q: Why does CGAL use exact arithmetic? A: Floating-point errors can cause geometric predicates to return wrong results, leading to crashes or invalid output. Exact arithmetic eliminates this class of bugs.

Q: Is CGAL fast despite exact arithmetic? A: Yes. CGAL uses lazy evaluation and filtered kernels that fall back to exact arithmetic only when needed, keeping most computations fast.

Q: What license does CGAL use? A: CGAL uses a dual license: GPL for open-source projects and a commercial license for proprietary use.

Q: Can CGAL process large point clouds? A: Yes. CGAL's point cloud packages handle millions of points with spatial indexing and stream processing.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados