Repository navigation
Add Ctrl+click tool to split edges and floor path segments - #454
Open
gtfrans2re wants to merge 2 commits into
Open
gtfrans2re wants to merge 2 commits into
gtfrans2re wants to merge 2 commits into
Conversation
Ctrl + left click on a wall, lane, door, measurement or floor inserts an anchor that splits it: an edge A->B becomes A->C and C->B (the new segment keeps the original edge's properties), and a floor path gets the anchor inserted into its nearest segment. Closes open-rmf#62. Signed-off-by: gtfrans2re <francoisgonothitoure@gmail.com>
muchmirul
suggested changes
Oct 23, 2026
There was a problem hiding this comment.
Please exclude DoorSegments in split_edge()'s clone_and_spawn_with exclusion list.
DoorSegments stores entity IDs for the original door's bodies, cue, and labels. Excluding Children does not clear those references. Because add_door_visuals filters for Without, the cloned door skips visual initialization and does not get independent visuals.
Please add .deny::() and a regression test verifying that splitting a door produces two independently rendered and selectable doors with no shared visual entity IDs.
-assisted by GPT-6-Astra
split.rs, lines 119–124
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ctrl + left click on a wall, lane, door, measurement or floor inserts an anchor that splits it: an edge A->B becomes A->C and C->B (the new segment keeps the original edge's properties), and a floor path gets the anchor inserted into its nearest segment.
Closes #62.
New feature implementation
Implemented feature
A tool to split edges and floor path segments, requested in #62. Holding Ctrl and left-clicking on a wall, lane, door or floor inserts an anchor at that point. For an edge
A→Bthis yields two edgesA→CandC→B; for a floor the new anchor is inserted into the nearest segment of its path. Both pieces share the new anchor, so dragging it reshapes them.Implementation description
A single system (
handle_split_on_ctrl_click, incrates/rmf_site_editor/src/interaction/split.rs) runs after the selection stage. On Ctrl + left-click it reads the hovered element and the cursor's ground-plane intersection, then:Edge<Entity>): spawns an anchor projected onto the segment, moves the original edge's end anchor to it (A→C), and duplicates the original entity withclone_and_spawnto produceC→B, so the new segment keeps every property of the original (laneMotion/graphs, wall texture/height, door type, …). Anchor dependents are rewired viaChangeDependent; theAdded<..Marker>visual systems regenerate the meshes.Path<Entity>): inserts the new anchor into the nearest segment of the path (closed loop included).Changed<Path>re-meshes the floor.Tested on
office.building.yamlby splitting walls, lanes and floors and dragging the resulting anchor to confirm each piece is independent and retains its properties.Scope notes:
Open questions:
clone_and_spawnwith a deny-list (SiteID,Dependents,Children,Selected,Hovered,Selectable). Does anything else on an edge entity need excluding?GenAI Use
We follow OSRA's policy on GenAI tools
Assisted-by: Claude Opus 4.8