Skip to content

Instantly share code, notes, and snippets.

@afabri
Created January 6, 2022 15:26
Show Gist options
  • Save afabri/827106024fd6b89fbacd6b2bbb7b3f94 to your computer and use it in GitHub Desktop.
Save afabri/827106024fd6b89fbacd6b2bbb7b3f94 to your computer and use it in GitHub Desktop.
#include <Eigen/Dense>
#include <cgal_vector_util.h>
#include <cgal_mesh_util.h>
int main()
{
std::vector<CGAL_Polyline> polylines;
CGAL_Polyline p1 { IK::Point_3(-250.000, -161.482, -7.500),
IK::Point_3(-250.000, -156.153, -7.500),
IK::Point_3(-194.444, -154.323, -7.500),
IK::Point_3(-194.198, -161.819, -7.500),
IK::Point_3(-138.642, -159.989, -7.500),
IK::Point_3(-138.889, -152.493, -7.500),
IK::Point_3(-83.333, -150.662, -7.500),
IK::Point_3(-27.778, -152.493, -7.500),
IK::Point_3(-28.025, -159.989, -7.500),
IK::Point_3(27.531, -161.819, -7.500),
IK::Point_3(27.778, -154.323, -7.500),
IK::Point_3(83.333, -156.153, -7.500),
IK::Point_3(83.333, -157.929, -7.500),
IK::Point_3(75.833, -157.929, -7.500),
IK::Point_3(75.833, -159.705, -7.500),
IK::Point_3(83.333, -159.705, -7.500),
IK::Point_3(83.333, -161.482, -7.500),
IK::Point_3(-250.000, -161.482, -7.500),
};
CGAL_Polyline p2 {
IK::Point_3(-250.000, -161.482, 7.500),
IK::Point_3(-250.000, -156.153, 7.500),
IK::Point_3(-194.444, -154.323, 7.500),
IK::Point_3(-194.198, -161.819, 7.500),
IK::Point_3(-138.642, -159.989, 7.500),
IK::Point_3(-138.889, -152.493, 7.500),
IK::Point_3(-83.333, -150.662, 7.500),
IK::Point_3(-27.778, -152.493, 7.500),
IK::Point_3(-28.025, -159.989, 7.500),
IK::Point_3(27.531, -161.819, 7.500),
IK::Point_3(27.778, -154.323, 7.500),
IK::Point_3(83.333, -156.153, 7.500),
IK::Point_3(83.333, -157.929, 7.500),
IK::Point_3(75.833, -157.929, 7.500),
IK::Point_3(75.833, -159.705, 7.500),
IK::Point_3(83.333, -159.705, 7.500),
IK::Point_3(83.333, -161.482, 7.500),
IK::Point_3(-250.000, -161.482, 7.500),
};
polylines.push_back(p1);
polylines.push_back(p2);
cgal_mesh_util::closed_mesh_from_polylines(polylines);
return 0;
}
cmake_minimum_required(VERSION 3.1...3.22)
project(cdt)
include_directories(BEFORE ../src )
find_package(CGAL REQUIRED)
find_package(Boost REQUIRED)
find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
include(CGAL_Eigen3_support)
if(NOT TARGET CGAL::Eigen3_support)
message(
STATUS "This project requires the Eigen library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
target_link_libraries(cdt PUBLIC CGAL::Eigen3_support)
endforeach()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment