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

Add automatic lift floor hole generation #196

Merged
merged 10 commits into from
Mar 5, 2024

Conversation

luca-della-vedova
Copy link
Member

New feature implementation

Implemented feature

This PR adds automatic lift floor hole generation for lift shafts. It switches our path library from lyon to geo since the latter supports boolean operations between polygons, otherwise we would have to write our own.

Example below:

Screencast.from.2024-01-12.11-02-03.webm

Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Copy link
Collaborator

@mxgrey mxgrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically cutting the lift holes is an excellent capability. I've left some in-line comments about spots where the implementation can be improved, but there's one thing I noticed in particular that I'm not sure where in the code it would be happening:

When a floor is completely divided on two sides by a lift, one entire half of the floor will end up being deleted. To illustrate this, here are some before and after screenshots of the hotel. In the "after" picture, I've moved the lift into the hallway in such a way that the hallway should be fully split in two. Instead, only half of the hallway remains at all:

Before
before_lift

After
after_lift

rmf_site_editor/src/site/floor.rs Outdated Show resolved Hide resolved
rmf_site_editor/src/site/floor.rs Outdated Show resolved Hide resolved
rmf_site_editor/src/site/floor.rs Outdated Show resolved Hide resolved
rmf_site_editor/src/site/floor.rs Outdated Show resolved Hide resolved
rmf_site_editor/src/site/floor.rs Outdated Show resolved Hide resolved
rmf_site_editor/src/site/floor.rs Outdated Show resolved Hide resolved
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
@luca-della-vedova
Copy link
Member Author

When a floor is completely divided on two sides by a lift, one entire half of the floor will end up being deleted.

Yea I noticed this as well and I think it's just a consequence of the triangulation algorithm.
I tried all the difference triangulation algorithms in the library and I believe I found the one that gives the best outcome here. The outline is still a bit messed up but the polygon shape itself seems to be OK in all the cases I could test (including the hall example you brought up).

Copy link
Collaborator

@mxgrey mxgrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the gap calculation was still missing the lift wall thickness, causing the gaps to be too small:
gap_broken

I've pushed a commit that just adds the wall thickness parameter, so now the gaps are coming out as intended:
gap_fixed

Looks good now! We can merge this as soon as CI passes.

@luca-della-vedova luca-della-vedova merged commit c211312 into main Mar 5, 2024
5 checks passed
@luca-della-vedova luca-della-vedova deleted the luca/lift_floor_holes branch March 5, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants