Problems with CGAL property maps

Open
#9,030 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 3 days

@MaelRL is already working on this.

Since Sep 17, 2025.

Assessment

This issue has not been assessed yet.

Description

Pkg::BGL Pkg::Property_map

Issue Details

  1. The functions CGAL::get_property_map() and CGAL::get_const_property_map() are used in several examples, but they are not documented. These functions call in turn CGAL::get(). I find the call to get() adequate in most places , and not only in the examples. The difference is that if an internal property map does not exist, the former variants return empty maps. Is it possible at all that an internal vertex->point property map does not exist in an instance of Polyhedron_3 or Surface_mesh?

In other words, these functions should be either documented or not used (at least in examples), and perhaps even removed all together.

  1. As mentioned above, the function that should be used instead in most if not all places is get(). This template function is mentioned in the user manual of the BGL package; see Propery Maps. However, it is not documented in the reference manual. (It should, because it is in namespace CGAL.)

  2. The Polyhedron_3 is a model of the concepts FaceListGraph and MutableFaceGraph. One can obtain a vertex->point_3 internal property map using the following sequence:

#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_traits_with_normals_3.h>

using Traits = CGAL::Polyhedron_traits_with_normals_3<Kernel>;
using Mesh = CGAL::Polyhedron_3<Traits>;
Traits traits(kernel);
Mesh mesh(traits);
auto pm = CGAL::get(CGAL::vertex_point, mesh);

I would expect to have a similar mechanism that enables the user to obtain either a face->normal_3 or a face->plane_3 property maps depending on the input mesh Polyhedron_3 instance. This brings me back to the first issue above. It seems that in this case the functions CGAL::get_property_map() and CGAL::get_const_property_map() are useful, because only one map of the two (either ->vector_3 or ->plane_3) can exist.

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits):
  • Compiler:
  • Release or debug mode:
  • Specific flags used (if any):
  • CGAL version: latest
  • Boost version:
  • Other libraries versions if used (Eigen, TBB, etc.):
Dominant language
C++
Stars
6.1k
Forks
1.6k
Avg merge
3d 19h
Merged PRs (30d)
55

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CGAL/cgal

All issues in CGAL/cgal

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.