From 18c1e6e12bf38b9617b65f53633a433554e4cb45 Mon Sep 17 00:00:00 2001 From: ochafik Date: Tue, 24 Dec 2024 00:51:39 +0000 Subject: [PATCH] Fix 3mf export --- src/components/ExportButton.tsx | 13 +++++-- src/components/Footer.tsx | 26 +++++++++++-- src/io/export_3mf.ts | 21 +++++++---- src/io/export_glb.ts | 2 +- src/runner/actions.ts | 2 +- src/state/model.ts | 67 +++++++++++++++++++-------------- 6 files changed, 87 insertions(+), 44 deletions(-) diff --git a/src/components/ExportButton.tsx b/src/components/ExportButton.tsx index fe4b8db..0a39cd5 100644 --- a/src/components/ExportButton.tsx +++ b/src/components/ExportButton.tsx @@ -30,25 +30,32 @@ export default function ExportButton({className, style}: {className?: string, st ] : [ { data: 'glb', - buttonLabel: 'GLB', + buttonLabel: 'Download GLB', label: 'GLB (binary glTF)', icon: 'pi pi-file', command: () => model!.setFormats(undefined, 'glb'), }, { data: 'stl', - buttonLabel: 'STL', + buttonLabel: 'Download STL', label: 'STL (binary)', icon: 'pi pi-file', command: () => model!.setFormats(undefined, 'stl'), }, { data: 'off', - buttonLabel: 'OFF', + buttonLabel: 'Download OFF', label: 'OFF (Object File Format)', icon: 'pi pi-file', command: () => model!.setFormats(undefined, 'off'), }, + { + data: '3mf', + buttonLabel: 'Download 3MF', + label: '3MF (3D Manufacturing Format)', + icon: 'pi pi-file', + command: () => model!.setFormats(undefined, '3mf'), + }, ]; const exportFormat = state.is2D ? state.params.exportFormat2D : state.params.exportFormat3D; diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 61a34ed..b6c022f 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -6,7 +6,6 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; import { Button } from 'primereact/button'; import { ProgressBar } from 'primereact/progressbar'; import { Badge } from 'primereact/badge'; -import { Menu } from 'primereact/menu'; import { Toast } from 'primereact/toast'; import HelpMenu from './HelpMenu'; import ExportButton from './ExportButton'; @@ -53,14 +52,35 @@ export default function Footer({style}: {style?: CSSProperties}) { margin: '5px', ...(style ?? {}) }}> -