This document outlines the upgraded architecture for RudeBase3D to incorporate modern 3D modeling techniques and data structures, transforming it from a basic primitive-based application into a professional-grade 3D modeling suite with hybrid geometry representation support.
Our application now supports multiple mesh representations working together seamlessly:
- Purpose: Core polygonal mesh editing and topology operations
- Use Cases: Vertex/edge/face selection, extrude, bevel, loop cuts, subdivision
- Implementation:
HalfEdgeMeshclass with full topological queries
- Purpose: Rendering, export/import, simple operations
- Use Cases: GPU rendering via VBOs, file I/O (OBJ, STL, PLY)
- Implementation: Enhanced
Meshclass optimized for rendering
- NURBS: Precise CAD-like surfaces (
NURBSSurfaceclass) - Subdivision Surfaces: Smooth organic modeling (
SubdivisionMeshclass) - Voxels: Sculpting and boolean operations (
VoxelGridclass) - Point Clouds: 3D scanning input (
PointCloudclass) - Implicit Surfaces: SDFs for advanced operations (
ImplicitSurfaceclass) - BVH Trees: Spatial acceleration (
BVHTreeclass)
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ HalfEdgeMesh │ ←→ │ Face-Vertex │ ←→ │ GPU Buffers │
│ (Editing) │ │ (Storage) │ │ (Rendering) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
↑ ↑ ↑
│ │ │
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ NURBS/SDF │ │ Subdivision │ │ BVH/Octree │
│ (Precision) │ │ (Smoothing) │ │ (Optimization)│
└─────────────────┘ └─────────────────┘ └─────────────────┘
↑ ↑ ↑
│ │ │
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Point Cloud │ │ Voxel Grid │ │ Implicit SDF │
│ (Scanning) │ │ (Sculpting) │ │ (Booleans) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
The HybridGeometry class acts as a unified interface:
// Single object, multiple representations
auto hybridGeom = manager.createFromMesh(originalMesh);
// Automatically convert when needed
auto halfEdge = hybridGeom->getHalfEdgeMesh(); // For editing
auto renderMesh = hybridGeom->getFaceVertexMesh(); // For rendering
auto voxels = hybridGeom->getVoxelGrid(0.1f); // For sculpting
auto nurbs = hybridGeom->getNURBSSurface(); // For CAD precision- Input: Various formats (OBJ, STL, NURBS, Point Clouds)
- Conversion: To appropriate internal representation via
GeometryConverter - Editing: Half-edge operations for topological changes
- Processing: Subdivision, boolean ops, optimization via
GeometryProcessingPipeline - Rendering: Conversion to GPU-optimized format with BVH acceleration
- Export: Convert to target format using
FileFormatHandlers
- GeometryComponent: Manages
HybridGeometrywith multiple representations - MaterialComponent: PBR materials with node-based editing support
- TransformComponent: Enhanced with constraints and snapping
- MetadataComponent: UV mapping, skinning data, custom properties
- SubdivisionComponent: Catmull-Clark subdivision settings
- SculptingComponent: High-resolution dynamic tessellation
- AnimationComponent: Skinning weights and bone influences
- PhysicsComponent: Collision data and simulation properties
enum class EditMode {
Object, // Transform entire objects
Edit, // Vertex/edge/face editing (Half-edge optimized)
Sculpt, // High-res sculpting (Voxel-based)
UV, // UV coordinate editing
Paint, // Texture painting
Animation, // Rigging and animation
CAD, // NURBS precision modeling
Procedural // Node-based procedural modeling
};enum class SelectionType {
Object, // Entire objects
Vertex, // Individual vertices
Edge, // Mesh edges
Face, // Mesh faces
Loop, // Edge/face loops
Ring, // Edge/face rings
Surface, // NURBS surfaces
ControlPoint // NURBS control points
};- Transform Tools: Move, Rotate, Scale with constraints and snapping
- Modeling Tools: Extrude, Inset, Bevel, Knife, Loop Cut (Half-edge based)
- Boolean Tools: Union, Difference, Intersection (Voxel or implicit surface based)
- Subdivision Tools: Catmull-Clark, Loop, Doo-Sabin subdivision
- Sculpting Tools: Brush-based deformation system (Voxel-based)
- CAD Tools: NURBS curve/surface creation and editing
- Reconstruction Tools: Point cloud to mesh conversion
Input Formats → Internal Representation → Processing → Output Formats
↓ ↓ ↓ ↓
┌─────────┐ ┌─────────────────┐ ┌─────────────┐ ┌─────────┐
│ OBJ │ ───→ │ HybridGeometry │ │ Modeling │ │ OBJ │
│ STL │ │ + │ → │ Operations │→ │ STL │
│ PLY │ │ HalfEdgeMesh │ │ + │ │ FBX │
│ GLTF │ │ + │ │ Boolean │ │ GLTF │
│ Points │ │ Multiple Reps │ │ + │ │ Custom │
└─────────┘ └─────────────────┘ │ Subdivision │ └─────────┘
└─────────────┘
- OBJ: Wavefront (universal compatibility) ✅ Implemented
- STL: 3D printing standard
⚠️ Partial Implementation - PLY: Research and scanning
⚠️ Partial Implementation - GLTF/GLB: Modern web/game standard ⏳ Planned
- FBX: Industry animation standard ⏳ Planned
- Custom JSON: Full scene format with hybrid geometry metadata ⏳ Planned
- Geometry Pass: Render base mesh from optimal representation
- Wireframe Pass: Edge visualization (from half-edge structure)
- Selection Pass: Highlight selected elements
- Overlay Pass: Gizmos, grid, UI elements
- Post-Processing: Anti-aliasing, effects
- VBO Management: Efficient vertex buffer updating with caching
- Instancing: For array modifiers and duplicates
- LOD System: Level-of-detail using subdivision levels
- BVH Acceleration: Fast ray casting and collision detection
- Culling: Frustum and occlusion culling with spatial structures
// All geometry types use consistent smart pointer system
using HalfEdgeMeshPtr = std::shared_ptr<HalfEdgeMesh>;
using NURBSSurfacePtr = std::shared_ptr<NURBSSurface>;
using VoxelGridPtr = std::shared_ptr<VoxelGrid>;
using HybridGeometryPtr = std::shared_ptr<HybridGeometry>;
// Unified geometry management
class HybridGeometryManager {
HybridGeometryPtr createFromMesh(MeshPtr mesh);
HybridGeometryPtr createFromPointCloud(PointCloudPtr cloud);
// Automatic conversion and caching
VoxelGridPtr toVoxels(HybridGeometryPtr geom, float resolution);
};- Lazy Conversion: Representations are created only when needed
- Memory Management: LRU cache with configurable memory limits
- Invalidation: Smart cache invalidation when geometry is modified
- Statistics: Memory usage tracking and optimization recommendations
// Create base mesh
auto hybridGeom = manager.createFromMesh(primitiveGenerator.createCube());
// Switch to edit mode - automatically uses half-edge representation
auto halfEdge = hybridGeom->getHalfEdgeMesh();
// Perform modeling operations
extrudeTool.execute(selectedFaces, 1.0f);
bevelTool.execute(selectedEdges, 0.2f);
// Smooth with subdivision
auto smoothed = pipeline.subdivide(hybridGeom, 2, true);
// Render - automatically uses optimized face-vertex representation
auto renderMesh = smoothed->getFaceVertexMesh();// Create NURBS surface
auto nurbsSurface = std::make_shared<NURBSSurface>(3, 3, 5, 5);
auto hybridGeom = manager.createFromNURBS(nurbsSurface);
// Edit control points for precision
auto nurbs = hybridGeom->getNURBSSurface();
// ... edit control points ...
// Tessellate for visualization
auto renderMesh = hybridGeom->getFaceVertexMesh();// Convert to voxel representation for sculpting
auto sculptingGeom = pipeline.convertForSculpting(hybridGeom, 0.05f);
auto voxels = sculptingGeom->getVoxelGrid();
// Apply sculpting operations
// ... voxel-based sculpting ...
// Extract smooth surface
auto sculptedMesh = voxels->extractSurface();
auto finalGeom = manager.createFromMesh(sculptedMesh);// Robust boolean operations using multiple methods
auto result1 = pipeline.unionGeometry(geomA, geomB,
GeometryRepresentation::Voxel);
// Alternative using implicit surfaces for precision
auto result2 = pipeline.unionGeometry(geomA, geomB,
GeometryRepresentation::Implicit);
// Convert result to desired representation
result1->convertPrimaryTo(GeometryRepresentation::HalfEdge);- Core Infrastructure: HybridGeometry, HybridGeometryManager, GeometryProcessingPipeline
- Geometry Types: All 7 representations with full class definitions
- Conversion System: GeometryConverter with support for all type conversions
- Half-Edge Mesh: Complete implementation with topology queries
- NURBS: Basic surface evaluation and tessellation
- Subdivision: Catmull-Clark subdivision framework
- Voxel Grid: Marching cubes surface extraction
- Point Cloud: KD-tree spatial acceleration
- Implicit Surfaces: SDF evaluation and boolean operations
- BVH Tree: Spatial acceleration for ray casting
- File I/O: OBJ format fully implemented, STL/PLY partially implemented
- Memory Management: Smart caching with LRU and memory limits
- Advanced Mesh Operations: Core algorithms in HalfEdgeUtils (extrude, bevel, etc.)
- STL/PLY Support: Basic framework, needs full implementation
- Subdivision Surface: Framework complete, needs full Catmull-Clark implementation
- Voxel Operations: Boolean operations need optimization
- Point Cloud Processing: Surface reconstruction algorithms need implementation
- UI Integration: Edit mode switching, tool activation UI
- Advanced File Formats: GLTF, FBX support
- Procedural Modeling: Node-based geometry processing
- Animation System: Skeletal animation with hybrid geometry
- Plugin System: Extension architecture for custom geometry types
- GPU Acceleration: Compute shader implementations for heavy operations
- Base Geometry: 10-50MB for typical models
- Cache Overhead: 2-5x base size (configurable)
- Conversion Cost: 0.1-2 seconds for typical models
- Optimal Representations:
- Editing: Half-edge (2-3x face-vertex memory)
- Rendering: Face-vertex (minimal memory)
- Sculpting: Voxels (high memory but fast operations)
- CAD: NURBS (compact for smooth surfaces)
- Face-vertex ↔ Half-edge: ~1ms per 1K triangles
- Mesh → Voxels: ~10ms per 1K triangles (depends on resolution)
- Voxels → Mesh: ~5ms per 1K voxels (marching cubes)
- Point Cloud → Mesh: ~100ms per 10K points (Poisson reconstruction)
This hybrid architecture positions RudeBase3D as a modern, professional-grade 3D modeling application capable of competing with industry-standard tools while maintaining the flexibility to handle diverse workflows from game development to CAD design to digital sculpture.
- GeometryComponent: Manages multiple mesh representations
- MaterialComponent: PBR materials with node-based editing
- TransformComponent: Enhanced with constraints and snapping
- MetadataComponent: UV mapping, skinning data, custom properties
- SubdivisionComponent: Catmull-Clark subdivision settings
- SculptingComponent: High-resolution dynamic tessellation
- AnimationComponent: Skinning weights and bone influences
- PhysicsComponent: Collision data and simulation properties
enum class EditMode {
Object, // Transform entire objects
Edit, // Vertex/edge/face editing
Sculpt, // High-res sculpting
UV, // UV coordinate editing
Paint, // Texture painting
Animation // Rigging and animation
};enum class SelectionType {
Object, // Entire objects
Vertex, // Individual vertices
Edge, // Mesh edges
Face, // Mesh faces
Loop, // Edge/face loops
Ring // Edge/face rings
};- Transform Tools: Move, Rotate, Scale with constraints
- Modeling Tools: Extrude, Inset, Bevel, Knife, Loop Cut
- Boolean Tools: Union, Difference, Intersection
- Subdivision Tools: Smooth, Subdivide, Un-subdivide
- Sculpting Tools: Brush-based deformation system
Input Formats → Internal Representation → Processing → Output Formats
↓ ↓ ↓ ↓
┌─────────┐ ┌─────────────────┐ ┌─────────────┐ ┌─────────┐
│ OBJ │ ───→ │ HalfEdgeMesh │ │ Modeling │ │ OBJ │
│ STL │ │ + │ → │ Operations │→ │ STL │
│ PLY │ │ Mesh │ │ │ │ FBX │
│ GLTF │ │ + │ │ │ │ GLTF │
│ Points │ │ NURBSSurface │ │ │ │ Custom │
└─────────┘ └─────────────────┘ └─────────────┘ └─────────┘
- OBJ: Wavefront (universal compatibility)
- STL: 3D printing standard
- PLY: Research and scanning
- GLTF/GLB: Modern web/game standard
- FBX: Industry animation standard
- Custom JSON: Full scene format with all metadata
- Geometry Pass: Render base mesh
- Wireframe Pass: Edge visualization
- Selection Pass: Highlight selected elements
- Overlay Pass: Gizmos, grid, UI elements
- Post-Processing: Anti-aliasing, effects
- VBO Management: Efficient vertex buffer updating
- Instancing: For array modifiers and duplicates
- LOD System: Level-of-detail for complex scenes
- Culling: Frustum and occlusion culling
// Core geometry types
using HalfEdgeMeshPtr = std::shared_ptr<HalfEdgeMesh>;
using NURBSSurfacePtr = std::shared_ptr<NURBSSurface>;
using VoxelGridPtr = std::shared_ptr<VoxelGrid>;
// Conversion and caching
class GeometryConverter {
HalfEdgeMeshPtr toHalfEdge(MeshPtr mesh);
MeshPtr toFaceVertex(HalfEdgeMeshPtr halfEdge);
VoxelGridPtr toVoxels(MeshPtr mesh, float resolution);
};- Mesh Cache: Store converted representations
- GPU Cache: Maintain VBO/texture state
- Undo Cache: History for complex operations
- Preview Cache: Fast preview for modifiers
- BVH: For ray tracing and collision detection
- Octree: For voxel data and spatial queries
- Grid: For uniform subdivision and sculpting
- Lazy Evaluation: Defer expensive operations until needed
- Background Processing: Multi-threaded mesh operations
- Incremental Updates: Only update changed regions
- Memory Pooling: Reduce allocation overhead
- Phase 1: Add HalfEdgeMesh alongside current Mesh
- Phase 2: Implement conversion between representations
- Phase 3: Add specialized tools and edit modes
- Phase 4: Integrate alternative representations (NURBS, etc.)
- Phase 5: Advanced features (animation, simulation)
- Keep existing
Meshclass for rendering and simple operations - Add conversion utilities between old and new systems
- Maintain current file format support while adding new ones
- Modifier Stack: Non-destructive editing pipeline
- Tool Presets: Save/load tool configurations
- Custom Shortcuts: Configurable key bindings
- Workspace Layouts: Different UI arrangements for different tasks
- Progress Indicators: For long operations
- Memory Usage: Display current mesh complexity
- Performance Warnings: Alert for expensive operations
- Background Processing: Keep UI responsive
- Implement HalfEdgeMesh data structure
- Create GeometryConverter for format transitions
- Add basic edit mode infrastructure
- Implement vertex/edge/face selection
- Extrude, inset, bevel operations
- Basic boolean operations
- Multi-object selection
- OBJ import/export
- Subdivision surfaces
- Advanced primitives (torus, cone, icosphere)
- Modifier system foundation
- UV mapping basics
- Sculpting system foundation
- Animation/rigging basics
- Node-based material editor
- Advanced file format support
This architecture transforms RudeBase3D from a simple primitive-based application into a modern, professional 3D modeling suite. By implementing multiple data structures working in harmony, we create a system that can handle everything from precise CAD work to organic sculpting, while maintaining the performance and user experience expected in professional 3D software.
The key innovation is the hybrid approach: using the right data structure for the right task, with seamless conversion between representations. This allows us to leverage the strengths of each technique while maintaining a unified user experience.