slicer-studio 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/dist/slicer-studio.js +19 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -735,6 +735,18 @@ import type { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
|
735
735
|
export interface SlicerStudioElement extends HTMLElement {
|
|
736
736
|
config: Record<string, unknown>;
|
|
737
737
|
getPrice(): Promise<void> | void;
|
|
738
|
+
open(items: Array<{
|
|
739
|
+
file: File;
|
|
740
|
+
copies?: number;
|
|
741
|
+
settings?: {
|
|
742
|
+
printer?: string;
|
|
743
|
+
material?: string;
|
|
744
|
+
quality?: 'standard' | 'medium' | 'high';
|
|
745
|
+
infill?: number;
|
|
746
|
+
walls?: number;
|
|
747
|
+
supports?: boolean;
|
|
748
|
+
};
|
|
749
|
+
}>): Promise<void>;
|
|
738
750
|
}
|
|
739
751
|
|
|
740
752
|
declare module 'react' {
|
|
@@ -867,6 +879,8 @@ studio.addEventListener('buttonclick', e => {
|
|
|
867
879
|
});
|
|
868
880
|
|
|
869
881
|
studio.getPrice(); // does what the Get the price button does
|
|
882
|
+
|
|
883
|
+
await studio.open([{ file, copies: 2 }]); // in advanced mode: puts files on new plates
|
|
870
884
|
```
|
|
871
885
|
|
|
872
886
|
### `estimate`
|
|
@@ -944,6 +958,45 @@ await customElements.whenDefined('slicer-studio');
|
|
|
944
958
|
studio.getPrice();
|
|
945
959
|
```
|
|
946
960
|
|
|
961
|
+
### `open(items)`
|
|
962
|
+
|
|
963
|
+
Puts files on new plates in `advanced` mode, as if staff had dropped them there, each with its own copies and settings.
|
|
964
|
+
It returns a promise that resolves once the files are on the plates.
|
|
965
|
+
|
|
966
|
+
```js
|
|
967
|
+
await customElements.whenDefined('slicer-studio');
|
|
968
|
+
await studio.open([
|
|
969
|
+
{ file, copies: 2, settings: { printer: 'Bambu Lab P1S 0.4 nozzle', material: 'PLA', quality: 'standard', infill: 15, walls: 3, supports: true } },
|
|
970
|
+
{ file: another }, // one copy, with the settings the studio shows
|
|
971
|
+
]);
|
|
972
|
+
```
|
|
973
|
+
|
|
974
|
+
| Key | Value |
|
|
975
|
+
|---|---|
|
|
976
|
+
| `file` | A `File`, such as one from an `<input type="file">` or a `fetch` turned into a `File`. Required |
|
|
977
|
+
| `copies` | `1` to `100`, placed as the copies control places them. `1` when left out |
|
|
978
|
+
| `settings.printer` | A printer name, as in [Staff `GET /options`](#staff-get-options). One your backend doesn't list becomes your default printer, as a remembered printer does |
|
|
979
|
+
| `settings.material` | `PLA`, `PETG` and so on, one the printer has profiles for |
|
|
980
|
+
| `settings.quality` | `standard` (0.2 mm), `medium` (0.15 mm) or `high` (0.1 mm) |
|
|
981
|
+
| `settings.infill` | `10`, `15`, `20`, `30`, `40`, `50`, `60`, `70`, `80` or `90` |
|
|
982
|
+
| `settings.walls` | `1` to `6` |
|
|
983
|
+
| `settings.supports` | `true` or `false` |
|
|
984
|
+
|
|
985
|
+
- **Where files go:** files with the same settings share a new plate with those settings, and each other set of settings
|
|
986
|
+
gets a plate of its own. What doesn't fit goes on more plates, as **Arrange** does. STEP and IGES files get a plate
|
|
987
|
+
each, because the slicer places them. Plates already in the studio stay as they are.
|
|
988
|
+
- **Afterwards** the studio shows **Prepare**, with the first new plate selected.
|
|
989
|
+
- **Settings left out** keep the ones the studio shows: the selected plate's, or your defaults before the first plate.
|
|
990
|
+
Another printer starts from its own process and filament, as when staff pick one.
|
|
991
|
+
- **Bad values** are left out, each with a `slicer-studio:` warning in the console, and the file still goes on. An entry
|
|
992
|
+
without a `File` is left out the same way.
|
|
993
|
+
- **Limits:** the same as a drop, 10 files on the plates and 50 MB each, up to 500,000 triangles a model, 50 objects and
|
|
994
|
+
1,000,000 triangles a plate, and 10 plates. What goes over shows the same message as a drop, and the rest still goes on.
|
|
995
|
+
- **When it works:** only in `advanced` mode. In `quote` mode, or if the mode changes while it waits, it rejects with an
|
|
996
|
+
`Error`. It waits for the studio to be ready, including your printer list and each printer's bed, so you can call it
|
|
997
|
+
straight after `whenDefined`. If your [`advanced`](#staff-access) servers turn the visitor away, it rejects.
|
|
998
|
+
- Calls run one after another, in the order made. Anything but a list rejects with a `TypeError`.
|
|
999
|
+
|
|
947
1000
|
## Layout and styling
|
|
948
1001
|
|
|
949
1002
|
The studio is as wide as its container, and you can style the tag like any block:
|