@onerjs/serializers 8.41.6 → 8.41.8

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.
Files changed (67) hide show
  1. package/3MF/3mfSerializer.configuration.d.ts +9 -0
  2. package/3MF/3mfSerializer.configuration.js +11 -0
  3. package/3MF/3mfSerializer.configuration.js.map +1 -0
  4. package/3MF/3mfSerializer.d.ts +132 -0
  5. package/3MF/3mfSerializer.js +328 -0
  6. package/3MF/3mfSerializer.js.map +1 -0
  7. package/3MF/core/index.d.ts +2 -0
  8. package/3MF/core/index.js +4 -0
  9. package/3MF/core/index.js.map +1 -0
  10. package/3MF/core/model/3mf.builder.d.ts +231 -0
  11. package/3MF/core/model/3mf.builder.js +403 -0
  12. package/3MF/core/model/3mf.builder.js.map +1 -0
  13. package/3MF/core/model/3mf.d.ts +329 -0
  14. package/3MF/core/model/3mf.interfaces.d.ts +321 -0
  15. package/3MF/core/model/3mf.interfaces.js +39 -0
  16. package/3MF/core/model/3mf.interfaces.js.map +1 -0
  17. package/3MF/core/model/3mf.js +377 -0
  18. package/3MF/core/model/3mf.js.map +1 -0
  19. package/3MF/core/model/3mf.opc.d.ts +66 -0
  20. package/3MF/core/model/3mf.opc.interfaces.d.ts +126 -0
  21. package/3MF/core/model/3mf.opc.interfaces.js +75 -0
  22. package/3MF/core/model/3mf.opc.interfaces.js.map +1 -0
  23. package/3MF/core/model/3mf.opc.js +91 -0
  24. package/3MF/core/model/3mf.opc.js.map +1 -0
  25. package/3MF/core/model/3mf.serializer.d.ts +118 -0
  26. package/3MF/core/model/3mf.serializer.js +171 -0
  27. package/3MF/core/model/3mf.serializer.js.map +1 -0
  28. package/3MF/core/model/3mf.types.d.ts +46 -0
  29. package/3MF/core/model/3mf.types.js +2 -0
  30. package/3MF/core/model/3mf.types.js.map +1 -0
  31. package/3MF/core/model/index.d.ts +7 -0
  32. package/3MF/core/model/index.js +8 -0
  33. package/3MF/core/model/index.js.map +1 -0
  34. package/3MF/core/xml/index.d.ts +6 -0
  35. package/3MF/core/xml/index.js +7 -0
  36. package/3MF/core/xml/index.js.map +1 -0
  37. package/3MF/core/xml/xml.builder.bytes.d.ts +33 -0
  38. package/3MF/core/xml/xml.builder.bytes.js +60 -0
  39. package/3MF/core/xml/xml.builder.bytes.js.map +1 -0
  40. package/3MF/core/xml/xml.builder.d.ts +94 -0
  41. package/3MF/core/xml/xml.builder.js +286 -0
  42. package/3MF/core/xml/xml.builder.js.map +1 -0
  43. package/3MF/core/xml/xml.builder.string.d.ts +19 -0
  44. package/3MF/core/xml/xml.builder.string.js +35 -0
  45. package/3MF/core/xml/xml.builder.string.js.map +1 -0
  46. package/3MF/core/xml/xml.interfaces.d.ts +91 -0
  47. package/3MF/core/xml/xml.interfaces.js +110 -0
  48. package/3MF/core/xml/xml.interfaces.js.map +1 -0
  49. package/3MF/core/xml/xml.serializer.d.ts +39 -0
  50. package/3MF/core/xml/xml.serializer.format.d.ts +92 -0
  51. package/3MF/core/xml/xml.serializer.format.js +122 -0
  52. package/3MF/core/xml/xml.serializer.format.js.map +1 -0
  53. package/3MF/core/xml/xml.serializer.js +261 -0
  54. package/3MF/core/xml/xml.serializer.js.map +1 -0
  55. package/3MF/index.d.ts +3 -0
  56. package/3MF/index.js +5 -0
  57. package/3MF/index.js.map +1 -0
  58. package/index.d.ts +1 -0
  59. package/index.js +1 -0
  60. package/index.js.map +1 -1
  61. package/legacy/legacy-3mfSerializer.d.ts +1 -0
  62. package/legacy/legacy-3mfSerializer.js +20 -0
  63. package/legacy/legacy-3mfSerializer.js.map +1 -0
  64. package/legacy/legacy.d.ts +1 -0
  65. package/legacy/legacy.js +1 -0
  66. package/legacy/legacy.js.map +1 -1
  67. package/package.json +3 -3
