Skip to content

feat: Extend Bubblify to support multiple geometry types with interactive 3D editing#3

Open
Nnboy wants to merge 20 commits intobheijden:masterfrom
Nnboy:master
Open

feat: Extend Bubblify to support multiple geometry types with interactive 3D editing#3
Nnboy wants to merge 20 commits intobheijden:masterfrom
Nnboy:master

Conversation

@Nnboy
Copy link

@Nnboy Nnboy commented Sep 27, 2025

Motivation for Project

Enhanced Collision Detection Performance

Thank you for your excellent contribution. This is a very useful tool that I have recommended to many colleagues. However, during our usage, we discovered some limitations that motivated us to enhance and extend the project. The primary motivation for our enhancements was:

  1. Performance Optimization: The main goal is to accelerate collision detection processes, not just to obtain collision gradients
  2. Geometric Flexibility: Different robot components require different geometric representations for optimal collision detection performance
  3. Real-world Applications: Our usage scenarios demanded more diverse geometry types beyond spheres

Technical Extensions

We built upon your solid foundation by:

  • Extending the sphere-only approach to support boxes and cylinders
  • Maintaining the same intuitive 3D editing experience
  • Preserving backward compatibility with existing sphere configurations
  • Adding comprehensive YAML import/export support for all geometry types

🚀 Major Feature Enhancements

1. Multi-Geometry Type Support

  • New Support: Extended from sphere-only to support three geometry types: sphere, box, and cylinder
screenshot-20250927-203002
  • YAML Import Support: Now supports importing box and cylinder configurations from YAML files

    yaml_import_bubblify.mp4

  • Architecture Refactor: Transformed Sphere class into a generic Geometry class with type-specific parameters

  • Parameter Configuration: Complete parameter sets for each geometry type (radius, dimensions, height, rotation, etc.)

2. Interactive 3D Editing System

  • Gizmo System: Implemented comprehensive 3D manipulation handles

    • Spheres: Radius adjustment gizmo

    • Cylinders: Radius and height adjustment gizmos with capsule display mode

      cylinder_bubblify.mp4

    • Boxes: Three-axis dimension adjustment gizmos with quaternion rotation support

      box_bubblify.mp4

  • Movement Constraints: Improved gizmo movement limits and interaction experience

  • Real-time Preview: Live adjustment and visualization capabilities

3. Complete UI Overhaul

  • Terminology Update: Expanded "spherization" concept to "geometry configuration"
  • CLI Improvements: Renamed --spherization_yml to --geometry_config
  • GUI Refactor: Major user interface improvements for better interaction

🔧 Technical Improvements

Core Module Updates

  • bubblify/core.py: Added geometry type definitions and parameter handling (+312 lines)
  • bubblify/gui.py: Complete refactor of interactive editing functionality (+1646 lines)
  • bubblify/cli.py: Updated command-line interface and parameter names

Code Quality Enhancements

  • Removed deprecated inject_spheres_into_urdf_xml function
  • Added Apache License 2.0 and NOTICE files
  • Updated documentation and usage examples

📊 Development Statistics

  • Development Period: 2 weeks
  • Commit Count: 20 commits
  • Code Changes: +2100 additions, -470 deletions
  • Files Modified: 15 files
  • Primary Contributor: Nnboy

🧪 Testing & Documentation

  • Updated all related test files to accommodate new features
  • Added new demo images and documentation
  • Ensured backward compatibility

🎯 Key Features

  1. Multi-geometry Support: Sphere, box, and cylinder types
  2. Interactive Editing: Complete 3D gizmo manipulation system
  3. Real-time Preview: Instant visual feedback for adjustments
  4. User-friendly: Intuitive interface and operation experience
  5. Backward Compatible: Maintains existing functionality while adding new features

This update transforms Bubblify from a simple URDF spherization tool into a comprehensive robot geometry configuration and visualization platform, significantly enhancing its utility and flexibility.

