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

fix periodic rotation with common edge

parent 98ab903d
No related branches found
No related tags found
No related merge requests found
...@@ -203,8 +203,6 @@ static void copyMesh(GFace *source, GFace *target) ...@@ -203,8 +203,6 @@ static void copyMesh(GFace *source, GFace *target)
SVector3(mean_target.a,mean_target.b,mean_target.c)); SVector3(mean_target.a,mean_target.b,mean_target.c));
LINE = myLine(PLANE_SOURCE, PLANE_TARGET); LINE = myLine(PLANE_SOURCE, PLANE_TARGET);
// FIXME: this fails when the 2 planes have a common edge (= rotation axis)
// LINE is the axis of rotation // LINE is the axis of rotation
// let us compute the angle of rotation // let us compute the angle of rotation
count = 0; count = 0;
...@@ -219,6 +217,7 @@ static void copyMesh(GFace *source, GFace *target) ...@@ -219,6 +217,7 @@ static void copyMesh(GFace *source, GFace *target)
SPoint3 p_pt = LINE.orthogonalProjection(pt); SPoint3 p_pt = LINE.orthogonalProjection(pt);
SVector3 dist1 = ps - pt; SVector3 dist1 = ps - pt;
SVector3 dist2 = p_ps - p_pt; SVector3 dist2 = p_ps - p_pt;
if (dist1.norm() > CTX::instance()->geom.tolerance){
if (dist2.norm() > 1.e-8 * dist1.norm()){ if (dist2.norm() > 1.e-8 * dist1.norm()){
rotation = false; rotation = false;
} }
...@@ -236,6 +235,7 @@ static void copyMesh(GFace *source, GFace *target) ...@@ -236,6 +235,7 @@ static void copyMesh(GFace *source, GFace *target)
count++; count++;
} }
} }
}
if (rotation){ if (rotation){
Msg::Info("Periodic mesh rotation found: axis (%g,%g,%g) point (%g %g %g) angle %g", Msg::Info("Periodic mesh rotation found: axis (%g,%g,%g) point (%g %g %g) angle %g",
...@@ -256,7 +256,7 @@ static void copyMesh(GFace *source, GFace *target) ...@@ -256,7 +256,7 @@ static void copyMesh(GFace *source, GFace *target)
} }
else { else {
Msg::Error("Only rotations or translations can be currently taken into account " Msg::Error("Only rotations or translations can be currently taken into account "
"for peridic faces: face %d not meshed", target->tag()); "for periodic faces: face %d not meshed", target->tag());
return; return;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment