Skip to content

Commit

Permalink
Merge pull request #156 from nschloe/cgal-5.3
Browse files Browse the repository at this point in the history
update for CGAL 5.3
  • Loading branch information
nschloe authored Sep 21, 2021
2 parents 46e844b + 5b35bf8 commit 8f3d504
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default:

tag:
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "{{version}}"}' https://api.github.com/repos/nschloe/meshio/releases
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "{{version}}"}' https://api.github.com/repos/nschloe/pygalmesh/releases

upload: clean
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pygalmesh
version = 0.9.5
version = 0.9.6
author = Nico Schlömer
author_email = [email protected]
description = Python frontend to CGAL's mesh generation capabilities
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pybind11_add_module(pygalmesh ${pygalmesh_SRCS})
# ADD_LIBRARY(pygalmesh ${pygalmesh_SRCS})
target_link_libraries(pygalmesh PRIVATE ${CGAL_LIBRARIES})

# https://github.com/CGAL/cgal/issues/6002
# find_program(iwyu_path NAMES include-what-you-use iwyu REQUIRED)
# set_property(TARGET pygalmesh PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${iwyu_path})

# execute_process(
# COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
# OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
Expand Down
17 changes: 15 additions & 2 deletions src/generate_from_off.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup.h>
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
#include <CGAL/Polygon_mesh_processing/orientation.h>
#include <CGAL/IO/OFF_reader.h>

#include <CGAL/version_macros.h>

#if CGAL_VERSION_MAJOR >= 5 && CGAL_VERSION_MINOR < 3
#include <CGAL/IO/OFF_reader.h>
#endif

// for sharp features
//#include <CGAL/Polyhedral_mesh_domain_with_features_3.h>
Expand Down Expand Up @@ -69,7 +74,15 @@ void generate_from_off(
std::vector<K::Point_3> points;
std::vector<std::vector<std::size_t> > polygons;

if(!input || !CGAL::read_OFF(input, points, polygons) || points.empty())
if(
!input ||
#if CGAL_VERSION_MAJOR >= 5 && CGAL_VERSION_MINOR >= 3
!CGAL::IO::read_OFF(input, points, polygons) ||
#else
!CGAL::read_OFF(input, points, polygons) ||
#endif
points.empty()
)
{
std::stringstream msg;
msg << "Cannot read .off file \"" << infile <<"\""<< std::endl;
Expand Down

0 comments on commit 8f3d504

Please sign in to comment.