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

Bug fixes #997

Merged
merged 1 commit into from
Jul 2, 2020
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
11 changes: 5 additions & 6 deletions libs/yocto/yocto_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ inline vec2f intersect_circles_core(
float B = (r1 * r1 - r2 * r2) / R;
float s = A - B * B - 1;
assert(s >= 0);
result += vec2f{c2.y - c1.y, c1.x - c2.x} * (0.5 * sqrtf(s));
result += vec2f{c2.y - c1.y, c1.x - c2.x} * (0.5f * sqrt(s));
return result;
}

Expand All @@ -79,7 +79,7 @@ inline vec2f intersect_circles_fast(
float B = (R1 - R2) / R;
float s = A - B * B - 1;
assert(s >= 0);
result += vec2f{c2.y - c1.y, c1.x - c2.x} * (0.5 * sqrtf(s));
result += vec2f{c2.y - c1.y, c1.x - c2.x} * (0.5f * sqrt(s));
return result;
}

Expand Down Expand Up @@ -425,6 +425,7 @@ vector<vector<float>> compute_angles(const vector<vec3i>& triangles,
auto v = positions[tr3d[(k + 1) % 3]] - positions[tr3d[k]];
auto w = positions[tr3d[(k + 2) % 3]] - positions[tr3d[k]];
auto phi = angle(v, w);
curr_angles.push_back(phi);
teta += phi;
}
}
Expand Down Expand Up @@ -1537,8 +1538,7 @@ vector<int> cleaned_strip(const vector<vec3i>& triangles,
}
auto [ok, b2f] = point_in_triangle(triangles, positions, cleaned.back(),
eval_position(triangles, positions, end));
assert(ok);
end = {cleaned.back(), b2f}; // updating end
end = {cleaned.back(), b2f}; // updating end
}

// Erasing from the top
Expand Down Expand Up @@ -1570,8 +1570,7 @@ vector<int> cleaned_strip(const vector<vec3i>& triangles,
}
auto [ok, b2f] = point_in_triangle(triangles, positions, cleaned[0],
eval_position(triangles, positions, start));
assert(ok);
start = {cleaned[0], b2f}; // updating start
start = {cleaned[0], b2f}; // updating start
}

return cleaned;
Expand Down