@@ -0,0 +1,329 @@
1
+ import { type IFormatter } from "../xml/xml.interfaces.js";
2
+ import { type IXmlSerializerFormatOptions, NumberFormatter } from "../xml/xml.serializer.format.js";
3
+ import type { I3mfBase, I3mfBaseMaterials, I3mfBuild, I3mfComponent, I3mfComponents, I3mfItem, I3mfMesh, I3mfMetadata, I3mfMetadataGroup, I3mfModel, I3mfObject, I3mfResources, I3mfTriangle, I3mfTriangles, I3mfVertex, I3mfVertices, ST_ColorValue, ST_Number, ST_ResourceID, ST_ResourceIndex, ST_UriReference, IMatrix3d, ST_Matrix3D } from "./3mf.interfaces.js";
4
+ import { ST_Unit, ST_ObjectType } from "./3mf.interfaces.js";
5
+ /**
6
+ *
7
+ */
8
+ export declare class Matrix3d implements IMatrix3d {
9
+ values: ST_Matrix3D;
10
+ /**
11
+ *
12
+ * @returns
13
+ */
14
+ static Zero(): Matrix3d;
15
+ /**
16
+ *
17
+ * @param values
18
+ */
19
+ constructor(values: ST_Matrix3D);
20
+ /**
21
+ *
22
+ * @returns
23
+ */
24
+ toString(): string;
25
+ }
26
+ /**
27
+ *
28
+ */
29
+ export declare class MatrixFormatter implements IFormatter<Matrix3d> {
30
+ o: IXmlSerializerFormatOptions;
31
+ /**
32
+ *
33
+ */
34
+ _f: NumberFormatter;
35
+ constructor(o: IXmlSerializerFormatOptions);
36
+ toString(x: Matrix3d): string;
37
+ }
38
+ /**
39
+ *
40
+ */
41
+ export declare class ThreeMfModel implements I3mfModel {
42
+ /**
43
+ *
44
+ */
45
+ static KnownMeta: Array<string>;
46
+ /**
47
+ *
48
+ */
49
+ unit: ST_Unit;
50
+ /**
51
+ *
52
+ */
53
+ requiredextensions?: string;
54
+ /**
55
+ *
56
+ */
57
+ recommendedextensions?: string;
58
+ /**
59
+ *
60
+ */
61
+ metadata?: Array<I3mfMetadata>;
62
+ /**
63
+ *
64
+ */
65
+ resources?: I3mfResources;
66
+ /**
67
+ *
68
+ */
69
+ build?: I3mfBuild;
70
+ }
71
+ /**
72
+ *
73
+ */
74
+ export declare class ThreeMfMeta implements I3mfMetadata {
75
+ /**
76
+ *
77
+ */
78
+ name: string;
79
+ /**
80
+ *
81
+ */
82
+ preserve?: boolean;
83
+ /**
84
+ *
85
+ */
86
+ type?: string;
87
+ /**
88
+ *
89
+ */
90
+ value: string;
91
+ /**
92
+ *
93
+ * @param name
94
+ * @param value
95
+ * @param preserve
96
+ * @param type
97
+ */
98
+ constructor(name: string, value: string, preserve?: boolean, type?: string);
99
+ }
100
+ /**
101
+ *
102
+ */
103
+ export declare class ThreeMfMetadataGroup implements I3mfMetadataGroup {
104
+ /**
105
+ *
106
+ */
107
+ metadata: Array<I3mfMetadata>;
108
+ }
109
+ /**
110
+ *
111
+ */
112
+ export declare class ThreeMfResources implements I3mfResources {
113
+ /**
114
+ *
115
+ */
116
+ object: Array<I3mfObject>;
117
+ /**
118
+ *
119
+ */
120
+ basematerials?: Array<I3mfBaseMaterials>;
121
+ }
122
+ /**
123
+ *
124
+ */
125
+ export declare class ThreeMfObject implements I3mfObject {
126
+ /**
127
+ *
128
+ */
129
+ id: ST_ResourceID;
130
+ /**
131
+ *
132
+ */
133
+ type?: ST_ObjectType;
134
+ /**
135
+ *
136
+ */
137
+ thumbnail?: ST_UriReference;
138
+ /**
139
+ *
140
+ */
141
+ partnumber?: string;
142
+ /**
143
+ *
144
+ */
145
+ name?: string;
146
+ /**
147
+ *
148
+ */
149
+ pid?: ST_ResourceID;
150
+ /**
151
+ *
152
+ */
153
+ pindex?: ST_ResourceIndex;
154
+ /**
155
+ *
156
+ */
157
+ metadatagroup?: I3mfMetadataGroup;
158
+ /**
159
+ *
160
+ */
161
+ content?: I3mfMesh | I3mfComponents;
162
+ constructor(id: ST_ResourceID, type?: ST_ObjectType);
163
+ }
164
+ /**
165
+ *
166
+ */
167
+ export declare class ThreeMfMesh implements I3mfMesh {
168
+ /**
169
+ *
170
+ */
171
+ vertices: I3mfVertices;
172
+ /**
173
+ *
174
+ */
175
+ triangles: I3mfTriangles;
176
+ constructor(vertices?: I3mfVertices, triangles?: I3mfTriangles);
177
+ }
178
+ /**
179
+ *
180
+ */
181
+ export declare class ThreeMfVertices implements I3mfVertices {
182
+ /**
183
+ *
184
+ */
185
+ vertex: Array<I3mfVertex>;
186
+ }
187
+ /**
188
+ *
189
+ */
190
+ export declare class ThreeMfVertex implements I3mfVertex {
191
+ /**
192
+ *
193
+ */
194
+ x: ST_Number;
195
+ /**
196
+ *
197
+ */
198
+ y: ST_Number;
199
+ /**
200
+ *
201
+ */
202
+ z: ST_Number;
203
+ constructor(x?: ST_Number, y?: ST_Number, z?: ST_Number);
204
+ }
205
+ /**
206
+ *
207
+ */
208
+ export declare class ThreeMfTriangles implements I3mfTriangles {
209
+ /**
210
+ *
211
+ */
212
+ triangle: Array<I3mfTriangle>;
213
+ }
214
+ /**
215
+ *
216
+ */
217
+ export declare class ThreeMfTriangle implements I3mfTriangle {
218
+ /**
219
+ *
220
+ */
221
+ v1: ST_ResourceIndex;
222
+ /**
223
+ *
224
+ */
225
+ v2: ST_ResourceIndex;
226
+ /**
227
+ *
228
+ */
229
+ v3: ST_ResourceIndex;
230
+ /**
231
+ *
232
+ */
233
+ p1?: ST_ResourceIndex;
234
+ /**
235
+ *
236
+ */
237
+ p2?: ST_ResourceIndex;
238
+ /**
239
+ *
240
+ */
241
+ p3?: ST_ResourceIndex;
242
+ /**
243
+ *
244
+ */
245
+ pid?: ST_ResourceID;
246
+ constructor(v1: ST_ResourceIndex, v2: ST_ResourceIndex, v3: ST_ResourceIndex);
247
+ }
248
+ /**
249
+ *
250
+ */
251
+ export declare class ThreeMfComponents implements I3mfComponents {
252
+ /**
253
+ *
254
+ */
255
+ component: Array<I3mfComponent>;
256
+ }
257
+ /**
258
+ *
259
+ */
260
+ export declare class ThreeMfComponent implements I3mfComponent {
261
+ /**
262
+ *
263
+ */
264
+ objectid: ST_ResourceID;
265
+ /**
266
+ *
267
+ */
268
+ transform?: Matrix3d;
269
+ constructor(objectid: ST_ResourceID, transform?: Matrix3d);
270
+ }
271
+ /**
272
+ *
273
+ */
274
+ export declare class ThreeMfBaseMaterials implements I3mfBaseMaterials {
275
+ /**
276
+ *
277
+ */
278
+ id: ST_ResourceID;
279
+ /**
280
+ *
281
+ */
282
+ base: Array<I3mfBase>;
283
+ constructor(id: ST_ResourceID);
284
+ }
285
+ /**
286
+ *
287
+ */
288
+ export declare class ThreeMfBase implements I3mfBase {
289
+ /**
290
+ *
291
+ */
292
+ name: string;
293
+ /**
294
+ *
295
+ */
296
+ displaycolor: ST_ColorValue;
297
+ constructor(name: string, displaycolor: ST_ColorValue);
298
+ }
299
+ /**
300
+ *
301
+ */
302
+ export declare class ThreeMfBuild implements I3mfBuild {
303
+ /**
304
+ *
305
+ */
306
+ item: Array<I3mfItem>;
307
+ }
308
+ /**
309
+ *
310
+ */
311
+ export declare class ThreeMfItem implements I3mfItem {
312
+ /**
313
+ *
314
+ */
315
+ objectid: ST_ResourceID;
316
+ /**
317
+ *
318
+ */
319
+ transform?: Matrix3d;
320
+ /**
321
+ *
322
+ */
323
+ partnumber?: string;
324
+ /**
325
+ *
326
+ */
327
+ metadatagroup?: I3mfMetadataGroup;
328
+ constructor(objectid: ST_ResourceID, transform?: Matrix3d, partnumber?: string);
329
+ }
@@ -0,0 +1,321 @@
1
+ /**
2
+ * XML namespace for the core 3MF model schema.
3
+ * This is the default namespace used by <model> and most standard 3MF elements.
4
+ */
5
+ export declare const ThreeDimModelNamespace = "http://schemas.microsoft.com/3dmanufacturing/core/2015/02";
6
+ /**
7
+ * XML namespace for the TriangleSets extension (2021/07).
8
+ * This extension is used for more advanced triangle/property use cases.
9
+ * Only declare/use it when you actually emit elements/attributes that require it.
10
+ */
11
+ export declare const TriangleSetsNamespace = "http://schemas.microsoft.com/3dmanufacturing/trianglesets/2021/07";
12
+ /**
13
+ * 3MF model units.
14
+ * The unit affects interpretation of vertex coordinates (x,y,z).
15
+ * Most pipelines use millimeter, but the writer should match the upstream scene unit expectations.
16
+ */
17
+ export declare enum ST_Unit {
18
+ micron = "micron",
19
+ millimeter = "millimeter",
20
+ centimeter = "centimeter",
21
+ inch = "inch",
22
+ foot = "foot",
23
+ meter = "meter"
24
+ }
25
+ /**
26
+ * In the XSD, ST_Matrix3D is a whitespace separated list of numbers.
27
+ * The official 3MF core spec uses a 3x4 matrix (12 numbers).
28
+ */
29
+ export type ST_Matrix3D = [number, number, number, number, number, number, number, number, number, number, number, number];
30
+ /**
31
+ *
32
+ */
33
+ export interface IMatrix3d {
34
+ /** */
35
+ values: ST_Matrix3D;
36
+ }
37
+ /**
38
+ * 3MF color value.
39
+ * In the 3MF core spec, colors are typically expressed as sRGB hex strings: "#RRGGBB" (and sometimes "#AARRGGBB").
40
+ * This type is kept as string because we serialize directly into XML and want to avoid coupling to a specific color class.
41
+ */
42
+ export type ST_ColorValue = string;
43
+ /**
44
+ * URI reference type used by attributes like thumbnail.
45
+ * Usually a relative package path inside the OPC container, for example "/Metadata/thumbnail.png".
46
+ */
47
+ export type ST_UriReference = string;
48
+ /**
49
+ * Numeric type used for coordinates and similar scalar values.
50
+ * 3MF stores numbers as XML attributes/text; here we represent them as JS numbers.
51
+ */
52
+ export type ST_Number = number;
53
+ /**
54
+ * Resource identifiers used by <object id="...">, property groups, etc.
55
+ * This is usually a positive integer unique within the model.
56
+ */
57
+ export type ST_ResourceID = number;
58
+ /**
59
+ * Resource index used to reference an entry within a resource list.
60
+ * For example, triangle v1/v2/v3 reference indices into <vertices>.
61
+ */
62
+ export type ST_ResourceIndex = number;
63
+ /**
64
+ * Standard 3MF object type.
65
+ * This is optional in 3MF; if omitted, consumers often treat it as "model".
66
+ */
67
+ export declare enum ST_ObjectType {
68
+ model = "model",
69
+ solidsupport = "solidsupport",
70
+ support = "support",
71
+ surface = "surface",
72
+ other = "other"
73
+ }
74
+ /**
75
+ * Generic metadata entry.
76
+ * Metadata can appear at the model level (<metadata>) and inside metadata groups (<metadatagroup>).
77
+ *
78
+ * Notes:
79
+ * - "name" is the metadata key.
80
+ * - "type" is optional and can be a MIME type or a schema indicator depending on usage.
81
+ * - "preserve" instructs consumers whether to keep metadata when modifying the model.
82
+ */
83
+ export interface I3mfMetadata {
84
+ /** Metadata key (required). */
85
+ name: string;
86
+ /** If true, indicates the metadata should be preserved by consumers (optional). */
87
+ preserve?: boolean;
88
+ /** Optional type information for the value. */
89
+ type?: string;
90
+ /** Metadata value (required). */
91
+ value: string;
92
+ }
93
+ /**
94
+ * A grouping element for metadata.
95
+ * Used in some places where the schema allows a metadata group rather than raw metadata entries.
96
+ */
97
+ export interface I3mfMetadataGroup {
98
+ /** The list of metadata entries contained in the group. */
99
+ metadata: Array<I3mfMetadata>;
100
+ }
101
+ /**
102
+ * 3MF vertex.
103
+ * Coordinates are expressed in the model unit (I3mfModel.unit).
104
+ */
105
+ export interface I3mfVertex {
106
+ /** X coordinate. */
107
+ x: ST_Number;
108
+ /** Y coordinate. */
109
+ y: ST_Number;
110
+ /** Z coordinate. */
111
+ z: ST_Number;
112
+ }
113
+ /**
114
+ * 3MF triangle.
115
+ * v1/v2/v3 are indices into the vertices list (<vertices> \<vertex .../\>...</vertices>).
116
+ *
117
+ * Property assignment:
118
+ * - pid and p1/p2/p3 are used to assign per-triangle or per-vertex properties (like materials or colors),
119
+ * depending on which property group pid refers to.
120
+ */
121
+ export interface I3mfTriangle {
122
+ /** Index of first vertex in the vertices array. */
123
+ v1: ST_ResourceIndex;
124
+ /** Index of second vertex in the vertices array. */
125
+ v2: ST_ResourceIndex;
126
+ /** Index of third vertex in the vertices array. */
127
+ v3: ST_ResourceIndex;
128
+ /**
129
+ * Optional per-vertex property indices for v1/v2/v3.
130
+ * These are indices into the property group's entry list (the group referenced by pid).
131
+ */
132
+ p1?: ST_ResourceIndex;
133
+ /** */
134
+ p2?: ST_ResourceIndex;
135
+ /** */
136
+ p3?: ST_ResourceIndex;
137
+ /**
138
+ * Property group id for this triangle.
139
+ * If present, it overrides the object-level pid for this specific triangle.
140
+ */
141
+ pid?: ST_ResourceID;
142
+ }
143
+ /**
144
+ * Container for vertices.
145
+ * Matches the XML structure <vertices>\<vertex .../\>...</vertices>.
146
+ */
147
+ export interface I3mfVertices {
148
+ /** Array of vertices. Order matters because triangles reference indices. */
149
+ vertex: Array<I3mfVertex>;
150
+ }
151
+ /**
152
+ * Container for triangles.
153
+ * Matches the XML structure <triangles>\<triangle .../\>...</triangles>.
154
+ */
155
+ export interface I3mfTriangles {
156
+ /** Array of triangles. */
157
+ triangle: Array<I3mfTriangle>;
158
+ }
159
+ /**
160
+ * Mesh geometry content for an object.
161
+ * Exactly one of: mesh content OR components content should be provided in an object.
162
+ */
163
+ export interface I3mfMesh {
164
+ /** Vertex list. */
165
+ vertices: I3mfVertices;
166
+ /** Triangle list. */
167
+ triangles: I3mfTriangles;
168
+ }
169
+ /**
170
+ * Component reference inside a composite object.
171
+ * A composite object is an object whose content is <components> rather than <mesh>.
172
+ *
173
+ * objectid references another object in resources.
174
+ * transform (3x4) positions that referenced object within the composite.
175
+ */
176
+ export interface I3mfComponent {
177
+ /** Referenced object id. */
178
+ objectid: ST_ResourceID;
179
+ /**
180
+ * Optional transform applied to the referenced object within the component.
181
+ * Represented as a 3x4 matrix.
182
+ */
183
+ transform?: IMatrix3d;
184
+ }
185
+ /**
186
+ * Container for components.
187
+ * Matches <components><component objectid="..."/></components>.
188
+ */
189
+ export interface I3mfComponents {
190
+ /** Array of component references. */
191
+ component: Array<I3mfComponent>;
192
+ }
193
+ /**
194
+ * Object resource.
195
+ * An object either contains a mesh (geometry) or components (composite object).
196
+ *
197
+ * Properties (pid/pindex):
198
+ * - pid references a property group (e.g. basematerials id).
199
+ * - pindex is an index within that group.
200
+ * - If pindex is used, pid is required.
201
+ *
202
+ * Metadata:
203
+ * - metadatagroup is optional and can store additional object-level metadata.
204
+ */
205
+ export interface I3mfObject {
206
+ /** Unique object id within the model. */
207
+ id: ST_ResourceID;
208
+ /** Optional object type hint. */
209
+ type?: ST_ObjectType;
210
+ /** Optional thumbnail reference (usually a package path). */
211
+ thumbnail?: ST_UriReference;
212
+ /** Optional part number (often used by manufacturing systems). */
213
+ partnumber?: string;
214
+ /** Optional human-readable name. */
215
+ name?: string;
216
+ /**
217
+ * Property group reference.
218
+ * Example: <basematerials id="5"> ... </basematerials> then pid=5.
219
+ * Required if pindex is specified.
220
+ */
221
+ pid?: ST_ResourceID;
222
+ /**
223
+ * Index inside the property group referenced by pid.
224
+ * Meaning depends on the property group type (base materials, color group, etc.).
225
+ */
226
+ pindex?: ST_ResourceIndex;
227
+ /** Optional grouped metadata for the object. */
228
+ metadatagroup?: I3mfMetadataGroup;
229
+ /**
230
+ * Content of the object:
231
+ * - Mesh geometry OR
232
+ * - Components (composite object).
233
+ *
234
+ * In the 3MF XML schema, this corresponds to having either a <mesh> element or a <components> element.
235
+ */
236
+ content?: I3mfMesh | I3mfComponents;
237
+ }
238
+ /**
239
+ * A single base material entry.
240
+ * "name" is a label, "displaycolor" provides the color used for rendering previews.
241
+ */
242
+ export interface I3mfBase {
243
+ /** Material name/label. */
244
+ name: string;
245
+ /** Display color for the base material. */
246
+ displaycolor: ST_ColorValue;
247
+ }
248
+ /**
249
+ * Base materials property group.
250
+ * Triangles or objects can reference this group via pid, and then a specific entry via pindex (or p1/p2/p3).
251
+ */
252
+ export interface I3mfBaseMaterials {
253
+ /** Property group id. Must be unique within resources. */
254
+ id: ST_ResourceID;
255
+ /** List of base material entries. */
256
+ base: Array<I3mfBase>;
257
+ }
258
+ /**
259
+ * Model resources container.
260
+ * Holds object resources and optional property groups such as basematerials.
261
+ */
262
+ export interface I3mfResources {
263
+ /** All objects available for build items and components. */
264
+ object: Array<I3mfObject>;
265
+ /**
266
+ * Optional base materials groups.
267
+ * Other property groups may exist in 3MF (colors, textures, etc.) but are not modeled here.
268
+ */
269
+ basematerials?: Array<I3mfBaseMaterials>;
270
+ }
271
+ /**
272
+ * Build item.
273
+ * The build section describes what to "print" or "instantiate" from the resources.
274
+ *
275
+ * objectid references a resource object, and transform places it in the world.
276
+ * partnumber and metadatagroup allow attaching build-item specific info.
277
+ */
278
+ export interface I3mfItem {
279
+ /** Referenced object id to build. */
280
+ objectid: ST_ResourceID;
281
+ /** Optional placement transform (3x4). */
282
+ transform?: IMatrix3d;
283
+ /** Optional part number at the build item level. */
284
+ partnumber?: string;
285
+ /** Optional build-item metadata. */
286
+ metadatagroup?: I3mfMetadataGroup;
287
+ }
288
+ /**
289
+ * Build container.
290
+ * Contains all build items.
291
+ */
292
+ export interface I3mfBuild {
293
+ /** Array of build items. */
294
+ item: Array<I3mfItem>;
295
+ }
296
+ /**
297
+ * Root model element.
298
+ *
299
+ * Extensions:
300
+ * - requiredextensions: a space-separated list of prefixes (or namespaces depending on your serializer conventions)
301
+ * that are required to interpret the model.
302
+ * - recommendedextensions: extensions that improve fidelity but are not required.
303
+ *
304
+ * Notes:
305
+ * - resources and build are typically present in a valid printable model.
306
+ * - metadata at the model level stores global information like title, author, etc.
307
+ */
308
+ export interface I3mfModel {
309
+ /** Unit used for all coordinates in the model. */
310
+ unit?: ST_Unit;
311
+ /** Declares extensions that must be understood by consumers. */
312
+ requiredextensions?: string;
313
+ /** Declares extensions that may be used for better results. */
314
+ recommendedextensions?: string;
315
+ /** Optional model-level metadata entries. */
316
+ metadata?: Array<I3mfMetadata>;
317
+ /** Optional resources section (objects, materials, etc.). */
318
+ resources?: I3mfResources;
319
+ /** Optional build section (what to instantiate/print). */
320
+ build?: I3mfBuild;
321
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * XML namespace for the core 3MF model schema.
3
+ * This is the default namespace used by <model> and most standard 3MF elements.
4
+ */
5
+ export const ThreeDimModelNamespace = "http://schemas.microsoft.com/3dmanufacturing/core/2015/02";
6
+ /**
7
+ * XML namespace for the TriangleSets extension (2021/07).
8
+ * This extension is used for more advanced triangle/property use cases.
9
+ * Only declare/use it when you actually emit elements/attributes that require it.
10
+ */
11
+ export const TriangleSetsNamespace = "http://schemas.microsoft.com/3dmanufacturing/trianglesets/2021/07";
12
+ /* eslint-disable @typescript-eslint/naming-convention */
13
+ /**
14
+ * 3MF model units.
15
+ * The unit affects interpretation of vertex coordinates (x,y,z).
16
+ * Most pipelines use millimeter, but the writer should match the upstream scene unit expectations.
17
+ */
18
+ export var ST_Unit;
19
+ (function (ST_Unit) {
20
+ ST_Unit["micron"] = "micron";
21
+ ST_Unit["millimeter"] = "millimeter";
22
+ ST_Unit["centimeter"] = "centimeter";
23
+ ST_Unit["inch"] = "inch";
24
+ ST_Unit["foot"] = "foot";
25
+ ST_Unit["meter"] = "meter";
26
+ })(ST_Unit || (ST_Unit = {}));
27
+ /**
28
+ * Standard 3MF object type.
29
+ * This is optional in 3MF; if omitted, consumers often treat it as "model".
30
+ */
31
+ export var ST_ObjectType;
32
+ (function (ST_ObjectType) {
33
+ ST_ObjectType["model"] = "model";
34
+ ST_ObjectType["solidsupport"] = "solidsupport";
35
+ ST_ObjectType["support"] = "support";
36
+ ST_ObjectType["surface"] = "surface";
37
+ ST_ObjectType["other"] = "other";
38
+ })(ST_ObjectType || (ST_ObjectType = {}));
39
+ //# sourceMappingURL=3mf.interfaces.js.map