-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Make margin required #22279
Comments
The core functionality expressed in this issue is that if nothing is said, a margin of zero should be used. That's the behavior implied by the statement. From an implementation perspective, there are multiple ways to achieve this.
(2) is what is in master now. Reasons to prefer leaving master alone (i.e., leave (2) implemented): Reasons to prefer (1): The behaviors of (1) and (2) are basically identical but with one subtle distinction. In my mind, it all comes down to the question of "default" behavior. If we want the default value simple and unambiguous, we go with (1). If we want to maximize flexibility (in the name of admittedly strictly-speculative future functionality) we go with (2). The flexibility makes most sense for multiple consumers (e.g., The result of these consideration is that I second the motion that we go with (1). @rpoyner-tri As the author of |
Meh. If it ain't broken, don't fix it. I don't think an aesthetic judgement ("overkill") is a valid reason to make a breaking change. Zap the TODO and call it a day. The |
I see your argument @jwnimmer-tri. In my mind, probably I was extrapolating my thoughts on other properties, see if you agree. For instance, consider Now, for margin I do see your point. Being zero, i.e. there is no margin, I think we could go both ways with either solution. |
No. It's very easy to have the Hub notice the nulllopt and set a value anyway. If the hub wants to set 1e6 when the user says nullopt, it already has a constant it can use for that -- |
okay, I like that. Do you think we should do that with margin (and other parameters) as well? (in a future PR). |
The question is what we want to happen when the user says |
It seems like we are converging to Sean's option 2. In #/22153 we use a hard-coded |
Right now
DefaultProximityProperties::margin
can bestd::nullopt
, which essentially means the default margin is zero.Therefore the use of
std::optional
for margin is overkill and it should simply be a plaindouble
with default value of zero.Then
ProximityProperties
will always have margin defined when reifying geometry.With this change we can also resolve the TODO's in this Reviewable comment.
The text was updated successfully, but these errors were encountered: