You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm asking to add another property to the Named Parameters for the split_long_edges() function, which is similar to face_patch_map, but for the edges that the function will split.
I'm working with geometry from CAD. For each model I have face_patch_map for triangles and edge_polyline_map with boost::graph_traits<PolygonMesh>::edge_descriptor as key type and int as value type.
I want the edges resulting from the splitting of edges belonging to a polyline to retain that property (i.e. the index of the polyline).
At the moment I'm solving this problem by assigning patch indices to the triangles around the polylines, but I think it would be as simple as the face_patch_map_solution.
Source Code
#include<iostream>
#include<CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include<CGAL/Polygon_mesh_processing/remesh.h>
#include<CGAL/Surface_mesh.h>typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef CGAL::Surface_mesh<Point> Mesh;
typedef Mesh::Vertex_index vertex_descriptor;
typedef Mesh::Edge_index edge_descriptor;
typedef Mesh::Face_index face_descriptor;
intmain() {
Mesh m;
// triangle
vertex_descriptor v1 = m.add_vertex(Point(0, 0, 0));
vertex_descriptor v2 = m.add_vertex(Point(1, 0, 0));
vertex_descriptor v3 = m.add_vertex(Point(0, 1, 0));
face_descriptor f = m.add_face(v1, v2, v3);
// edge polyline mapauto e2p = m.add_property_map<edge_descriptor, int>("e:polyline", -1).first;
// mark the edges on the line between p and qPointp(1, 0, 0);
Pointq(0, 1, 0);
for (auto e : m.edges()) {
Point p1 = m.point(m.vertex(e, 0));
Point p2 = m.point(m.vertex(e, 1));
if (CGAL::collinear(p, q, p1) && CGAL::collinear(p, q, p2))
e2p[e] = 1;
}
std::cout << "edge polyline map before splitting\n";
for (auto e : m.edges()) {
Point p1 = m.point(m.vertex(e, 0));
Point p2 = m.point(m.vertex(e, 1));
std::cout << e.idx() << '\t' << e2p[e] << "\t(" << p1 << ")\t(" << p2 << ")\n";
}
CGAL::Polygon_mesh_processing::split_long_edges(m.edges(), 1.0, m);
std::cout << "edge polyline map after splitting\n";
for (auto e : m.edges()) {
Point p1 = m.point(m.vertex(e, 0));
Point p2 = m.point(m.vertex(e, 1));
std::cout << e.idx() << '\t' << e2p[e] << "\t(" << p1 << ")\t(" << p2 << ")\n";
}
return0;
}
Issue Details
My issue is similar to Add face_patch_map as NP to split_long_edges().
I'm asking to add another property to the
Named Parameters
for thesplit_long_edges()
function, which is similar toface_patch_map
, but for the edges that the function will split.I'm working with geometry from CAD. For each model I have
face_patch_map
for triangles andedge_polyline_map
withboost::graph_traits<PolygonMesh>::edge_descriptor
as key type andint
as value type.I want the edges resulting from the splitting of edges belonging to a polyline to retain that property (i.e. the index of the polyline).
At the moment I'm solving this problem by assigning patch indices to the triangles around the polylines, but I think it would be as simple as the face_patch_map_solution.
Source Code
The current output:
I expect it like
Environment
The text was updated successfully, but these errors were encountered: