@bitbybit-dev/manifold 1.2.0-rc.2 → 1.3.0-rc.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/lib/api/inputs/manifold-inputs.d.ts +521 -224
- package/lib/api/inputs/manifold-inputs.js +380 -135
- package/lib/api/manifold-service.d.ts +37 -11
- package/lib/api/manifold-service.js +37 -11
- package/lib/api/services/cross-section/cross-section-booleans.d.ts +66 -29
- package/lib/api/services/cross-section/cross-section-booleans.js +66 -29
- package/lib/api/services/cross-section/cross-section-evaluate.d.ts +38 -17
- package/lib/api/services/cross-section/cross-section-evaluate.js +38 -17
- package/lib/api/services/cross-section/cross-section-operations.d.ts +73 -33
- package/lib/api/services/cross-section/cross-section-operations.js +73 -33
- package/lib/api/services/cross-section/cross-section-shapes.d.ts +38 -17
- package/lib/api/services/cross-section/cross-section-shapes.js +38 -17
- package/lib/api/services/cross-section/cross-section-transforms.d.ts +64 -29
- package/lib/api/services/cross-section/cross-section-transforms.js +64 -29
- package/lib/api/services/cross-section/cross-section.d.ts +81 -20
- package/lib/api/services/cross-section/cross-section.js +81 -20
- package/lib/api/services/manifold/manifold-booleans.d.ts +139 -43
- package/lib/api/services/manifold/manifold-booleans.js +143 -43
- package/lib/api/services/manifold/manifold-evaluate.d.ts +134 -59
- package/lib/api/services/manifold/manifold-evaluate.js +141 -59
- package/lib/api/services/manifold/manifold-operations.d.ts +195 -108
- package/lib/api/services/manifold/manifold-operations.js +197 -110
- package/lib/api/services/manifold/manifold-shapes.d.ts +64 -26
- package/lib/api/services/manifold/manifold-shapes.js +66 -28
- package/lib/api/services/manifold/manifold-transforms.d.ts +100 -38
- package/lib/api/services/manifold/manifold-transforms.js +100 -38
- package/lib/api/services/manifold/manifold.d.ts +25 -8
- package/lib/api/services/manifold/manifold.js +25 -8
- package/lib/api/services/mesh/mesh-evaluate.d.ts +103 -32
- package/lib/api/services/mesh/mesh-evaluate.js +108 -33
- package/lib/api/services/mesh/mesh-operations.d.ts +12 -15
- package/lib/api/services/mesh/mesh-operations.js +12 -15
- package/lib/api/services/mesh/mesh.d.ts +4 -2
- package/lib/api/services/mesh/mesh.js +4 -2
- package/package.json +3 -3
|
@@ -1,225 +1,312 @@
|
|
|
1
1
|
import * as Inputs from "../../inputs";
|
|
2
2
|
import * as Manifold3D from "manifold-3d";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Changing Manifold solids beyond booleans: wrapping them in a convex hull, slicing and projecting
|
|
5
|
+
* them into cross-sections, refining and smoothing their meshes, simplifying them, composing and
|
|
6
|
+
* decomposing them, and computing normals and curvature into vertex property channels. A property
|
|
7
|
+
* channel is one number per vertex stored on the mesh, such as the three channels of a normal.
|
|
8
|
+
* Every method returns a new solid.
|
|
6
9
|
*/
|
|
7
10
|
export declare class ManifoldOperations {
|
|
8
11
|
private manifold;
|
|
9
12
|
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
14
|
+
* Wraps a solid in its convex hull, the smallest shape without dents that contains it, like
|
|
15
|
+
* shrink-wrap pulled tight over it.
|
|
16
|
+
* @param inputs - The solid
|
|
17
|
+
* @returns The convex hull
|
|
14
18
|
* @group hulls
|
|
15
19
|
* @shortname convex hull
|
|
16
20
|
* @drawable true
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const wrapped = await bitbybit.manifold.manifold.operations.hull({ manifold: shape });
|
|
24
|
+
* ```
|
|
17
25
|
*/
|
|
18
26
|
hull(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
19
27
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @
|
|
28
|
+
* Wraps points, solids or a mix of both in one convex hull, the smallest shape without dents
|
|
29
|
+
* that contains them all.
|
|
30
|
+
* @param inputs - The points and solids to wrap
|
|
31
|
+
* @returns The convex hull
|
|
23
32
|
* @group hulls
|
|
24
33
|
* @shortname hull points
|
|
25
34
|
* @drawable true
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const wrapped = await bitbybit.manifold.manifold.operations.hullPoints({ points: [[0, 0, 0], [10, 0, 0], [0, 10, 0], [0, 0, 10]] });
|
|
38
|
+
* ```
|
|
26
39
|
*/
|
|
27
40
|
hullPoints(inputs: Inputs.Manifold.HullPointsDto<(Inputs.Base.Point3 | Manifold3D.Manifold)[]>): Manifold3D.Manifold;
|
|
28
41
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
42
|
+
* Cuts a solid with a plane parallel to the XY plane at the given Z height and returns the flat
|
|
43
|
+
* section as a cross-section.
|
|
44
|
+
*
|
|
45
|
+
* A height at the bottom of the solid's bounding box gives its bottom faces; a height at the
|
|
46
|
+
* top gives an empty cross-section.
|
|
47
|
+
* @param inputs - The solid and the Z height of the cut
|
|
48
|
+
* @returns The section as a cross-section
|
|
35
49
|
* @group cross sections
|
|
36
50
|
* @shortname slice
|
|
37
51
|
* @drawable true
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const section = await bitbybit.manifold.manifold.operations.slice({ manifold: sphere, height: 2 });
|
|
55
|
+
* ```
|
|
38
56
|
*/
|
|
39
57
|
slice(inputs: Inputs.Manifold.SliceDto<Manifold3D.Manifold>): Manifold3D.CrossSection;
|
|
40
58
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
59
|
+
* Flattens a solid onto the XY plane and returns its outline as a cross-section, like its
|
|
60
|
+
* shadow under a light straight above.
|
|
61
|
+
* @param inputs - The solid
|
|
62
|
+
* @returns The outline as a cross-section
|
|
44
63
|
* @group cross sections
|
|
45
64
|
* @shortname project
|
|
46
65
|
* @drawable true
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const shadow = await bitbybit.manifold.manifold.operations.project({ manifold: shape });
|
|
69
|
+
* ```
|
|
47
70
|
*/
|
|
48
71
|
project(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.CrossSection;
|
|
49
72
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
73
|
+
* Gives a solid a new tolerance, the rounding error it is allowed to carry, and simplifies its
|
|
74
|
+
* mesh when the tolerance grows.
|
|
75
|
+
*
|
|
76
|
+
* Triangles thinner than the tolerance are treated as degenerate and removed.
|
|
77
|
+
* @param inputs - The solid and the tolerance in model units
|
|
78
|
+
* @returns The solid with the new tolerance
|
|
54
79
|
* @group basic
|
|
55
80
|
* @shortname set tolerance
|
|
56
81
|
* @drawable false
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* const coarser = await bitbybit.manifold.manifold.operations.setTolerance({ manifold: shape, tolerance: 0.01 });
|
|
85
|
+
* ```
|
|
57
86
|
*/
|
|
58
87
|
setTolerance(inputs: Inputs.Manifold.ManifoldRefineToleranceDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
59
88
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
89
|
+
* Reserves a run of `count` unique mesh ids and returns the first, for marking sets of
|
|
90
|
+
* triangles that can be found again after later operations.
|
|
91
|
+
*
|
|
92
|
+
* Assign them to a mesh's `runOriginalID` before building a solid from it, for instance to keep
|
|
93
|
+
* several materials apart.
|
|
94
|
+
* @param inputs - How many ids to reserve
|
|
95
|
+
* @returns The first of the reserved ids; the rest follow in sequence
|
|
63
96
|
* @group basic
|
|
64
97
|
* @shortname reserve id
|
|
65
98
|
* @drawable false
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const firstId = await bitbybit.manifold.manifold.operations.reserveIds({ count: 2 });
|
|
102
|
+
* ```
|
|
66
103
|
*/
|
|
67
104
|
reserveIds(inputs: Inputs.Manifold.CountDto): number;
|
|
68
105
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* meaning it will now be referenced by its descendants instead of the meshes
|
|
72
|
-
* it was built from, allowing you to differentiate the copies when applying
|
|
73
|
-
* your properties to the final result.
|
|
106
|
+
* Makes a copy of a solid that counts as a new original, so the copy can carry its own vertex
|
|
107
|
+
* properties, such as a different UV mapping, and be told apart from what it was built from.
|
|
74
108
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* construct a new manifold.
|
|
80
|
-
* @param inputs manifold
|
|
81
|
-
* @returns original manifold
|
|
109
|
+
* Coplanar faces are merged and the edges between them collapsed on the way; keep the mesh
|
|
110
|
+
* route instead when those edges must stay.
|
|
111
|
+
* @param inputs - The solid
|
|
112
|
+
* @returns The copy marked as an original
|
|
82
113
|
* @group basic
|
|
83
114
|
* @shortname as original
|
|
84
115
|
* @drawable true
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const original = await bitbybit.manifold.manifold.operations.asOriginal({ manifold: shape });
|
|
119
|
+
* ```
|
|
85
120
|
*/
|
|
86
121
|
asOriginal(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
87
122
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* @
|
|
123
|
+
* Packs several solids into one, the inverse of `decompose`.
|
|
124
|
+
*
|
|
125
|
+
* Solids that overlap are fused, as a boolean union would; solids kept apart stay separate
|
|
126
|
+
* pieces of the one result.
|
|
127
|
+
* @param inputs - The solids to pack together
|
|
128
|
+
* @returns One solid holding all of them
|
|
93
129
|
* @group composition
|
|
94
130
|
* @shortname compose
|
|
95
131
|
* @drawable true
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* const packed = await bitbybit.manifold.manifold.operations.compose({ manifolds: [cube, sphere] });
|
|
135
|
+
* ```
|
|
96
136
|
*/
|
|
97
137
|
compose(inputs: Inputs.Manifold.ManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
98
138
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* @
|
|
104
|
-
* @returns decomposed manifold shapes
|
|
139
|
+
* Splits a solid into its separate, unconnected pieces, the inverse of `compose`.
|
|
140
|
+
*
|
|
141
|
+
* A solid that is all one piece comes back as a list of one copy.
|
|
142
|
+
* @param inputs - The solid
|
|
143
|
+
* @returns The separate pieces
|
|
105
144
|
* @group composition
|
|
106
145
|
* @shortname decompose
|
|
107
146
|
* @drawable true
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const pieces = await bitbybit.manifold.manifold.operations.decompose({ manifold: packed });
|
|
150
|
+
* ```
|
|
108
151
|
*/
|
|
109
152
|
decompose(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.Manifold[];
|
|
110
153
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
154
|
+
* Computes a normal for every vertex from the mesh and stores it in three property channels
|
|
155
|
+
* starting at `normalIdx`.
|
|
156
|
+
*
|
|
157
|
+
* Edges sharper than `minSharpAngle`, in degrees, keep separate normals on each side and stay
|
|
158
|
+
* crisp; at 0 every triangle keeps its own normal. Flat faces of several triangles stay flat.
|
|
159
|
+
* @param inputs - The solid, the first normal channel and the sharp angle in degrees
|
|
160
|
+
* @returns The solid with normals stored
|
|
115
161
|
* @group adjustments
|
|
116
162
|
* @shortname calculate normals
|
|
117
163
|
* @drawable true
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const withNormals = await bitbybit.manifold.manifold.operations.calculateNormals({ manifold: shape, normalIdx: 0, minSharpAngle: 60 });
|
|
167
|
+
* ```
|
|
118
168
|
*/
|
|
119
169
|
calculateNormals(inputs: Inputs.Manifold.CalculateNormalsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
120
170
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @
|
|
128
|
-
* @returns manifold with calculated curvature
|
|
171
|
+
* Computes how strongly the surface bends at every vertex and stores it in property channels:
|
|
172
|
+
* Gaussian curvature at `gaussianIdx`, mean curvature at `meanIdx`.
|
|
173
|
+
*
|
|
174
|
+
* Curvature is the inverse of the bending radius, positive where the surface is convex and
|
|
175
|
+
* negative where it is concave; an index below 0 skips that channel.
|
|
176
|
+
* @param inputs - The solid and the two channels to store into
|
|
177
|
+
* @returns The solid with curvature stored
|
|
129
178
|
* @group adjustments
|
|
130
179
|
* @shortname calculate curvature
|
|
131
180
|
* @drawable true
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const withCurvature = await bitbybit.manifold.manifold.operations.calculateCurvature({ manifold: shape, gaussianIdx: 0, meanIdx: 1 });
|
|
184
|
+
* ```
|
|
132
185
|
*/
|
|
133
186
|
calculateCurvature(inputs: Inputs.Manifold.CalculateCurvatureDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
134
187
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* @
|
|
142
|
-
* @returns refined manifold
|
|
188
|
+
* Adds triangles to a smoothed solid until every point of its mesh lies within `tolerance` of
|
|
189
|
+
* the smooth surface, so tightly curved regions get more triangles than flat ones.
|
|
190
|
+
*
|
|
191
|
+
* Only a solid that was smoothed with `smoothOut` or `smoothByNormals` changes; any other comes
|
|
192
|
+
* back as a copy.
|
|
193
|
+
* @param inputs - The solid and the tolerance in model units
|
|
194
|
+
* @returns The refined solid
|
|
143
195
|
* @group adjustments
|
|
144
196
|
* @shortname refine to tolerance
|
|
145
197
|
* @drawable true
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* const finer = await bitbybit.manifold.manifold.operations.refineToTolerance({ manifold: smoothed, tolerance: 0.01 });
|
|
201
|
+
* ```
|
|
146
202
|
*/
|
|
147
203
|
refineToTolerance(inputs: Inputs.Manifold.ManifoldRefineToleranceDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
148
204
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* @
|
|
156
|
-
* @returns refined manifold
|
|
205
|
+
* Adds triangles to a solid by splitting every edge into pieces of roughly the given length,
|
|
206
|
+
* adding inner vertices to keep the triangles even.
|
|
207
|
+
*
|
|
208
|
+
* On a solid smoothed with `smoothOut` or `smoothByNormals` the new vertices move onto the
|
|
209
|
+
* smooth surface; otherwise the surface stays as it is.
|
|
210
|
+
* @param inputs - The solid and the target edge length in model units
|
|
211
|
+
* @returns The refined solid
|
|
157
212
|
* @group adjustments
|
|
158
213
|
* @shortname refine to length
|
|
159
214
|
* @drawable true
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const finer = await bitbybit.manifold.manifold.operations.refineToLength({ manifold: smoothed, length: 0.5 });
|
|
218
|
+
* ```
|
|
160
219
|
*/
|
|
161
220
|
refineToLength(inputs: Inputs.Manifold.ManifoldRefineLengthDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
162
221
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* @
|
|
170
|
-
* @returns refined manifold
|
|
222
|
+
* Adds triangles to a solid by splitting every edge into `number` pieces; with 2, each triangle
|
|
223
|
+
* becomes four.
|
|
224
|
+
*
|
|
225
|
+
* On a solid smoothed with `smoothOut` or `smoothByNormals` the new vertices move onto the
|
|
226
|
+
* smooth surface; otherwise the new triangles stay flat.
|
|
227
|
+
* @param inputs - The solid and how many pieces to split each edge into
|
|
228
|
+
* @returns The refined solid
|
|
171
229
|
* @group adjustments
|
|
172
230
|
* @shortname refine
|
|
173
231
|
* @drawable true
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* const finer = await bitbybit.manifold.manifold.operations.refine({ manifold: smoothed, number: 2 });
|
|
235
|
+
* ```
|
|
174
236
|
*/
|
|
175
237
|
refine(inputs: Inputs.Manifold.ManifoldRefineDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
176
238
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
239
|
+
* Marks a solid for smoothing by working out tangents from its triangles, so a later `refine`
|
|
240
|
+
* or `refineToLength` bends the new triangles into a smooth surface.
|
|
241
|
+
*
|
|
242
|
+
* Edges sharper than `minSharpAngle`, in degrees, stay sharp; `minSmoothness` above 0 rounds
|
|
243
|
+
* those a little, and 1 smooths everything. The geometry itself does not change until it is
|
|
244
|
+
* refined.
|
|
245
|
+
* @param inputs - The solid, the sharp angle in degrees and the smoothness of sharp edges
|
|
246
|
+
* @returns The solid with smoothing tangents
|
|
183
247
|
* @group adjustments
|
|
184
248
|
* @shortname smooth out
|
|
185
249
|
* @drawable true
|
|
250
|
+
* @example
|
|
251
|
+
* ```typescript
|
|
252
|
+
* const smoothed = await bitbybit.manifold.manifold.operations.smoothOut({ manifold: cube, minSharpAngle: 60, minSmoothness: 0 });
|
|
253
|
+
* const rounded = await bitbybit.manifold.manifold.operations.refineToLength({ manifold: smoothed, length: 0.5 });
|
|
254
|
+
* ```
|
|
186
255
|
*/
|
|
187
256
|
smoothOut(inputs: Inputs.Manifold.ManifoldSmoothOutDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
188
257
|
/**
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* @
|
|
258
|
+
* Marks a solid for smoothing using the normals stored in its vertex properties, so a later
|
|
259
|
+
* `refine` or `refineToLength` bends the new triangles into a smooth surface.
|
|
260
|
+
*
|
|
261
|
+
* `normalIdx` is the first of the three normal channels, as `calculateNormals` stores them;
|
|
262
|
+
* where the normals on a vertex disagree the edge stays sharp.
|
|
263
|
+
* @param inputs - The solid and the first normal channel
|
|
264
|
+
* @returns The solid with smoothing tangents
|
|
195
265
|
* @group adjustments
|
|
196
266
|
* @shortname smooth by normals
|
|
197
267
|
* @drawable true
|
|
268
|
+
* @example
|
|
269
|
+
* ```typescript
|
|
270
|
+
* const smoothed = await bitbybit.manifold.manifold.operations.smoothByNormals({ manifold: withNormals, normalIdx: 0 });
|
|
271
|
+
* ```
|
|
198
272
|
*/
|
|
199
273
|
smoothByNormals(inputs: Inputs.Manifold.ManifoldSmoothByNormalsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
200
274
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
275
|
+
* Removes vertices from a solid's mesh while keeping every surface within `tolerance` of where
|
|
276
|
+
* it was, to cut the triangle count.
|
|
277
|
+
*
|
|
278
|
+
* The result keeps a subset of the original vertices; the solid's own tolerance value stays
|
|
279
|
+
* unchanged.
|
|
280
|
+
* @param inputs - The solid and how far surfaces may move, in model units
|
|
281
|
+
* @returns The simplified solid
|
|
206
282
|
* @group adjustments
|
|
207
283
|
* @shortname simplify
|
|
208
284
|
* @drawable true
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* const lighter = await bitbybit.manifold.manifold.operations.simplify({ manifold: shape, tolerance: 0.05 });
|
|
288
|
+
* ```
|
|
209
289
|
*/
|
|
210
290
|
simplify(inputs: Inputs.Manifold.ManifoldSimplifyDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
211
291
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* past the
|
|
217
|
-
* properties
|
|
218
|
-
* @
|
|
219
|
-
* @returns manifold with updated properties
|
|
292
|
+
* Rewrites the vertex properties of a solid with a function that receives each vertex's
|
|
293
|
+
* position and old properties and fills in the new ones.
|
|
294
|
+
*
|
|
295
|
+
* `numProp` sets how many properties each vertex has afterwards, so channels can be added or
|
|
296
|
+
* dropped; reading past the old count or writing past the new one is undefined.
|
|
297
|
+
* @param inputs - The solid, the new property count and the function that fills the properties
|
|
298
|
+
* @returns The solid with the new properties
|
|
220
299
|
* @group adjustments
|
|
221
300
|
* @shortname set properties
|
|
222
301
|
* @drawable true
|
|
302
|
+
* @example
|
|
303
|
+
* ```typescript
|
|
304
|
+
* const colored = await bitbybit.manifold.manifold.operations.setProperties({
|
|
305
|
+
* manifold: shape,
|
|
306
|
+
* numProp: 3,
|
|
307
|
+
* propFunc: (newProp, position) => { newProp[0] = position[0]; newProp[1] = position[1]; newProp[2] = position[2]; },
|
|
308
|
+
* });
|
|
309
|
+
* ```
|
|
223
310
|
*/
|
|
224
311
|
setProperties(inputs: Inputs.Manifold.ManifoldSetPropertiesDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
225
312
|
}
|