Skip to content

Add support for rotated rectangle constraints#1294

Open
TheTripleV wants to merge 16 commits into
SleipnirGroup:mainfrom
TheTripleV:slant
Open

Add support for rotated rectangle constraints#1294
TheTripleV wants to merge 16 commits into
SleipnirGroup:mainfrom
TheTripleV:slant

Conversation

@TheTripleV

Copy link
Copy Markdown

No description provided.

@github-actions github-actions Bot added component: ui UI frontend component: backend Rust/Tauri backend labels Aug 7, 2025
@calcmogul calcmogul linked an issue Aug 7, 2025 that may be closed by this pull request

@calcmogul calcmogul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The input boxes got cut off because "Rotation" made the boxes render further to the right:
Screenshot_20250807_153530

@calcmogul calcmogul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The rotate handle is a bit awkward because it overlaps with the other corners. Also, dragging a green corner of that rotated rectangle up results in the corner of the box deviating from where the mouse pointer is, like there's some kind of scaling issue.

Comment thread src-core/src/generation/transformers/constraints.rs Outdated

@calcmogul calcmogul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I drag a corner into the center of the box (so the box is effectively zero size), it starts dragging the whole box along. When I expand the box again, the mouse is no longer on top of the selected corner. When I do this on main, it just lets the corner pass through the center and let the area expand the other way.

The field-wide keep-in rectangle needs its placement corrected.

@TheTripleV

Copy link
Copy Markdown
Author

When I do this on main, it just lets the corner pass through the center

I noticed this. Allowing this isn't possible or else the rotation (and the rotation handle) has to jump. So I chose this as the compromise.

I could reallow passthrough with jump. Or preferably, limit the min size of the box to ~8inch square.

@calcmogul

calcmogul commented Aug 8, 2025

Copy link
Copy Markdown
Member

A minimum size equal to the robot's dimensions would make sense. The trajopt problem is guaranteed infeasible otherwise.

@calcmogul

Copy link
Copy Markdown
Member

The min size enforcement works, but the box corners still move around when they shouldn't at minimum size, and the mouse pointer location still deviates from the drag point.

@TheTripleV

Copy link
Copy Markdown
Author

I fixed the box corners moving when just 1 dimension is limited by robot size. When both are limited, the box corners only move by floating point error.

I don't think I can stop the mouse cursor from moving. Other parts of the UI don't either.

@calcmogul

calcmogul commented Aug 9, 2025

Copy link
Copy Markdown
Member

I don't think I can stop the mouse cursor from moving.

Sure, but the issue is the drag target doesn't snap back onto the cursor when the cursor is moved back into the region not constrained by minimums. The cursor ends up offset from the drag target instead: Screencast_20250809_122624.webm

Comment thread src/components/field/svg/constraintDisplay/KeepInRectangleOverlay.tsx Outdated
Comment thread src/components/field/svg/constraintDisplay/KeepInRectangleOverlay.tsx Outdated

@calcmogul calcmogul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The corner resize seems to get stuck in some situations.

Screencast_20250818_210024.webm

TheTripleV and others added 2 commits August 18, 2025 21:55
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support rotated keep-in rectangles

2 participants