Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic checking periodic model faces #446

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ma/maSnap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,16 @@ static void interpolateParametricCoordinatesOnRegularFace(
{
double range[2];
int dim = m->getModelType(g);
bool gface_isPeriodic = 0;
for (int d=0; d < dim; ++d) {
bool isPeriodic = m->getPeriodicRange(g,d,range);
if ((dim == 2) && (isPeriodic > 0)) gface_isPeriodic = 1;
p[d] = interpolateParametricCoordinate(t,a[d],b[d],range,isPeriodic, 0);
}

/* check if the new point is inside the model.
* otherwise re-run the above loop with last option
* in "interpolateParametricCoordinae" being 1.
* in "interpolateParametricCoordinate" being 1.
* Notes
* 1) we are assuming manifold surfaces
* 2) we only check for faces that are periodic
Expand All @@ -494,6 +496,8 @@ static void interpolateParametricCoordinatesOnRegularFace(
// this need to be done for faces, only
if (dim != 2)
return;
if (!gface_isPeriodic)
return;

Vector x;
bool ok;
Expand Down