-
Could you help me with how to perform the operation of squeezing a closed contour into along a certain vector? I saw something similar in the help about this: Also, it seems to me that I found a solution for a person faced with a similar task, but since he could only find an independent solution, I would like to know if there is something similar in the library? I also found this code sample in the examples in Polygon_mesh_processing/extrude.cpp int main(int argc, char* argv[])
{
SM in, out;
std::string filename = (argc > 1) ? std::string(argv[1]) : CGAL::data_file_path("meshes/cube-ouvert.off");
double vlen = (argc > 2) ? std::stod(argv[2]) : 0.1;
CGAL::IO::read_polygon_mesh(filename, in);
VNMap vnormals = in.template add_property_map<vertex_descriptor, Vector>("v:normals", CGAL::NULL_VECTOR).first;
CGAL::Polygon_mesh_processing::compute_vertex_normals(in, vnormals);
Bottom bottom(get(CGAL::vertex_point,out), vnormals, vlen);
Top top(get(CGAL::vertex_point,out), vnormals, vlen);
CGAL::Polygon_mesh_processing::extrude_mesh(in, out, bottom, top);
filename = filename.substr(filename.find_last_of("/") + 1, filename.length() - 1);
filename = filename.substr(0, filename.find_last_of("."));
filename = filename + "_" + std::to_string(vlen) + ".off";
CGAL::IO::write_polygon_mesh(filename, out, CGAL::parameters::stream_precision(17));
return 0;
} But I did not fully understand what Top and Bottom mean and how to fill them correctly (for example, my extrusion profile consists of 5 Point3 points) Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The complete example you mentioned is here. The input (in blue) is a cube with a missing face. Topologically speaking, the extrude function will take a first copy mesh, then a second copy, reverse its orientation and stitch with a triangle strip the first copy and the reversed copy. |
Beta Was this translation helpful? Give feedback.
The complete example you mentioned is here.
Here is the output clipped so that we can see what is going on.
The input (in blue) is a cube with a missing face. Topologically speaking, the extrude function will take a first copy mesh, then a second copy, reverse its orientation and stitch with a triangle strip the first copy and the reversed copy.
Top and bottom functors will act on the geometry of the vertices of the two copies. In the case of the example, the vertices are moved along the normal to the surface, in opposite directions for the two surfaces, thus the input being sandwiched by the output.