okgeometry-api 1.17.0 → 1.18.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/dist/Circle.d.ts +5 -2
- package/dist/Circle.d.ts.map +1 -1
- package/dist/Circle.js +5 -2
- package/dist/Circle.js.map +1 -1
- package/dist/Mesh.d.ts.map +1 -1
- package/dist/Mesh.js +7 -1
- package/dist/Mesh.js.map +1 -1
- package/dist/SculptSession.d.ts +158 -0
- package/dist/SculptSession.d.ts.map +1 -0
- package/dist/SculptSession.js +227 -0
- package/dist/SculptSession.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/wasm-base64.d.ts +1 -1
- package/dist/wasm-base64.d.ts.map +1 -1
- package/dist/wasm-base64.js +1 -1
- package/dist/wasm-base64.js.map +1 -1
- package/dist/wasm-bindings.d.ts +120 -0
- package/dist/wasm-bindings.d.ts.map +1 -1
- package/dist/wasm-bindings.js +180 -0
- package/dist/wasm-bindings.js.map +1 -1
- package/package.json +3 -2
- package/src/Circle.ts +24 -21
- package/src/Mesh.ts +3810 -3804
- package/src/SculptSession.ts +337 -0
- package/src/index.ts +15 -0
- package/src/wasm-base64.ts +1 -1
- package/src/wasm-bindings.d.ts +97 -0
- package/src/wasm-bindings.js +194 -0
package/src/Circle.ts
CHANGED
|
@@ -63,9 +63,12 @@ export class Circle {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* Sample the circle into evenly-spaced points
|
|
66
|
+
* Sample the circle into evenly-spaced points across the full closed
|
|
67
|
+
* parameter range INCLUSIVE of both ends: the last point coincides with
|
|
68
|
+
* the first (the seam). Consumers building a closed polygon from a circle
|
|
69
|
+
* must drop the final duplicate (see Mesh.buildPlanarCircle).
|
|
67
70
|
* @param n - Number of points to generate
|
|
68
|
-
* @returns Array of n points around the circle
|
|
71
|
+
* @returns Array of n points around the circle, first == last
|
|
69
72
|
*/
|
|
70
73
|
sample(n: number): Point[] {
|
|
71
74
|
ensureInit();
|
|
@@ -139,25 +142,25 @@ export class Circle {
|
|
|
139
142
|
* @param caps - Whether to cap the ends (default true)
|
|
140
143
|
* @returns Mesh representing the extruded cylinder
|
|
141
144
|
*/
|
|
142
|
-
extrude(direction: Vec3, segments = 16, caps = true): Mesh {
|
|
143
|
-
ensureInit();
|
|
144
|
-
const buf = wasm.extrude_circle(
|
|
145
|
-
this.center.x, this.center.y, this.center.z,
|
|
146
|
-
this.normal.x, this.normal.y, this.normal.z,
|
|
145
|
+
extrude(direction: Vec3, segments = 16, caps = true): Mesh {
|
|
146
|
+
ensureInit();
|
|
147
|
+
const buf = wasm.extrude_circle(
|
|
148
|
+
this.center.x, this.center.y, this.center.z,
|
|
149
|
+
this.normal.x, this.normal.y, this.normal.z,
|
|
147
150
|
this.radius,
|
|
148
151
|
direction.x, direction.y, direction.z,
|
|
149
152
|
segments, caps
|
|
150
|
-
);
|
|
151
|
-
return Mesh.fromBuffer(buf);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Extrude this closed circle into a trusted solid suitable for booleans.
|
|
156
|
-
* @param direction - Extrusion direction and magnitude
|
|
157
|
-
* @param segments - Number of boundary samples used for tessellation (default 32)
|
|
158
|
-
* @returns Closed mesh solid ready for boolean operations
|
|
159
|
-
*/
|
|
160
|
-
extrudeAsSolid(direction: Vec3, segments = 32): Mesh {
|
|
161
|
-
return Mesh.extrudeCurveAsSolid(this, direction, segments);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
153
|
+
);
|
|
154
|
+
return Mesh.fromBuffer(buf);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Extrude this closed circle into a trusted solid suitable for booleans.
|
|
159
|
+
* @param direction - Extrusion direction and magnitude
|
|
160
|
+
* @param segments - Number of boundary samples used for tessellation (default 32)
|
|
161
|
+
* @returns Closed mesh solid ready for boolean operations
|
|
162
|
+
*/
|
|
163
|
+
extrudeAsSolid(direction: Vec3, segments = 32): Mesh {
|
|
164
|
+
return Mesh.extrudeCurveAsSolid(this, direction, segments);
|
|
165
|
+
}
|
|
166
|
+
}
|