-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
add getFaceCenter method #1091
add getFaceCenter method #1091
Conversation
for ( auto &j: aFace){ | ||
c += getVertex(j); | ||
} | ||
return c/aFace.size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implicit cast to int (or size_t) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes ok I add a static_cast
done thanks |
for ( auto &j: aFace){ | ||
c += getVertex(j); | ||
} | ||
return c/static_cast<typename TPoint::Component>(aFace.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well.. yes.. but If the mesh has integer coordinates vertices, the barycenter is a bit crappy since it may not lie on the surface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you should make this clear. Or decide that the output of "getbarycenter" is always a "RealPoint" and thus cast to double the denominator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for RealPoint it is more logic
Ok fine. |
yes done ;) |
thanks merging |
Tiny PR just to lighten some codes.