Skip to content

Chore/fix scene in 2d - #7

Merged
Ludofr3 merged 19 commits into
mainfrom
chore/fix-scene-in-2d
May 28, 2026
Merged

Chore/fix scene in 2d#7
Ludofr3 merged 19 commits into
mainfrom
chore/fix-scene-in-2d

Conversation

@Ludofr3

@Ludofr3 Ludofr3 commented May 18, 2026

Copy link
Copy Markdown
Collaborator
  • Ray Picking Extraction: Created the RayPicker class in bot/control/picker.py to isolate collision management and mouse selection.
  • 3D Constraints Extraction: Created the ConstraintManager class in bot/math/constraints.py to handle projection mathematics and axis restrictions.
  • Scene Refactoring: Delegated the creation of geometry and collision nodes directly to CurveApp within bot/view/scene.py.
  • Consistent Selection Radius: Added the _on_zoom_changed event to dynamically adjust the size of collision zones based on the camera's zoom level.
  • 2D Optimization: Changed the default constraint mask (axis_constraint_mask) to 3 (XY plane) instead of 7.
  • Syntax Corrections: Updated obsolete exception syntax (except (TypeError, ValueError):) in bot/viewer/viewer.py to prevent crashes.
  • Strict Typing: Intensively added type hints (List, Dict, Optional, Any) to the refactored files.

sorry, PR is more important than I thought 😅

Ludofr3 added 8 commits May 11, 2026 15:13
Enhances 3D interaction by implementing zoom-independent selection
radii and improving depth-sorting for mouse picking.

- Implements adaptive collision sizing based on camera film size
- Prioritizes control points during depth-sorted raycasting
- Fixes camera panning by converting local movement to world space
- Adds safety checks to prevent infinite hitboxes in micro-segments
- Introduces zoom_changed event to synchronize visuals and collisions
Adjusts camera clipping planes to resolve depth precision issues and
improves selection accuracy by prioritizing 2D proximity for points.

- Reduces clipping limits to mitigate Float32 precision errors
- Implements screen-space distance sorting for overlapping pick targets
- Adds safety checks for zero-length collision tubes
- Ensures drag finalization when mouse focus is lost
- Synchronizes zoom events with animation state transitions
Restructures mouse input handling by extracting picking and 3D
projection logic into dedicated picker and constraint modules.

- Introduces RayPicker for camera-to-world object selection
- Introduces ConstraintManager for 3D axis and plane constraints
- Decouples mathematical projection logic from the mouse controller
- Updates view components to integrate with the new modular architecture
@Ludofr3 Ludofr3 self-assigned this May 18, 2026
@Ludofr3
Ludofr3 marked this pull request as draft May 18, 2026 12:19
@Ludofr3
Ludofr3 marked this pull request as ready for review May 19, 2026 08:43
@Ludofr3
Ludofr3 requested review from franck-ledoux and mstauffe May 19, 2026 08:44
@Ludofr3 Ludofr3 added ferrispline New change in the submodule ferrispline chore change of direction of an existing feature bot New change in bot, the python part and removed ferrispline New change in the submodule ferrispline labels May 19, 2026

@mstauffe mstauffe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice PR, just a few questions.

Comment thread bot/control/camera.py
Comment thread bot/control/mouse.py Outdated
Comment thread bot/control/mouse.py
Comment thread tests/unit/test_control/test_mouse_axis_constraint.py
Ludofr3 and others added 3 commits May 19, 2026 14:41
Co-authored-by: mstauffe <maxime.stauffert@cea.fr>
Signed-off-by: Ludo.fr3  <91745642+Ludofr3@users.noreply.github.com>
@Ludofr3
Ludofr3 merged commit 90ae751 into main May 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot New change in bot, the python part chore change of direction of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants