Skip to content
Snippets Groups Projects
Commit 4cca60e2 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix clpy mesh for parameter ranges != [0,1]

parent ff0d11c3
No related branches found
No related tags found
No related merge requests found
...@@ -273,11 +273,15 @@ void copyMesh(GEdge *from, GEdge *to, int direction) ...@@ -273,11 +273,15 @@ void copyMesh(GEdge *from, GEdge *to, int direction)
double u_min = u_bounds.low(); double u_min = u_bounds.low();
double u_max = u_bounds.high(); double u_max = u_bounds.high();
Range<double> to_u_bounds = to->parBounds(0);
double to_u_min = to_u_bounds.low();
double to_u_max = to_u_bounds.high();
for(unsigned int i = 0; i < from->mesh_vertices.size(); i++){ for(unsigned int i = 0; i < from->mesh_vertices.size(); i++){
int index = (direction < 0) ? (from->mesh_vertices.size() - 1 - i) : i; int index = (direction < 0) ? (from->mesh_vertices.size() - 1 - i) : i;
MVertex *v = from->mesh_vertices[index]; MVertex *v = from->mesh_vertices[index];
double u; v->getParameter(0, u); double u; v->getParameter(0, u);
double newu = (direction > 0) ? u : (u_max - u + u_min); double newu = (direction > 0) ? (u-u_min+to_u_min) : (u_max-u+to_u_min);
GPoint gp = to->point(newu); GPoint gp = to->point(newu);
MEdgeVertex *vv = new MEdgeVertex(gp.x(), gp.y(), gp.z(), to, newu); MEdgeVertex *vv = new MEdgeVertex(gp.x(), gp.y(), gp.z(), to, newu);
to->mesh_vertices.push_back(vv); to->mesh_vertices.push_back(vv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment