Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Problems with Delaunay_triangulation_2 when compiling as DLL
Chronological Thread
- From: Claus Volko <>
- To:
- Subject: Re: [cgal-discuss] Problems with Delaunay_triangulation_2 when compiling as DLL
- Date: Fri, 13 Oct 2023 06:40:54 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-data: A9a23:QhxkBKu1cBCfd6+ipSVtb07I0ufnVCJbMUV32f8akzHdYApBsoF/q tZmKW/UaPzbZmqgKtEiOYux/UME7JGBzoc3QQVopSlmEyoXgMeUXt7xwmXYb3rDdJWbJK5Ex 5xDMYeYdJhcolv0/ErF3m3J9CEkvU2wbuOgTrSCYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj7yyHlEAbNNwVcbCRMsMpvlDs15K6p4WtB5QRnDRx2lAa2e0c9XMp3yZ6ZdCOQrrl8RoaSW +vFxbelyWLVlz9F5gSNz94X2mVTKlLjFVDmZkh+A8BOsTAezsAG6ZvXAdJHAathZ5plqPgqo DlFncTYpQ7EpcQgksxFO/VTO3kW0aGrZNYriJVw2CCe5xSuTpfi/xlhJEA5Y9AC38BNPUFh+ dc7KRE2U0CipMvjldpXSsE07igiBMziPYdavnM5iD+AUqlgTpfETKHHo9Rf2V/chOgURaeYN 5dfM2I/Kk2fPHWjOX9PYH46tOykmH77cDpwp1ecpK5x6G/WpOB0+OG2aYKNJIfUFa25mG6pp FDvvGPJJS0eKY270Sie9X+Jp8DAyHaTtIU6UefQGuRRqFacz2hWBBwNXkagutGim0umUpReL VYV82wgt8APGFeDS9D8W1i8oifBsEdDBJxfFOo17AzLwa3Ri+qEOlU5ovd6QIROnKcLqfYCj zdlRvu4XmA9g67fUn+H6LafoBW7PCVffydIZjYJQUFBq5PvqZ06xECHBNtyMr+HvvusExHJw heOsHcfgZcXhpU1zKmVxw3MrA+tgZnrdTQLwDvrcFir1D4kW779VbeUsQDayd1iMLemSkKwu SlYusqGs8ELI5K/tA2M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8AcPS3TMGVy0QkSvJKc+dvha1vCNt/Ii597zwVQTj6JHqafMaOMhz+x2wnaaIN vKBzCd/JzFC05oQxHjOgLEB1V8WgitqenGjC7MF/SLKSavRnOdQAXt5I2trM9BU6qsnwgRXE cvSi9ew0rwhy/BsVAgDWlvmlcWkI8cNJiD1NV/KAlqKKKXTJTDPxJKSA+v0QrlRgeNI8hyo7 GzDQgmzY3LZz2mvDk/wYoQuxGmBMRdTuZ+waENoAGnnFpf9bwGjdcVwhnswyKE1gXXDMSgdN yJ9egVDtO71j2sQj/NhFmhG9ncgI/ODnnPT5OXGLZIVttNkBy11k6RR53FwmN43pGlUAed4n ifftIsku1a9juyG0SZqSjJLozdPwYaJ5ABsYPqGsJZHXnnA8VQG6mDaWHFo75N1T9bova5X0 N3Gkqn+fSxD/9zj9swZH8HIKciDPRLJ3jLmHTfVCE0OSjv5bAk3ZmRYmfCWs3mX990088ez3 pUJTbBfWRo+EfZIUiyN+fQNJZ52WnUvlrvJ1KY1
- Ironport-sdr: 6528ca6a_loaL12gmNMWgDQGsr0/gx/2qqQZ883rFCbKrCluw8u6asMp SYVr2Ow286MoEW4nngg7G0a42T+bixxjd4iNw1A==
I'm now trying this variant:
CGAL::Surface_mesh<Point_3> create_tree()
{
using Mesh = CGAL::Surface_mesh<Point_3>;
Mesh mesh;
CGAL::copy_face_graph(polygon_mesh, mesh);
Tree tree(faces(mesh).first, faces(mesh).second, mesh);
std::vector<Point_3> points;
for (auto x = -1000; x < +1000; x++)
for (auto z = -1000; z < +1000; z++)
{
Point_3 point(x, +20, z);
points.push_back(point);
Point_3 point1(x, -10, z);
Line_3 line(point, point1);
Ray ray(point, line);
auto intersection = tree.first_intersection(ray);
if (intersection)
{
const Point_3* p = boost::get<Point_3>(&(intersection->first));
if (p) points.push_back(*p);
}
}
CGAL::Surface_mesh<Point_3> output_mesh;
std::string fname = "c:\\temp\\newmesh.xyz";
CGAL::IO::write_XYZ(fname, points);
Point_set points1;
std::ifstream stream(fname, std::ios_base::binary);
stream >> points1;
std::cout << "Reconstructing surface" << std::endl;
typedef std::array<std::size_t, 3> Facet; // Triple of indices
std::vector<Facet> facets;
// The function is called using directly the points raw iterators
CGAL::advancing_front_surface_reconstruction(points1.points().begin(),
points1.points().end(),
std::back_inserter(facets));
std::cout << facets.size()
<< " facet(s) generated by reconstruction." << std::endl;
// copy points for random access
std::vector<Point_3> vertices;
vertices.reserve(points1.size());
std::copy(points1.points().begin(), points1.points().end(), std::back_inserter(vertices));
CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(vertices, facets, output_mesh);
std::cout << "Returning output mesh" << std::endl;
return output_mesh;
}
{
using Mesh = CGAL::Surface_mesh<Point_3>;
Mesh mesh;
CGAL::copy_face_graph(polygon_mesh, mesh);
Tree tree(faces(mesh).first, faces(mesh).second, mesh);
std::vector<Point_3> points;
for (auto x = -1000; x < +1000; x++)
for (auto z = -1000; z < +1000; z++)
{
Point_3 point(x, +20, z);
points.push_back(point);
Point_3 point1(x, -10, z);
Line_3 line(point, point1);
Ray ray(point, line);
auto intersection = tree.first_intersection(ray);
if (intersection)
{
const Point_3* p = boost::get<Point_3>(&(intersection->first));
if (p) points.push_back(*p);
}
}
CGAL::Surface_mesh<Point_3> output_mesh;
std::string fname = "c:\\temp\\newmesh.xyz";
CGAL::IO::write_XYZ(fname, points);
Point_set points1;
std::ifstream stream(fname, std::ios_base::binary);
stream >> points1;
std::cout << "Reconstructing surface" << std::endl;
typedef std::array<std::size_t, 3> Facet; // Triple of indices
std::vector<Facet> facets;
// The function is called using directly the points raw iterators
CGAL::advancing_front_surface_reconstruction(points1.points().begin(),
points1.points().end(),
std::back_inserter(facets));
std::cout << facets.size()
<< " facet(s) generated by reconstruction." << std::endl;
// copy points for random access
std::vector<Point_3> vertices;
vertices.reserve(points1.size());
std::copy(points1.points().begin(), points1.points().end(), std::back_inserter(vertices));
CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(vertices, facets, output_mesh);
std::cout << "Returning output mesh" << std::endl;
return output_mesh;
}
It seems that these two lines are not working if I compile as DLL:
auto intersection = tree.first_intersection(ray);
CGAL::advancing_front_surface_reconstruction(points1.points().begin(), points1.points().end(), std::back_inserter(facets));
Am Do., 12. Okt. 2023 um 09:14 Uhr schrieb Claus Volko <>:
I also tried this instead of Delaunay_triangulation_2, but it seems to hang (no progress for more than 20 minutes).Polyhedron create_tree()
{
using Mesh = CGAL::Surface_mesh<Point_3>;
Mesh mesh;
CGAL::copy_face_graph(polygon_mesh, mesh);
Tree tree(faces(mesh).first, faces(mesh).second, mesh);
std::vector<Point_3> points;
for (double x = -1000; x < +1000; x++)
for (double z = -1000; z < +1000; z++)
{
Point_3 point(x, +20, z);
Point_3 point1(x, -10, z);
Line_3 line(point, point1);
Ray ray(point, line);
auto intersection = tree.first_intersection(ray);
if (intersection)
{
const Point_3* p = boost::get<Point_3>(&(intersection->first));
if (p) points.push_back(*p);
}
}
CGAL::IO::write_XYZ("c:\\temp\\newmesh.xyz", points);
std::vector<Pwn> points1;
CGAL::IO::read_points("c:\\temp\\newmesh.xyz", std::back_inserter(points1),
CGAL::parameters::point_map(CGAL::First_of_pair_property_map<Pwn>())
.normal_map(CGAL::Second_of_pair_property_map<Pwn>()));
double average_spacing = CGAL::compute_average_spacing<CGAL::Sequential_tag>
(points1, 6, CGAL::parameters::point_map(CGAL::First_of_pair_property_map<Pwn>()));
std::cout << "Reconstructing poisson surface" << std::endl;
Polyhedron output_mesh;
CGAL::poisson_surface_reconstruction_delaunay
(points1.begin(), points1.end(),
CGAL::First_of_pair_property_map<Pwn>(),
CGAL::Second_of_pair_property_map<Pwn>(),
output_mesh, average_spacing);
std::cout << "Returning output mesh" << std::endl;
return output_mesh;
}Am Do., 12. Okt. 2023 um 06:42 Uhr schrieb Claus Volko <>:I attached the code I am trying to compile. When compiling it as EXE it works but not as DLL. The problem seems to be related to the code line where I define a TIN (using Delaunay_triangulation_2). When I include the DLL in a C# project and call region_growing_algorithm from there, I get the error message "Module not found". This does not happen when I outcomment USE_TREE. What's wrong with TIN?
--
--
- Re: [cgal-discuss] Problems with Delaunay_triangulation_2 when compiling as DLL, Claus Volko, 10/12/2023
- Re: [cgal-discuss] Problems with Delaunay_triangulation_2 when compiling as DLL, Claus Volko, 10/13/2023
- Re: [cgal-discuss] Problems with Delaunay_triangulation_2 when compiling as DLL, Claus Volko, 10/13/2023
- Re: [cgal-discuss] Problems with Delaunay_triangulation_2 when compiling as DLL, Claus Volko, 10/13/2023
Archive powered by MHonArc 2.6.19+.