-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update padFootprint function #108
base: devel
Are you sure you want to change the base?
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.
3 things
The 1st example looks suspicious: doesn't look like padded 10 cm but 2 or 3 🤔
This looks similar to this commit
Do both provide the same result? If so, this is simpler
Keep the formatting of the files you modify. i.e. never mix stiles
Hi you are right it wasnt 0.1 meters because it was scaling by percentage, I changed it to scale by meters and updated the image. |
So the outcome is now the same as with this commit? |
@corot I think you are missing the part he calculates the centroid of the polygon. |
Previously this function was scaling the footprint with respect to the coordinate frame 0,0 which could result in distortion. Also when the centroid is having large offset with 0,0 then it will just displace the footprint instead of padding.
Now it scales with respect to the centroid of the footprint.
another case (10,10), (10,12), (12,12) , (12,10)
another case (0,0), (0,2), (2,2), (2,0)
I have also tested the behaviour with negative values of padding (shrinking the footprint)