- Add support for box and cylinder collision geometries in addition to spheres
- Introduce Geometry class to generalize collision geometry representation
- Update GeometryStore to handle multiple geometry types
- Modify URDF XML injection to support new geometry types
- Add rotation (RPY and quaternion) support for non-spherical geometries
- Introduce box and cylinder shapes in addition to sphere
- Implement rotation functionality for box and cylinder geometries
- Update GUI to allow selection and manipulation of different geometry types
- Modify export functionality to handle multiple geometry types and rotations
- Maintain backward compatibility with existing sphere-based configurations
- Implement box resize gizmos for intuitive 3D size adjustment
- Add 6 resizing axes for each box geometry (±X, ±Y, ±Z)
- Update GEOMETRY_SUPPORT.md with new interactive resizing instructions
- Enhance user experience by syncing UI sliders and visualizing changes in real-time
- Remove complex rotations and use simple axis-aligned rotations
- Adjust gizmo positions and rotations for better visual representation
- Optimize gizmo creation and update logic
- Improve code readability and maintainability
- Implement quaternion-based rotation for box resizing
- Update gizmo positions and rotations to account for box orientation
- Fix issues with previous resizing implementation that didn't consider rotation
- Improve error handling and use of transformation libraries
- Add translation limits to restrict movement of gizmos
- Implement constraints for each axis to prevent crossing center point
- Improve error handling and default values for rotation and position
- Enhance code readability and robustness
- Update radius gizmo to work with both sphere and cylinder geometries
- Add conditional logic to handle different geometry types
- Adjust UI updates for both sphere and cylinder radius sliders
- Improve code comments for clarity and maintainability
- Introduce max_inward variables to calculate the maximum inward movement for each axis
- Update translation limits to prevent gizmos from crossing the center point
- Optimize movement restrictions for each axis, allowing inward movement but not through the center
- Implement cylinder height gizmo for adjusting cylinder height in the GUI
- Add new methods for creating, updating, and removing cylinder height gizmos
- Integrate cylinder height gizmo updates into existing GUI update functions
- Implement callback for handling cylinder height changes via the gizmo
- Update gizmo positioning and rotation for sphere and cylinder geometries
- Add translation limits to prevent gizmo from going through the center
- Use SO3 transformations for more accurate rotations
- Handle exceptions when getting cylinder rotation
- Add checkbox to toggle capsule display for cylinders
- Implement capsule creation using Trimesh library
- Update cylinder mesh generation with more sections for smoother appearance
- Adjust mesh coloring and naming based on display option
- Rename and restructure UI elements to support multiple geometry types
- Update backend to handle various collision geometries
- Improve opacity management for visual focus system
- Remove backward compatibility aliases
… mesh rendering

- Add 'display_as_capsule' parameter to Geometry and GeometryStore
- Implement efficient capsule mesh creation using Trimesh's built-in method
- Refactor cylinder mesh creation for smoother appearance
- Update mesh rendering to support direct opacity setting for all geometry types
- Remove redundant mesh color setting and use add_mesh_simple for better performance
- Create copies of gizmo dictionaries to avoid modification during iteration
- Set fixed inward movement limits for gizmos instead of using max_inward_movement variable
- Rename spherization YAML loading method to geometry configuration for clarity
- Set default values for new geometries to prevent inheriting properties from previously selected geometries
- Enhance error handling during gizmo removal to ignore exceptions if already removed
- Update print statements for improved clarity regarding geometry loading
- Add LICENSE file with full Apache License 2.0 text
- Add NOTICE file with copyright and license information
- Include standard boilerplate for Apache 2.0 licensing
- Rename `--spherization_yml` option to `--geometry_config` in documentation
- Update usage examples to reflect the new option name
- Maintain consistency between command line options and example usages
- Renamed `--spherization_yml` argument to `--geometry_config`
- Updated CLI descriptions and help messages to reflect "geometry configuration"
- Updated error messages and print statements for clarity
- Changed default export name from `spherized` to `geometries`

This change aligns the CLI with the broader scope of geometry manipulation,
not just spherization, and improves consistency across the codebase.
- Deleted the GEOMETRY_SUPPORT.md file as its content has been integrated into the README.md.
- Updated copyright information in the NOTICE file to reflect the new ownership by "bubblify".
The inject_spheres_into_urdf_xml function was a backward compatibility
wrapper that has now been removed. All calls should use
inject_geometries_into_urdf_xml directly instead.
@bheijden
Copy link
Owner

I completely missed this PR. Going to review it soon! Looks cool :)

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