-
Notifications
You must be signed in to change notification settings - Fork 331
Fix ContactHalfSpace decoration to lie within the contact geometry. #2212
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
Conversation
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.
Would this need adjustment based on whether
contact is on top/bottom or is contact always on top and transform changes accordingly?
No. The change I made is correct regardless of the orientation of the contact half-plane. |
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.
LGTM. Ideally all these hardcoded numbers would be scaled by some measure of model size but that's outside the scope of this PR.
Thanks @aymanhab |
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.
LGTM. I only suggest making the brick even thinner so there is no issue trying to interpret what its thickness means.
@@ -77,8 +77,14 @@ void ContactHalfSpace::generateDecorations(bool fixed, const ModelDisplayHints& | |||
const auto& X_BF = getFrame().findTransformInBaseFrame(); | |||
const auto& X_FP = getTransform(); | |||
const auto X_BP = X_BF * X_FP; | |||
geometry.push_back(SimTK::DecorativeBrick(Vec3{.005, 0.5, 0.5}) | |||
.setTransform(X_BP).setScale(1) | |||
const double brickHalfThickness = 0.005; |
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.
The issue here is that we are representing a plane with a brick. I think it is misleading to present a plane with a block with thickness. While I agree using the top surface of the brick is better (than the middle) in reality we shouldn't be presenting any thickness. Ideally we could draw planes. For the time being we could use a thickness of 1mm instead of 1cm?
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.
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.
👍 Looks more plane like to me.
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.
Don't forget to update testVisualization!
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.
Ah right. Updated.
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.
👍 LGTM
Thanks @tkuchida |
Fixes #2211
Brief summary of changes
ContactHalfSpace
so that the half-space's decorative geometry does not protrode outside of the contact geometry (half in, half out).Testing I've completed
testContactGeometry
and ensured that the entireDecorativeBrick
for theContactHalfSpace
appeared below ground.testVisualization
(this test initially failed after I changedContactHalfSpace.cpp
).CHANGELOG.md (choose one)
ContactHalfSpace
was not in any previous release.