diff --git a/mockup/icons/ams-ht.png b/mockup/icons/ams-ht.png deleted file mode 100644 index 56370b7fc..000000000 Binary files a/mockup/icons/ams-ht.png and /dev/null differ diff --git a/mockup/icons/ams-ht.xcf b/mockup/icons/ams-ht.xcf deleted file mode 100644 index 33ffde230..000000000 Binary files a/mockup/icons/ams-ht.xcf and /dev/null differ diff --git a/mockup/icons/ams-settings.svg b/mockup/icons/ams-settings.svg deleted file mode 100644 index 94b7fea8f..000000000 --- a/mockup/icons/ams-settings.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/ams.png b/mockup/icons/ams.png deleted file mode 100644 index 217f7645d..000000000 Binary files a/mockup/icons/ams.png and /dev/null differ diff --git a/mockup/icons/ams.xcf b/mockup/icons/ams.xcf deleted file mode 100644 index d0e0a6b11..000000000 Binary files a/mockup/icons/ams.xcf and /dev/null differ diff --git a/mockup/icons/chamber.svg b/mockup/icons/chamber.svg deleted file mode 100644 index 1e9fe8b13..000000000 --- a/mockup/icons/chamber.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/dual-extruder.png b/mockup/icons/dual-extruder.png deleted file mode 100644 index 37055084b..000000000 Binary files a/mockup/icons/dual-extruder.png and /dev/null differ diff --git a/mockup/icons/dual-extruder.xcf b/mockup/icons/dual-extruder.xcf deleted file mode 100644 index 72446f266..000000000 Binary files a/mockup/icons/dual-extruder.xcf and /dev/null differ diff --git a/mockup/icons/extruder-left-right.png b/mockup/icons/extruder-left-right.png deleted file mode 100644 index 276368be7..000000000 Binary files a/mockup/icons/extruder-left-right.png and /dev/null differ diff --git a/mockup/icons/extruder-left-right.xcf b/mockup/icons/extruder-left-right.xcf deleted file mode 100644 index 3318df7c1..000000000 Binary files a/mockup/icons/extruder-left-right.xcf and /dev/null differ diff --git a/mockup/icons/eye.svg b/mockup/icons/eye.svg deleted file mode 100644 index ab6299190..000000000 --- a/mockup/icons/eye.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mockup/icons/heatbed.svg b/mockup/icons/heatbed.svg deleted file mode 100644 index 11f9ac2db..000000000 --- a/mockup/icons/heatbed.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/home.svg b/mockup/icons/home.svg deleted file mode 100644 index 7724a92a1..000000000 --- a/mockup/icons/home.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mockup/icons/hotend.svg b/mockup/icons/hotend.svg deleted file mode 100644 index ab9fa88f0..000000000 --- a/mockup/icons/hotend.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/jogpad.png b/mockup/icons/jogpad.png deleted file mode 100644 index 6b72efb5d..000000000 Binary files a/mockup/icons/jogpad.png and /dev/null differ diff --git a/mockup/icons/jogpad.svg b/mockup/icons/jogpad.svg deleted file mode 100644 index 4b4f3112f..000000000 --- a/mockup/icons/jogpad.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mockup/icons/jogpad.xcf b/mockup/icons/jogpad.xcf deleted file mode 100644 index 27c0c9a18..000000000 Binary files a/mockup/icons/jogpad.xcf and /dev/null differ diff --git a/mockup/icons/lamp.svg b/mockup/icons/lamp.svg deleted file mode 100644 index adf572082..000000000 --- a/mockup/icons/lamp.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/micro-sd.svg b/mockup/icons/micro-sd.svg deleted file mode 100644 index 4c9b0eb83..000000000 --- a/mockup/icons/micro-sd.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/reload.svg b/mockup/icons/reload.svg deleted file mode 100644 index 6f67f5cf7..000000000 --- a/mockup/icons/reload.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/settings.svg b/mockup/icons/settings.svg deleted file mode 100644 index 9097c5302..000000000 --- a/mockup/icons/settings.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/single-extruder1.png b/mockup/icons/single-extruder1.png deleted file mode 100644 index c31be02f5..000000000 Binary files a/mockup/icons/single-extruder1.png and /dev/null differ diff --git a/mockup/icons/single-extruder1.xcf b/mockup/icons/single-extruder1.xcf deleted file mode 100644 index 89526299f..000000000 Binary files a/mockup/icons/single-extruder1.xcf and /dev/null differ diff --git a/mockup/icons/single-extruder2.png b/mockup/icons/single-extruder2.png deleted file mode 100644 index 4f470eb78..000000000 Binary files a/mockup/icons/single-extruder2.png and /dev/null differ diff --git a/mockup/icons/single-extruder2.xcf b/mockup/icons/single-extruder2.xcf deleted file mode 100644 index 6d6e59103..000000000 Binary files a/mockup/icons/single-extruder2.xcf and /dev/null differ diff --git a/mockup/icons/skip-objects.svg b/mockup/icons/skip-objects.svg deleted file mode 100644 index d78b60f18..000000000 --- a/mockup/icons/skip-objects.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/snowflake.svg b/mockup/icons/snowflake.svg deleted file mode 100644 index 91eb0e6d7..000000000 --- a/mockup/icons/snowflake.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mockup/icons/speed.svg b/mockup/icons/speed.svg deleted file mode 100644 index aaaae5271..000000000 --- a/mockup/icons/speed.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/temperature.svg b/mockup/icons/temperature.svg deleted file mode 100644 index 539352e4d..000000000 --- a/mockup/icons/temperature.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/ventilation.svg b/mockup/icons/ventilation.svg deleted file mode 100644 index e87e8ddf7..000000000 --- a/mockup/icons/ventilation.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/video-camera.svg b/mockup/icons/video-camera.svg deleted file mode 100644 index 40132a207..000000000 --- a/mockup/icons/video-camera.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/mockup/icons/water.svg b/mockup/icons/water.svg deleted file mode 100644 index 4beef68b2..000000000 --- a/mockup/icons/water.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/mockup/icons/webcam.svg b/mockup/icons/webcam.svg deleted file mode 100644 index 78e3b7717..000000000 --- a/mockup/icons/webcam.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plans/3mf-plate-management-verification.md b/plans/3mf-plate-management-verification.md deleted file mode 100644 index 23262a3b6..000000000 --- a/plans/3mf-plate-management-verification.md +++ /dev/null @@ -1,13 +0,0 @@ -# Plate Management Verification Checklist - -## Manual Verification -- Open an archive with a multi-plate 3MF and verify the plate selector shows All Plates plus each plate entry. -- Select each plate and confirm the 3D viewer updates to show only that plate’s objects. -- Switch back to All Plates and confirm all geometry renders again. -- Verify the plate thumbnail and plate name are shown in the selector for plates with metadata. -- Open a single-plate 3MF and confirm the selector does not appear. -- Open an STL or non-3MF archive and confirm the viewer shows a friendly unsupported format error (no crash). - -## Test Targets -- MSW handler for /api/v1/archives/:id/plates should return a structured response. -- ArchivesPage plate hover handlers should not throw when plates data is empty. diff --git a/plans/3mf-plate-management.md b/plans/3mf-plate-management.md deleted file mode 100644 index 81365afb0..000000000 --- a/plans/3mf-plate-management.md +++ /dev/null @@ -1,206 +0,0 @@ -# 3MF Plate Management Feature Plan -## Overview -This plan outlines the implementation of plate management features for the bambuddy 3D viewer. This will allow users to view, select, and manage individual plates within 3MF files, similar to how Bambu Studio handles multi-plate projects. -## Background -### Current 3MF File Structure -3MF files use a hierarchical XML structure to manage multiple build plates: -``` -3dmodel.model (root) -├── Metadata/ -│ └── model_settings.config # Plate configuration manager -├── 3dmodel.model (main model data) -│ ├── definitions (unique geometry) -│ └── items (plate assignments) -└── Metadata/ - └── plate_1.png, plate_2.png, etc. (plate thumbnails) -``` -### Key Concepts -- **Build Items**: Objects assigned to specific plates via `bambu:plate_id` attribute -- **Plate Configuration**: `Metadata/model_settings.config` manages plate definitions, names, bed types -- **Object Instances**: Each unique object defined once, referenced by multiple build items -- **Transformation Matrix**: Each build item has position, rotation, scale relative to its plate's center -- **Plate Thumbnails**: PNG images showing each plate's layout for preview -## Feature Requirements -### 1. Plate Metadata Parsing -**Goal**: Read and parse `Metadata/model_settings.config` from 3MF files -**Technical Details**: -- Parse XML structure to extract: - - Plate count - - Plate names (custom or default) - - Plate dimensions - - Bed type per plate (Textured PE, Cool Plate, etc.) - - Printer type per plate (X1C, A1 mini, etc.) -- Extract plate-to-object mappings from `` items -- Parse object-to-plate assignments from `` `bambu:plate_id` attributes -**Implementation Approach**: -- Use JSZip to extract `Metadata/model_settings.config` from 3MF ZIP -- Parse XML using DOMParser or similar library -- Create TypeScript interfaces for plate metadata -### 2. UI/UX Design -**Goal**: Intuitive plate selection and object management interface -**Components Needed**: -#### A. Plate Selector/Tab System -- **Plate Tabs**: Horizontal tabs showing each plate (Plate 1, Plate 2, etc.) -- **Plate Dropdown**: Dropdown to select active plate -- **Plate Info Panel**: Display plate name, dimensions, bed type -- **Thumbnail Preview**: Show plate thumbnail when selected -#### B. Object Filtering -- **Filter by Plate**: When a plate is selected, show only objects on that plate -- **Object List**: Display objects with their positions on current plate -- **Object Selection**: Allow selecting individual objects (checkbox, multi-select) -- **Object Info**: Show object name, dimensions, material color -#### C. 3D Viewer Enhancements -- **Plate-Specific Rendering**: Render only objects for selected plate -- **Object Highlighting**: Highlight selected objects in 3D view -- **Plate Grid Overlay**: Show build plate boundaries when viewing specific plate -- **Plate Indicator**: Visual indicator of which plate is currently active -#### D. Object Manipulation (Optional - Future Enhancement) -- **Drag and Drop**: Move objects between plates -- **Object Repositioning**: Adjust X/Y/Z position on current plate -- **Object Rotation**: Rotate objects on build plate -- **Object Scaling**: Resize objects -- **Delete from Plate**: Remove object from current plate -- **Add to Plate**: Copy object to different plate -### 3. Data Model Design -**Goal**: Track plate assignments and configurations -**State Structure**: -```typescript -interface Plate { - id: string; - name: string; - width: number; - depth: number; - bedType: string; - printerType: string; - objectIds: string[]; -} -interface ObjectAssignment { - objectId: string; - plateId: string; - position: { x: number; y: number; z: number }; - rotation: { x: number; y: number; z: number }; - scale: { x: number; y: number; z: number }; -} -interface ViewerState { - selectedPlateId: string | null; - selectedObjectIds: string[]; - filterMode: 'all' | 'plate'; -} -``` -**Storage Considerations**: -- In-memory state for current session -- Optional: Save plate configurations to localStorage -- Optional: Save to backend as user preferences -### 4. Backend API Requirements -**Goal**: API endpoints for saving/loading plate configurations -**Required Endpoints**: -#### A. Get Plate Metadata -``` -GET /api/v1/library/files/{id}/plates -``` -Returns plate metadata from 3MF file -#### B. Save Plate Configuration (Optional) -``` -POST /api/v1/library/files/{id}/plates/config -Body: { - plates: Plate[]; - defaultPlateId?: string; -} -``` -Save custom plate names, assignments to user preferences -#### C. Get Plate Thumbnail -``` -GET /api/v1/library/files/{id}/plates/{plateId}/thumbnail -``` -Returns PNG image of specific plate -### 5. Implementation Steps -#### Step 1: 3MF Metadata Parser -- Create `PlateMetadataParser` class -- Implement `parse3MFPlateMetadata(file: File)` method -- Extract `Metadata/model_settings.config` from ZIP -- Parse XML structure -- Return typed plate metadata -#### Step 2: Update ModelViewer Component -- Add `plates` prop to ModelViewerProps -- Add `selectedPlateId` prop to ModelViewerProps -- Add `selectedObjectIds` prop to ModelViewerProps -- Add `filterMode` prop to ModelViewerProps -- Modify `useEffect` to filter objects by selected plate -- Add plate selection state management -- Implement object highlighting for selected objects -- Add plate grid overlay visualization -#### Step 3: Update ModelViewerModal -- Add plate selector UI (tabs or dropdown) -- Display plate information panel -- Show plate thumbnail preview -- Add "All Plates" view option -- Pass selected plate and objects to ModelViewer -#### Step 4: Update FileManagerPage -- Add plate management state -- Add plate selector to file cards (optional) -- Display plate badge on file cards -- Add plate count indicator in file list -#### Step 5: API Client Updates -- Add `getLibraryFilePlates(fileId: number)` method -- Add `saveLibraryFilePlateConfig(fileId: number, config: PlateConfig)` method -- Add `getLibraryFilePlateThumbnail(fileId: number, plateId: string)` method -#### Step 6: Testing -- Test with multi-plate 3MF files -- Test plate selection and object filtering -- Test plate switching -- Test object highlighting -- Verify thumbnail generation -### 6. Technical Considerations -#### A. Coordinate Systems -- **3MF**: Uses local (0,0,0) origin per plate -- **Viewer**: Uses Three.js Y-up coordinate system -- **Challenge**: Need to convert between coordinate systems when rendering specific plates -**Solution**: Store plate origin offset, apply when rendering specific plate -#### B. Performance -- **Lazy Loading**: Load plate metadata on-demand, not entire file upfront -- **Object Culling**: Don't render objects not on current plate -- **Thumbnail Caching**: Cache plate thumbnails -#### C. Backward Compatibility -- **Single Plate Files**: Continue working as-is (show all plates) -- **No Plate Metadata**: Gracefully degrade to full model view -- **STL Files**: Plate management not applicable (no plate structure) -### 7. UI/UX Flow -```mermaid -flowchart TD - A[User opens 3MF file] --> B{3D Viewer loads file} - B --> C{Parse plate metadata} - C --> D{Display plate selector} - D --> E{User selects plate} - E --> F{Filter objects by plate} - F --> G{Highlight selected objects} - G --> H{Render plate-specific view} - H --> I{User clicks Print} -``` -### 8. Limitations -- **Complexity**: 3MF plate structure is complex, requires careful XML parsing -- **File Size**: Large 3MF files with many plates may have performance impact -- **STL Files**: No plate structure, feature not applicable -- **Testing**: Extensive testing needed for various plate configurations -- **Backward Compatibility**: Must maintain existing single-plate view behavior -### 9. Future Enhancements (Out of Scope) -- **Object Manipulation**: Drag-and-drop, rotation, scaling -- **Plate Creation**: Add new plates, duplicate objects between plates -- **Plate Templates**: Save and reuse plate configurations -- **Batch Operations**: Apply settings to multiple plates at once -- **Visual Plate Editor**: Graphical plate layout designer -## Success Criteria -- [ ] Users can view all plates in a 3MF file -- [ ] Users can select individual plates -- [ ] Objects are filtered by selected plate -- [ ] Selected objects are highlighted in 3D view -- [ ] Plate information is displayed (name, dimensions, bed type) -- [ ] Plate thumbnails are shown -- [ ] Works with both 3MF and STL files -- [ ] Backward compatible with single-plate files -- [ ] Performance is acceptable with large files -- [ ] All existing features continue to work -## Implementation Priority -1. **High**: Core plate parsing and rendering -2. **Medium**: UI components and state management -3. **Low**: Backend API and advanced features -4. **Future**: Object manipulation and plate creation diff --git a/whats_new.md b/whats_new.md deleted file mode 100644 index 8fa13e10d..000000000 --- a/whats_new.md +++ /dev/null @@ -1,28 +0,0 @@ -# What's New: 3D File Preview Updates - -## Overview -- Expanded 3D previews in the Library File Manager and Printer File Manager. -- Added STL support (interactive 3D view) alongside existing 3MF/G-code previews. -- Improved multi-plate handling for 3MF files in the printer file manager. - -## Library File Manager (Files Page) -- 3D preview now supports `.3mf`, `.gcode`, and `.stl` files. -- STL files open in the same viewer modal used by 3MF files. -- Plate-aware selection continues to work for 3MF files with multiple plates. - -## Printer File Manager (Printers → File Manager) -- Added a 3D View action for `.3mf`, `.gcode`, and `.stl` files on the printer. -- New printer-side 3MF plate endpoints: - - Plate list and metadata retrieval. - - Plate thumbnail retrieval. -- Added a printer-side gcode preview endpoint for 3MF and `.gcode` files. -- STL models are centered on the build sheet in the 3D viewer. - -## Model Viewer Enhancements -- Added STL rendering support using `STLLoader`. -- Viewer now selects the correct rendering pipeline based on file type. -- STL models auto-center on the build plate for a consistent viewing experience. - -## Affected Areas -- Frontend: File Manager modals and 3D viewer. -- Backend: Printer file preview endpoints for plates, plate thumbnails, and gcode.