brepjs 7.4.2 → 8.0.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 +179 -17
- package/dist/2d/blueprints/blueprintFns.d.ts +0 -22
- package/dist/2d/blueprints/blueprintFns.d.ts.map +1 -1
- package/dist/2d/blueprints/boolean2D.d.ts +3 -3
- package/dist/2d.cjs +2 -58
- package/dist/2d.d.ts +1 -2
- package/dist/2d.d.ts.map +1 -1
- package/dist/2d.js +7 -64
- package/dist/{Blueprint-3Dyu0OL6.cjs → Blueprint-CVctc41Z.cjs} +4 -4
- package/dist/{Blueprint-DSHD89bZ.js → Blueprint-D3JfGJTz.js} +4 -4
- package/dist/{boolean2D-BwOpOv6L.cjs → boolean2D-BdZATaHs.cjs} +9 -9
- package/dist/{boolean2D-CtyE2hK5.js → boolean2D-hOw5Qay5.js} +9 -9
- package/dist/{booleanFns-5KSbtLBU.cjs → booleanFns-BBSVKhL2.cjs} +27 -31
- package/dist/{booleanFns-DcxqLQSG.js → booleanFns-CqehfzcK.js} +27 -31
- package/dist/brepjs.cjs +95 -106
- package/dist/brepjs.js +129 -140
- package/dist/{cast-D1s7Im9E.js → cast-DQaUibmm.js} +3 -3
- package/dist/{cast-DsxJk_F0.cjs → cast-DkB0GKmQ.cjs} +2 -2
- package/dist/{drawFns-CSbH7uoI.js → drawFns-921SkhDL.js} +9 -9
- package/dist/{drawFns-C6KQjmQj.cjs → drawFns-CUyx50gi.cjs} +9 -9
- package/dist/{faceFns-B9if-FPW.cjs → faceFns-BwK7FP7N.cjs} +1 -1
- package/dist/{faceFns-Bl6HHbqO.js → faceFns-DHu-2JpA.js} +1 -1
- package/dist/index.d.ts +9 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/{loft-Cc5E5pAf.cjs → loft-BzWFokmC.cjs} +2 -2
- package/dist/{loft-BlNndTOR.js → loft-CtG5nMq5.js} +2 -2
- package/dist/{measurement-D75pyJi1.js → measurement-C5JGCuUP.js} +1 -1
- package/dist/{measurement-BVdZ9cG3.cjs → measurement-fxm_pW7x.cjs} +1 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-p_kv--PW.js → meshFns-AqAjTTVl.js} +11 -11
- package/dist/{meshFns-mVlogI3J.cjs → meshFns-BhrZGi6w.cjs} +11 -11
- package/dist/operations/api.d.ts +4 -6
- package/dist/operations/api.d.ts.map +1 -1
- package/dist/operations/exporterFns.d.ts +0 -2
- package/dist/operations/exporterFns.d.ts.map +1 -1
- package/dist/operations/extrude.d.ts +2 -4
- package/dist/operations/extrude.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts +4 -4
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/extrudeUtils.d.ts +0 -2
- package/dist/operations/extrudeUtils.d.ts.map +1 -1
- package/dist/operations/loft.d.ts +1 -1
- package/dist/operations/loftFns.d.ts +2 -4
- package/dist/operations/loftFns.d.ts.map +1 -1
- package/dist/{operations-SRN-mfTx.cjs → operations-BP1wVDw0.cjs} +14 -20
- package/dist/{operations-CEV-gqkX.js → operations-C1rWoba2.js} +14 -20
- package/dist/operations.cjs +2 -2
- package/dist/operations.d.ts +3 -3
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +2 -2
- package/dist/{query-D7XclvBZ.js → query-V6nV-VfL.js} +4 -4
- package/dist/{query-DkcMfh6j.cjs → query-hMSmOWJP.cjs} +4 -4
- package/dist/query.cjs +1 -1
- package/dist/query.js +1 -1
- package/dist/{shapeFns-BpCPVHFT.js → shapeFns-BrF97sKt.js} +19 -19
- package/dist/{shapeFns-DjsWo98C.cjs → shapeFns-BvOndshS.cjs} +19 -19
- package/dist/{shapeHelpers-BBSVHPGk.cjs → shapeHelpers-B2SXz1p4.cjs} +2 -2
- package/dist/{shapeHelpers-C4QIp7u5.js → shapeHelpers-BcoZf2N9.js} +2 -2
- package/dist/sketching/sketcherlib.d.ts +2 -4
- package/dist/sketching/sketcherlib.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.d.ts +2 -2
- package/dist/sketching.d.ts.map +1 -1
- package/dist/sketching.js +2 -2
- package/dist/topology/api.d.ts +11 -15
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/apiTypes.d.ts +0 -2
- package/dist/topology/apiTypes.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts +9 -9
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +2 -2
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/chamferAngleFns.d.ts +1 -1
- package/dist/topology/chamferAngleFns.d.ts.map +1 -1
- package/dist/topology/healingFns.d.ts +2 -2
- package/dist/topology/healingFns.d.ts.map +1 -1
- package/dist/topology/index.d.ts +2 -2
- package/dist/topology/index.d.ts.map +1 -1
- package/dist/topology/meshCache.d.ts +2 -4
- package/dist/topology/meshCache.d.ts.map +1 -1
- package/dist/topology/meshFns.d.ts +2 -2
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts +5 -5
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/primitiveFns.d.ts +4 -8
- package/dist/topology/primitiveFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +9 -9
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/shapeModifiers.d.ts +0 -2
- package/dist/topology/shapeModifiers.d.ts.map +1 -1
- package/dist/topology/wrapperFns.d.ts +3 -3
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/{topology-Bb1W3SyF.cjs → topology-CIooytHH.cjs} +18 -18
- package/dist/{topology-BEMrS4WZ.js → topology-tFzqSrGH.js} +18 -18
- package/dist/topology.cjs +8 -8
- package/dist/topology.d.ts +1 -1
- package/dist/topology.d.ts.map +1 -1
- package/dist/topology.js +8 -8
- package/package.json +3 -3
- package/dist/2d/blueprints/boolean2dFns.d.ts +0 -46
- package/dist/2d/blueprints/boolean2dFns.d.ts.map +0 -1
- package/dist/core/geometry.d.ts +0 -26
- package/dist/core/geometry.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -79,8 +79,16 @@ A flanged pipe with bolt holes — showing booleans, shelling, fillets, and find
|
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
81
|
import {
|
|
82
|
-
cylinder,
|
|
83
|
-
|
|
82
|
+
cylinder,
|
|
83
|
+
fuse,
|
|
84
|
+
cut,
|
|
85
|
+
shell,
|
|
86
|
+
fillet,
|
|
87
|
+
rotate,
|
|
88
|
+
faceFinder,
|
|
89
|
+
edgeFinder,
|
|
90
|
+
measureVolume,
|
|
91
|
+
unwrap,
|
|
84
92
|
} from 'brepjs/quick';
|
|
85
93
|
|
|
86
94
|
// Tube + flanges
|
|
@@ -92,7 +100,10 @@ const topFaces = faceFinder().parallelTo('XY').atDistance(100, [0, 0, 0]).findAl
|
|
|
92
100
|
const hollowed = unwrap(shell(body, topFaces, 2));
|
|
93
101
|
|
|
94
102
|
// Fillet the tube-to-flange transitions
|
|
95
|
-
const filletEdges = edgeFinder()
|
|
103
|
+
const filletEdges = edgeFinder()
|
|
104
|
+
.ofCurveType('CIRCLE')
|
|
105
|
+
.ofLength(2 * Math.PI * 15)
|
|
106
|
+
.findAll(hollowed);
|
|
96
107
|
let result = unwrap(fillet(hollowed, filletEdges, 3));
|
|
97
108
|
|
|
98
109
|
// Bolt holes around each flange
|
|
@@ -105,23 +116,174 @@ for (let i = 0; i < 6; i++) {
|
|
|
105
116
|
console.log('Volume:', measureVolume(result), 'mm³');
|
|
106
117
|
```
|
|
107
118
|
|
|
119
|
+
## Common Patterns
|
|
120
|
+
|
|
121
|
+
### Memory cleanup
|
|
122
|
+
|
|
123
|
+
WASM objects aren't garbage-collected. Use `using` (TS 5.9+) for automatic cleanup, or `gcWithScope()`/`localGC()` for explicit control:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { box, cylinder, cut, unwrap, gcWithScope, localGC } from 'brepjs/quick';
|
|
127
|
+
|
|
128
|
+
// Option 1: using keyword — auto-disposed at block end
|
|
129
|
+
{
|
|
130
|
+
using temp = box(10, 10, 10);
|
|
131
|
+
using hole = cylinder(3, 15);
|
|
132
|
+
const result = unwrap(cut(temp, hole));
|
|
133
|
+
// temp and hole freed here; result survives
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Option 2: gcWithScope — GC-based cleanup
|
|
137
|
+
function buildPart() {
|
|
138
|
+
const r = gcWithScope();
|
|
139
|
+
const b = r(box(10, 10, 10));
|
|
140
|
+
const hole = r(cylinder(3, 15));
|
|
141
|
+
return unwrap(cut(b, hole)); // b and hole cleaned up when r is GC'd
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Option 3: localGC — deterministic cleanup
|
|
145
|
+
const [register, cleanup] = localGC();
|
|
146
|
+
try {
|
|
147
|
+
const b = register(box(10, 10, 10));
|
|
148
|
+
return unwrap(cut(b, register(cylinder(3, 15))));
|
|
149
|
+
} finally {
|
|
150
|
+
cleanup(); // immediate disposal
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Immutability
|
|
155
|
+
|
|
156
|
+
All operations return new shapes — the original is never modified:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
import { box, translate, rotate, measureVolume } from 'brepjs/quick';
|
|
160
|
+
|
|
161
|
+
const original = box(30, 20, 10);
|
|
162
|
+
const moved = translate(original, [100, 0, 0]);
|
|
163
|
+
const rotated = rotate(moved, 45, { axis: [0, 0, 1] });
|
|
164
|
+
|
|
165
|
+
// original is unchanged
|
|
166
|
+
console.log(measureVolume(original) === measureVolume(moved)); // true — same geometry, different position
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Chaining transforms
|
|
170
|
+
|
|
171
|
+
Apply translation then rotation (functional or wrapper style):
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
import { box, translate, rotate, shape } from 'brepjs/quick';
|
|
175
|
+
|
|
176
|
+
// Functional — each call returns a new shape
|
|
177
|
+
const b = box(30, 20, 10);
|
|
178
|
+
const moved = translate(b, [50, 0, 0]);
|
|
179
|
+
const result = rotate(moved, 45, { axis: [0, 0, 1] });
|
|
180
|
+
|
|
181
|
+
// Wrapper — fluent chaining
|
|
182
|
+
const same = shape(box(30, 20, 10))
|
|
183
|
+
.translate([50, 0, 0])
|
|
184
|
+
.rotate(45, { axis: [0, 0, 1] }).val;
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 2D sketch to 3D extrusion
|
|
188
|
+
|
|
189
|
+
Draw a 2D profile, then extrude it to create a solid:
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
import { drawRectangle, drawCircle, drawingCut, drawingToSketchOnPlane, shape } from 'brepjs/quick';
|
|
193
|
+
|
|
194
|
+
// Draw 2D rectangle with a hole
|
|
195
|
+
const profile = drawingCut(drawRectangle(50, 30), drawCircle(8).translate([25, 15]));
|
|
196
|
+
|
|
197
|
+
// Convert to sketch on XY plane, extrude 20mm
|
|
198
|
+
const sketch = drawingToSketchOnPlane(profile, 'XY');
|
|
199
|
+
const solid = shape(sketch.face()).extrude(20).val;
|
|
200
|
+
|
|
201
|
+
// Or use the sketch shortcut directly
|
|
202
|
+
import { sketchRectangle } from 'brepjs/quick';
|
|
203
|
+
const quickBox = sketchRectangle(50, 30).extrude(20);
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### STEP import and export
|
|
207
|
+
|
|
208
|
+
Load a STEP file, modify it, and re-export:
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { importSTEP, exportSTEP, shape, unwrap } from 'brepjs/quick';
|
|
212
|
+
|
|
213
|
+
// Import from Blob (e.g., from file input or fs.readFileSync)
|
|
214
|
+
const imported = unwrap(await importSTEP(stepBlob));
|
|
215
|
+
|
|
216
|
+
// Modify the imported shape
|
|
217
|
+
const modified = shape(imported).fillet(2).translate([0, 0, 10]).val;
|
|
218
|
+
|
|
219
|
+
// Export back to STEP
|
|
220
|
+
const outputBlob = unwrap(exportSTEP(modified));
|
|
221
|
+
|
|
222
|
+
// Save to disk (Node.js)
|
|
223
|
+
import { writeFileSync } from 'fs';
|
|
224
|
+
writeFileSync('output.step', Buffer.from(await outputBlob.arrayBuffer()));
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Custom WASM kernel
|
|
228
|
+
|
|
229
|
+
`initFromOC()` accepts any OpenCascade WASM instance, enabling custom builds:
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
import { initFromOC, box } from 'brepjs';
|
|
233
|
+
|
|
234
|
+
// Standard build
|
|
235
|
+
import opencascade from 'brepjs-opencascade';
|
|
236
|
+
const oc = await opencascade();
|
|
237
|
+
initFromOC(oc);
|
|
238
|
+
|
|
239
|
+
// Or use a custom/alternative OpenCascade WASM build
|
|
240
|
+
import customOC from 'my-custom-opencascade';
|
|
241
|
+
const customKernel = await customOC({ locateFile: (f) => `/wasm/${f}` });
|
|
242
|
+
initFromOC(customKernel); // same API — any compatible OC instance works
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The kernel abstraction layer in `src/kernel/` translates brepjs calls to OCCT operations, so any WASM build exposing the standard OpenCascade API is compatible.
|
|
246
|
+
|
|
247
|
+
### Parametric variations
|
|
248
|
+
|
|
249
|
+
Generate multiple part variations by iterating over dimensions:
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { box, cylinder, cut, fillet, edgeFinder, unwrap, exportSTEP } from 'brepjs/quick';
|
|
253
|
+
|
|
254
|
+
function makeBracket(width: number, holeRadius: number) {
|
|
255
|
+
const base = box(width, 20, 10);
|
|
256
|
+
const hole = cylinder(holeRadius, 15, { at: [width / 2, 10, -2] });
|
|
257
|
+
const drilled = unwrap(cut(base, hole));
|
|
258
|
+
const edges = edgeFinder().inDirection('Z').findAll(drilled);
|
|
259
|
+
return unwrap(fillet(drilled, edges, 1.5));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Generate variants
|
|
263
|
+
for (const width of [30, 40, 50, 60]) {
|
|
264
|
+
const part = makeBracket(width, width / 10);
|
|
265
|
+
const step = unwrap(exportSTEP(part));
|
|
266
|
+
console.log(`${width}mm bracket: ${step.size} bytes`);
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
108
270
|
## Examples
|
|
109
271
|
|
|
110
272
|
```bash
|
|
111
273
|
npm run example examples/hello-world.ts
|
|
112
274
|
```
|
|
113
275
|
|
|
114
|
-
| Example
|
|
115
|
-
|
|
116
|
-
| [hello-world.ts](./examples/hello-world.ts)
|
|
117
|
-
| [basic-primitives.ts](./examples/basic-primitives.ts)
|
|
118
|
-
| [mechanical-part.ts](./examples/mechanical-part.ts)
|
|
119
|
-
| [2d-to-3d.ts](./examples/2d-to-3d.ts)
|
|
120
|
-
| [parametric-part.ts](./examples/parametric-part.ts)
|
|
121
|
-
| [threejs-rendering.ts](./examples/threejs-rendering.ts) | Generate mesh data for Three.js
|
|
122
|
-
| [browser-viewer.ts](./examples/browser-viewer.ts)
|
|
123
|
-
| [import-export.ts](./examples/import-export.ts)
|
|
124
|
-
| [text-engraving.ts](./examples/text-engraving.ts)
|
|
276
|
+
| Example | What it does |
|
|
277
|
+
| ------------------------------------------------------- | ------------------------------------------- |
|
|
278
|
+
| [hello-world.ts](./examples/hello-world.ts) | Create a box, measure it, export it |
|
|
279
|
+
| [basic-primitives.ts](./examples/basic-primitives.ts) | Primitives and boolean operations |
|
|
280
|
+
| [mechanical-part.ts](./examples/mechanical-part.ts) | Bracket with holes, slots, and SVG drawings |
|
|
281
|
+
| [2d-to-3d.ts](./examples/2d-to-3d.ts) | Sketch a profile, extrude to 3D |
|
|
282
|
+
| [parametric-part.ts](./examples/parametric-part.ts) | Configurable flanged pipe fitting |
|
|
283
|
+
| [threejs-rendering.ts](./examples/threejs-rendering.ts) | Generate mesh data for Three.js |
|
|
284
|
+
| [browser-viewer.ts](./examples/browser-viewer.ts) | Standalone HTML viewer with orbit controls |
|
|
285
|
+
| [import-export.ts](./examples/import-export.ts) | Load, modify, and re-export STEP files |
|
|
286
|
+
| [text-engraving.ts](./examples/text-engraving.ts) | Engrave text on a solid shape |
|
|
125
287
|
|
|
126
288
|
## Imports
|
|
127
289
|
|
|
@@ -184,9 +346,9 @@ Layer 0 kernel/, utils/ WASM bindings
|
|
|
184
346
|
|
|
185
347
|
## Packages
|
|
186
348
|
|
|
187
|
-
| Package
|
|
188
|
-
|
|
189
|
-
| [brepjs](https://www.npmjs.com/package/brepjs)
|
|
349
|
+
| Package | Description |
|
|
350
|
+
| ---------------------------------------------------------------------- | ---------------------- |
|
|
351
|
+
| [brepjs](https://www.npmjs.com/package/brepjs) | Core library |
|
|
190
352
|
| [brepjs-opencascade](https://www.npmjs.com/package/brepjs-opencascade) | OpenCascade WASM build |
|
|
191
353
|
|
|
192
354
|
## Projects Using brepjs
|
|
@@ -32,26 +32,4 @@ export declare function stretch2D(bp: Blueprint, ratio: number, direction: Point
|
|
|
32
32
|
export declare function sketch2DOnPlane(bp: Blueprint, inputPlane?: PlaneName | Plane, origin?: PointInput | number): any;
|
|
33
33
|
/** Map a blueprint onto a 3D face's UV surface, producing sketch data. */
|
|
34
34
|
export declare function sketch2DOnFace(bp: Blueprint, face: Face, scaleMode?: ScaleMode): any;
|
|
35
|
-
/** @deprecated Use getBounds2D instead. Will be removed in v8.0.0. */
|
|
36
|
-
export declare function blueprintBoundingBox(bp: Blueprint): BoundingBox2d;
|
|
37
|
-
/** @deprecated Use getOrientation2D instead. Will be removed in v8.0.0. */
|
|
38
|
-
export declare function blueprintOrientation(bp: Blueprint): 'clockwise' | 'counterClockwise';
|
|
39
|
-
/** @deprecated Use translate2D instead. Will be removed in v8.0.0. */
|
|
40
|
-
export declare function translateBlueprint(bp: Blueprint, dx: number, dy: number): Blueprint;
|
|
41
|
-
/** @deprecated Use rotate2D instead. Will be removed in v8.0.0. */
|
|
42
|
-
export declare function rotateBlueprint(bp: Blueprint, angle: number, center?: Point2D): Blueprint;
|
|
43
|
-
/** @deprecated Use scale2D instead. Will be removed in v8.0.0. */
|
|
44
|
-
export declare function scaleBlueprint(bp: Blueprint, factor: number, center?: Point2D): Blueprint;
|
|
45
|
-
/** @deprecated Use mirror2D instead. Will be removed in v8.0.0. */
|
|
46
|
-
export declare function mirrorBlueprint(bp: Blueprint, centerOrDirection: Point2D, origin?: Point2D, mode?: 'center' | 'plane'): Blueprint;
|
|
47
|
-
/** @deprecated Use stretch2D instead. Will be removed in v8.0.0. */
|
|
48
|
-
export declare function stretchBlueprint(bp: Blueprint, ratio: number, direction: Point2D, origin?: Point2D): Blueprint;
|
|
49
|
-
/** @deprecated Use toSVGPathD instead. Will be removed in v8.0.0. */
|
|
50
|
-
export declare function blueprintToSVGPathD(bp: Blueprint): string;
|
|
51
|
-
/** @deprecated Use isInside2D instead. Will be removed in v8.0.0. */
|
|
52
|
-
export declare function blueprintIsInside(bp: Blueprint, point: Point2D): boolean;
|
|
53
|
-
/** @deprecated Use sketch2DOnPlane instead. Will be removed in v8.0.0. */
|
|
54
|
-
export declare function sketchBlueprintOnPlane(bp: Blueprint, inputPlane?: PlaneName | Plane, origin?: PointInput | number): any;
|
|
55
|
-
/** @deprecated Use sketch2DOnFace instead. Will be removed in v8.0.0. */
|
|
56
|
-
export declare function sketchBlueprintOnFace(bp: Blueprint, face: Face, scaleMode?: ScaleMode): any;
|
|
57
35
|
//# sourceMappingURL=blueprintFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blueprintFns.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/blueprintFns.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MA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25
25
|
* ```
|
|
26
26
|
*
|
|
27
|
-
* @see {@link
|
|
27
|
+
* @see {@link fuse2D} for the functional API.
|
|
28
28
|
*/
|
|
29
29
|
export declare const fuse2D: (first: Shape2D, second: Shape2D) => Blueprint | Blueprints | CompoundBlueprint | null;
|
|
30
30
|
/**
|
|
@@ -43,7 +43,7 @@ export declare const fuse2D: (first: Shape2D, second: Shape2D) => Blueprint | Bl
|
|
|
43
43
|
* const withHole = cut2D(outerRect, innerCircle);
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
|
-
* @see {@link
|
|
46
|
+
* @see {@link cut2D} for the functional API.
|
|
47
47
|
*/
|
|
48
48
|
export declare const cut2D: (first: Shape2D, second: Shape2D) => Blueprint | Blueprints | CompoundBlueprint | null;
|
|
49
49
|
/**
|
|
@@ -62,7 +62,7 @@ export declare const cut2D: (first: Shape2D, second: Shape2D) => Blueprint | Blu
|
|
|
62
62
|
* const overlap = intersect2D(circle, rectangle);
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
|
-
* @see {@link
|
|
65
|
+
* @see {@link intersect2D} for the functional API.
|
|
66
66
|
*/
|
|
67
67
|
export declare function intersect2D(first: Shape2D, second: Shape2D): Blueprint | Blueprints | CompoundBlueprint | null;
|
|
68
68
|
//# sourceMappingURL=boolean2D.d.ts.map
|
package/dist/2d.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Blueprint = require("./Blueprint-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const Blueprint = require("./Blueprint-CVctc41Z.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-BdZATaHs.cjs");
|
|
5
5
|
function reverseCurve(curve) {
|
|
6
6
|
const cloned = curve.clone();
|
|
7
7
|
cloned.reverse();
|
|
@@ -67,48 +67,6 @@ function sketch2DOnPlane(bp, inputPlane, origin) {
|
|
|
67
67
|
function sketch2DOnFace(bp, face, scaleMode) {
|
|
68
68
|
return bp.sketchOnFace(face, scaleMode);
|
|
69
69
|
}
|
|
70
|
-
function blueprintBoundingBox(bp) {
|
|
71
|
-
return getBounds2D(bp);
|
|
72
|
-
}
|
|
73
|
-
function blueprintOrientation(bp) {
|
|
74
|
-
return getOrientation2D(bp);
|
|
75
|
-
}
|
|
76
|
-
function translateBlueprint(bp, dx, dy) {
|
|
77
|
-
return translate2D(bp, dx, dy);
|
|
78
|
-
}
|
|
79
|
-
function rotateBlueprint(bp, angle, center) {
|
|
80
|
-
return rotate2D(bp, angle, center);
|
|
81
|
-
}
|
|
82
|
-
function scaleBlueprint(bp, factor, center) {
|
|
83
|
-
return scale2D(bp, factor, center);
|
|
84
|
-
}
|
|
85
|
-
function mirrorBlueprint(bp, centerOrDirection, origin, mode) {
|
|
86
|
-
return mirror2D(bp, centerOrDirection, origin, mode);
|
|
87
|
-
}
|
|
88
|
-
function stretchBlueprint(bp, ratio, direction, origin) {
|
|
89
|
-
return stretch2D(bp, ratio, direction, origin);
|
|
90
|
-
}
|
|
91
|
-
function blueprintToSVGPathD(bp) {
|
|
92
|
-
return toSVGPathD(bp);
|
|
93
|
-
}
|
|
94
|
-
function blueprintIsInside(bp, point) {
|
|
95
|
-
return isInside2D(bp, point);
|
|
96
|
-
}
|
|
97
|
-
function sketchBlueprintOnPlane(bp, inputPlane, origin) {
|
|
98
|
-
return sketch2DOnPlane(bp, inputPlane, origin);
|
|
99
|
-
}
|
|
100
|
-
function sketchBlueprintOnFace(bp, face, scaleMode) {
|
|
101
|
-
return sketch2DOnFace(bp, face, scaleMode);
|
|
102
|
-
}
|
|
103
|
-
function fuseBlueprint2D(a, b) {
|
|
104
|
-
return boolean2D.fuse2D(a, b);
|
|
105
|
-
}
|
|
106
|
-
function cutBlueprint2D(base, tool) {
|
|
107
|
-
return boolean2D.cut2D(base, tool);
|
|
108
|
-
}
|
|
109
|
-
function intersectBlueprint2D(a, b) {
|
|
110
|
-
return boolean2D.intersect2D(a, b);
|
|
111
|
-
}
|
|
112
70
|
exports.Blueprint = Blueprint.Blueprint;
|
|
113
71
|
exports.BoundingBox2d = Blueprint.BoundingBox2d;
|
|
114
72
|
exports.Curve2D = Blueprint.Curve2D;
|
|
@@ -124,10 +82,6 @@ exports.intersectBlueprints = boolean2D.intersectBlueprints;
|
|
|
124
82
|
exports.organiseBlueprints = boolean2D.organiseBlueprints;
|
|
125
83
|
exports.polysidesBlueprint = boolean2D.polysidesBlueprint;
|
|
126
84
|
exports.roundedRectangleBlueprint = boolean2D.roundedRectangleBlueprint;
|
|
127
|
-
exports.blueprintBoundingBox = blueprintBoundingBox;
|
|
128
|
-
exports.blueprintIsInside = blueprintIsInside;
|
|
129
|
-
exports.blueprintOrientation = blueprintOrientation;
|
|
130
|
-
exports.blueprintToSVGPathD = blueprintToSVGPathD;
|
|
131
85
|
exports.createBlueprint = createBlueprint;
|
|
132
86
|
exports.curve2dBoundingBox = curve2dBoundingBox;
|
|
133
87
|
exports.curve2dDistanceFrom = curve2dDistanceFrom;
|
|
@@ -137,25 +91,15 @@ exports.curve2dLastPoint = curve2dLastPoint;
|
|
|
137
91
|
exports.curve2dParameter = curve2dParameter;
|
|
138
92
|
exports.curve2dSplitAt = curve2dSplitAt;
|
|
139
93
|
exports.curve2dTangentAt = curve2dTangentAt;
|
|
140
|
-
exports.cutBlueprint2D = cutBlueprint2D;
|
|
141
|
-
exports.fuseBlueprint2D = fuseBlueprint2D;
|
|
142
94
|
exports.getBounds2D = getBounds2D;
|
|
143
95
|
exports.getOrientation2D = getOrientation2D;
|
|
144
|
-
exports.intersectBlueprint2D = intersectBlueprint2D;
|
|
145
96
|
exports.isInside2D = isInside2D;
|
|
146
97
|
exports.mirror2D = mirror2D;
|
|
147
|
-
exports.mirrorBlueprint = mirrorBlueprint;
|
|
148
98
|
exports.reverseCurve = reverseCurve;
|
|
149
99
|
exports.rotate2D = rotate2D;
|
|
150
|
-
exports.rotateBlueprint = rotateBlueprint;
|
|
151
100
|
exports.scale2D = scale2D;
|
|
152
|
-
exports.scaleBlueprint = scaleBlueprint;
|
|
153
101
|
exports.sketch2DOnFace = sketch2DOnFace;
|
|
154
102
|
exports.sketch2DOnPlane = sketch2DOnPlane;
|
|
155
|
-
exports.sketchBlueprintOnFace = sketchBlueprintOnFace;
|
|
156
|
-
exports.sketchBlueprintOnPlane = sketchBlueprintOnPlane;
|
|
157
103
|
exports.stretch2D = stretch2D;
|
|
158
|
-
exports.stretchBlueprint = stretchBlueprint;
|
|
159
104
|
exports.toSVGPathD = toSVGPathD;
|
|
160
105
|
exports.translate2D = translate2D;
|
|
161
|
-
exports.translateBlueprint = translateBlueprint;
|
package/dist/2d.d.ts
CHANGED
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
export { default as Blueprint } from './2d/blueprints/Blueprint.js';
|
|
14
14
|
export { default as CompoundBlueprint } from './2d/blueprints/CompoundBlueprint.js';
|
|
15
15
|
export { default as Blueprints } from './2d/blueprints/Blueprints.js';
|
|
16
|
-
export { createBlueprint, getBounds2D, getOrientation2D, isInside2D, toSVGPathD, translate2D, rotate2D, scale2D, mirror2D, stretch2D, sketch2DOnPlane, sketch2DOnFace,
|
|
17
|
-
export { fuseBlueprint2D, cutBlueprint2D, intersectBlueprint2D, } from './2d/blueprints/boolean2dFns.js';
|
|
16
|
+
export { createBlueprint, getBounds2D, getOrientation2D, isInside2D, toSVGPathD, translate2D, rotate2D, scale2D, mirror2D, stretch2D, sketch2DOnPlane, sketch2DOnFace, } from './2d/blueprints/blueprintFns.js';
|
|
18
17
|
export { fuseBlueprints, cutBlueprints, intersectBlueprints, } from './2d/blueprints/booleanOperations.js';
|
|
19
18
|
export { fuse2D, cut2D, intersect2D, type Shape2D } from './2d/blueprints/boolean2D.js';
|
|
20
19
|
export { reverseCurve, curve2dBoundingBox, curve2dFirstPoint, curve2dLastPoint, curve2dSplitAt, curve2dParameter, curve2dTangentAt, curve2dIsOnCurve, curve2dDistanceFrom, } from './2d/lib/curve2dFns.js';
|
package/dist/2d.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2d.d.ts","sourceRoot":"","sources":["../src/2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EACL,eAAe,EAEf,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,cAAc,
|
|
1
|
+
{"version":3,"file":"2d.d.ts","sourceRoot":"","sources":["../src/2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EACL,eAAe,EAEf,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAIxF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,KAAK,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACpG,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/2d.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { B as Blueprint } from "./Blueprint-
|
|
2
|
-
import { a, C, b } from "./Blueprint-
|
|
3
|
-
import {
|
|
4
|
-
import { b as b2, C as C2, d, e, g, o, p, r } from "./boolean2D-CtyE2hK5.js";
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-D3JfGJTz.js";
|
|
2
|
+
import { a, C, b } from "./Blueprint-D3JfGJTz.js";
|
|
3
|
+
import { b as b2, C as C2, c, d, f, e, i, g, o, p, r } from "./boolean2D-hOw5Qay5.js";
|
|
5
4
|
function reverseCurve(curve) {
|
|
6
5
|
const cloned = curve.clone();
|
|
7
6
|
cloned.reverse();
|
|
@@ -67,48 +66,6 @@ function sketch2DOnPlane(bp, inputPlane, origin) {
|
|
|
67
66
|
function sketch2DOnFace(bp, face, scaleMode) {
|
|
68
67
|
return bp.sketchOnFace(face, scaleMode);
|
|
69
68
|
}
|
|
70
|
-
function blueprintBoundingBox(bp) {
|
|
71
|
-
return getBounds2D(bp);
|
|
72
|
-
}
|
|
73
|
-
function blueprintOrientation(bp) {
|
|
74
|
-
return getOrientation2D(bp);
|
|
75
|
-
}
|
|
76
|
-
function translateBlueprint(bp, dx, dy) {
|
|
77
|
-
return translate2D(bp, dx, dy);
|
|
78
|
-
}
|
|
79
|
-
function rotateBlueprint(bp, angle, center) {
|
|
80
|
-
return rotate2D(bp, angle, center);
|
|
81
|
-
}
|
|
82
|
-
function scaleBlueprint(bp, factor, center) {
|
|
83
|
-
return scale2D(bp, factor, center);
|
|
84
|
-
}
|
|
85
|
-
function mirrorBlueprint(bp, centerOrDirection, origin, mode) {
|
|
86
|
-
return mirror2D(bp, centerOrDirection, origin, mode);
|
|
87
|
-
}
|
|
88
|
-
function stretchBlueprint(bp, ratio, direction, origin) {
|
|
89
|
-
return stretch2D(bp, ratio, direction, origin);
|
|
90
|
-
}
|
|
91
|
-
function blueprintToSVGPathD(bp) {
|
|
92
|
-
return toSVGPathD(bp);
|
|
93
|
-
}
|
|
94
|
-
function blueprintIsInside(bp, point) {
|
|
95
|
-
return isInside2D(bp, point);
|
|
96
|
-
}
|
|
97
|
-
function sketchBlueprintOnPlane(bp, inputPlane, origin) {
|
|
98
|
-
return sketch2DOnPlane(bp, inputPlane, origin);
|
|
99
|
-
}
|
|
100
|
-
function sketchBlueprintOnFace(bp, face, scaleMode) {
|
|
101
|
-
return sketch2DOnFace(bp, face, scaleMode);
|
|
102
|
-
}
|
|
103
|
-
function fuseBlueprint2D(a2, b3) {
|
|
104
|
-
return fuse2D(a2, b3);
|
|
105
|
-
}
|
|
106
|
-
function cutBlueprint2D(base, tool) {
|
|
107
|
-
return cut2D(base, tool);
|
|
108
|
-
}
|
|
109
|
-
function intersectBlueprint2D(a2, b3) {
|
|
110
|
-
return intersect2D(a2, b3);
|
|
111
|
-
}
|
|
112
69
|
export {
|
|
113
70
|
Blueprint,
|
|
114
71
|
b2 as Blueprints,
|
|
@@ -116,10 +73,6 @@ export {
|
|
|
116
73
|
C2 as CompoundBlueprint,
|
|
117
74
|
C as Curve2D,
|
|
118
75
|
b as axis2d,
|
|
119
|
-
blueprintBoundingBox,
|
|
120
|
-
blueprintIsInside,
|
|
121
|
-
blueprintOrientation,
|
|
122
|
-
blueprintToSVGPathD,
|
|
123
76
|
createBlueprint,
|
|
124
77
|
curve2dBoundingBox,
|
|
125
78
|
curve2dDistanceFrom,
|
|
@@ -129,35 +82,25 @@ export {
|
|
|
129
82
|
curve2dParameter,
|
|
130
83
|
curve2dSplitAt,
|
|
131
84
|
curve2dTangentAt,
|
|
132
|
-
cut2D,
|
|
133
|
-
cutBlueprint2D,
|
|
85
|
+
c as cut2D,
|
|
134
86
|
d as cutBlueprints,
|
|
135
|
-
fuse2D,
|
|
136
|
-
fuseBlueprint2D,
|
|
87
|
+
f as fuse2D,
|
|
137
88
|
e as fuseBlueprints,
|
|
138
89
|
getBounds2D,
|
|
139
90
|
getOrientation2D,
|
|
140
|
-
intersect2D,
|
|
141
|
-
intersectBlueprint2D,
|
|
91
|
+
i as intersect2D,
|
|
142
92
|
g as intersectBlueprints,
|
|
143
93
|
isInside2D,
|
|
144
94
|
mirror2D,
|
|
145
|
-
mirrorBlueprint,
|
|
146
95
|
o as organiseBlueprints,
|
|
147
96
|
p as polysidesBlueprint,
|
|
148
97
|
reverseCurve,
|
|
149
98
|
rotate2D,
|
|
150
|
-
rotateBlueprint,
|
|
151
99
|
r as roundedRectangleBlueprint,
|
|
152
100
|
scale2D,
|
|
153
|
-
scaleBlueprint,
|
|
154
101
|
sketch2DOnFace,
|
|
155
102
|
sketch2DOnPlane,
|
|
156
|
-
sketchBlueprintOnFace,
|
|
157
|
-
sketchBlueprintOnPlane,
|
|
158
103
|
stretch2D,
|
|
159
|
-
stretchBlueprint,
|
|
160
104
|
toSVGPathD,
|
|
161
|
-
translate2D
|
|
162
|
-
translateBlueprint
|
|
105
|
+
translate2D
|
|
163
106
|
};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
const vectors = require("./vectors-ChWEZPwy.cjs");
|
|
3
3
|
const occtBoundary = require("./occtBoundary-du8_ex-p.cjs");
|
|
4
4
|
const shapeTypes = require("./shapeTypes-DKhwEnUM.cjs");
|
|
5
|
-
const faceFns = require("./faceFns-
|
|
5
|
+
const faceFns = require("./faceFns-BwK7FP7N.cjs");
|
|
6
6
|
const curveFns = require("./curveFns-BilyYL_s.cjs");
|
|
7
7
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
8
|
-
const shapeHelpers = require("./shapeHelpers-
|
|
9
|
-
const query = require("./query-
|
|
10
|
-
const cast = require("./cast-
|
|
8
|
+
const shapeHelpers = require("./shapeHelpers-B2SXz1p4.cjs");
|
|
9
|
+
const query = require("./query-hMSmOWJP.cjs");
|
|
10
|
+
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
11
11
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
12
12
|
const result = require("./result.cjs");
|
|
13
13
|
function makePlane(plane, origin) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as resolvePlane } from "./vectors-CBuaMeZv.js";
|
|
2
2
|
import { g as getKernel, a as toVec3, c as makeOcAx2 } from "./occtBoundary-CwegMzqc.js";
|
|
3
3
|
import { o as localGC, y as registerForCleanup, z as unregisterFromCleanup, n as gcWithScope, t as createEdge, s as createWire } from "./shapeTypes-BlSElW8z.js";
|
|
4
|
-
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-
|
|
4
|
+
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-DHu-2JpA.js";
|
|
5
5
|
import { j as findCurveType, m as getOrientation } from "./curveFns-CdVE4da7.js";
|
|
6
6
|
import { u as unwrap, l as ok, e as err, b as computationError, x as validationError } from "./errors-wGhcJMpB.js";
|
|
7
|
-
import { z as zip, o as makeFace } from "./shapeHelpers-
|
|
8
|
-
import { i as distance2d, s as samePoint, h as scalarMultiply2d, b as add2d, n as normalize2d, a as subtract2d, g as getSingleFace } from "./query-
|
|
9
|
-
import { c as cast } from "./cast-
|
|
7
|
+
import { z as zip, o as makeFace } from "./shapeHelpers-BcoZf2N9.js";
|
|
8
|
+
import { i as distance2d, s as samePoint, h as scalarMultiply2d, b as add2d, n as normalize2d, a as subtract2d, g as getSingleFace } from "./query-V6nV-VfL.js";
|
|
9
|
+
import { c as cast } from "./cast-DQaUibmm.js";
|
|
10
10
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
11
11
|
import { bug } from "./result.js";
|
|
12
12
|
function makePlane(plane, origin) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vectors = require("./vectors-ChWEZPwy.cjs");
|
|
3
|
-
const shapeHelpers = require("./shapeHelpers-
|
|
3
|
+
const shapeHelpers = require("./shapeHelpers-B2SXz1p4.cjs");
|
|
4
4
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
5
|
-
const cast = require("./cast-
|
|
5
|
+
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
6
6
|
const occtBoundary = require("./occtBoundary-du8_ex-p.cjs");
|
|
7
7
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
8
|
-
const loft = require("./loft-
|
|
8
|
+
const loft = require("./loft-BzWFokmC.cjs");
|
|
9
9
|
const shapeTypes = require("./shapeTypes-DKhwEnUM.cjs");
|
|
10
10
|
const curveFns = require("./curveFns-BilyYL_s.cjs");
|
|
11
|
-
const faceFns = require("./faceFns-
|
|
11
|
+
const faceFns = require("./faceFns-BwK7FP7N.cjs");
|
|
12
12
|
const result = require("./result.cjs");
|
|
13
|
-
const query = require("./query-
|
|
14
|
-
const Blueprint = require("./Blueprint-
|
|
13
|
+
const query = require("./query-hMSmOWJP.cjs");
|
|
14
|
+
const Blueprint = require("./Blueprint-CVctc41Z.cjs");
|
|
15
15
|
function* pointsIteration(intersector) {
|
|
16
16
|
const nPoints = intersector.NbPoints();
|
|
17
17
|
if (!nPoints) return;
|
|
@@ -1113,7 +1113,7 @@ class Sketch {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
1115
|
const isTangent = (c) => c === "symmetric" || typeof c === "number" || Array.isArray(c) && c.length === 2;
|
|
1116
|
-
const
|
|
1116
|
+
const defaultsSplineOptions = (config) => {
|
|
1117
1117
|
let conf;
|
|
1118
1118
|
if (!config) conf = { endTangent: [1, 0] };
|
|
1119
1119
|
else if (isTangent(config)) {
|
|
@@ -1518,7 +1518,7 @@ class BaseSketcher2d {
|
|
|
1518
1518
|
}
|
|
1519
1519
|
/** Draw a smooth cubic Bezier spline to an absolute end point, blending tangent with the previous curve. */
|
|
1520
1520
|
smoothSplineTo(end, config) {
|
|
1521
|
-
const { endTangent, startTangent, startFactor, endFactor } =
|
|
1521
|
+
const { endTangent, startTangent, startFactor, endFactor } = defaultsSplineOptions(config);
|
|
1522
1522
|
const previousCurve = this.pendingCurves.length ? this.pendingCurves[this.pendingCurves.length - 1] : null;
|
|
1523
1523
|
const defaultDistance = query.distance2d(this.pointer, end) * 0.25;
|
|
1524
1524
|
let startPoleDirection;
|
|
@@ -2366,7 +2366,7 @@ exports.chamferCurves = chamferCurves;
|
|
|
2366
2366
|
exports.convertSvgEllipseParams = convertSvgEllipseParams;
|
|
2367
2367
|
exports.cut2D = cut2D;
|
|
2368
2368
|
exports.cutBlueprints = cutBlueprints;
|
|
2369
|
-
exports.
|
|
2369
|
+
exports.defaultsSplineOptions = defaultsSplineOptions;
|
|
2370
2370
|
exports.filletCurves = filletCurves;
|
|
2371
2371
|
exports.fuse2D = fuse2D;
|
|
2372
2372
|
exports.fuseBlueprints = fuseBlueprints;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as createPlane } from "./vectors-CBuaMeZv.js";
|
|
2
|
-
import { o as makeFace, u as makeNewFaceWithinFace, a as assembleWire, z as zip } from "./shapeHelpers-
|
|
2
|
+
import { o as makeFace, u as makeNewFaceWithinFace, a as assembleWire, z as zip } from "./shapeHelpers-BcoZf2N9.js";
|
|
3
3
|
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-wGhcJMpB.js";
|
|
4
|
-
import { d as downcast } from "./cast-
|
|
4
|
+
import { d as downcast } from "./cast-DQaUibmm.js";
|
|
5
5
|
import { g as getKernel, a as toVec3 } from "./occtBoundary-CwegMzqc.js";
|
|
6
6
|
import { n as vecScale, j as vecNormalize, b as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-ZDdZWbwT.js";
|
|
7
|
-
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-
|
|
7
|
+
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-CtG5nMq5.js";
|
|
8
8
|
import { n as gcWithScope, q as createFace, s as createWire, o as localGC, t as createEdge } from "./shapeTypes-BlSElW8z.js";
|
|
9
9
|
import { e as curveStartPoint, a as curveTangentAt, c as curveIsClosed } from "./curveFns-CdVE4da7.js";
|
|
10
|
-
import { u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-
|
|
10
|
+
import { u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-DHu-2JpA.js";
|
|
11
11
|
import { bug } from "./result.js";
|
|
12
|
-
import { s as samePoint$1, n as normalize2d, a as subtract2d, b as add2d, d as crossProduct2d, h as scalarMultiply2d, p as polarToCartesian, i as distance2d, r as rotate2d, j as cartesianToPolar, k as polarAngle2d, P as PRECISION_INTERSECTION } from "./query-
|
|
13
|
-
import { C as Curve2D, c as make2dSegmentCurve, d as approximateAsBSpline, i as isPoint2D, e as make2dCircle, f as make2dThreePointArc, g as make2dArcFromCenter, a as BoundingBox2d, v as viewbox, h as asSVG, B as Blueprint, j as make2dTangentArc, k as make2dEllipseArc, l as make2dBezierCurve, b as axis2d, r as removeDuplicatePoints } from "./Blueprint-
|
|
12
|
+
import { s as samePoint$1, n as normalize2d, a as subtract2d, b as add2d, d as crossProduct2d, h as scalarMultiply2d, p as polarToCartesian, i as distance2d, r as rotate2d, j as cartesianToPolar, k as polarAngle2d, P as PRECISION_INTERSECTION } from "./query-V6nV-VfL.js";
|
|
13
|
+
import { C as Curve2D, c as make2dSegmentCurve, d as approximateAsBSpline, i as isPoint2D, e as make2dCircle, f as make2dThreePointArc, g as make2dArcFromCenter, a as BoundingBox2d, v as viewbox, h as asSVG, B as Blueprint, j as make2dTangentArc, k as make2dEllipseArc, l as make2dBezierCurve, b as axis2d, r as removeDuplicatePoints } from "./Blueprint-D3JfGJTz.js";
|
|
14
14
|
function* pointsIteration(intersector) {
|
|
15
15
|
const nPoints = intersector.NbPoints();
|
|
16
16
|
if (!nPoints) return;
|
|
@@ -1112,7 +1112,7 @@ class Sketch {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
1114
|
const isTangent = (c) => c === "symmetric" || typeof c === "number" || Array.isArray(c) && c.length === 2;
|
|
1115
|
-
const
|
|
1115
|
+
const defaultsSplineOptions = (config) => {
|
|
1116
1116
|
let conf;
|
|
1117
1117
|
if (!config) conf = { endTangent: [1, 0] };
|
|
1118
1118
|
else if (isTangent(config)) {
|
|
@@ -1517,7 +1517,7 @@ class BaseSketcher2d {
|
|
|
1517
1517
|
}
|
|
1518
1518
|
/** Draw a smooth cubic Bezier spline to an absolute end point, blending tangent with the previous curve. */
|
|
1519
1519
|
smoothSplineTo(end, config) {
|
|
1520
|
-
const { endTangent, startTangent, startFactor, endFactor } =
|
|
1520
|
+
const { endTangent, startTangent, startFactor, endFactor } = defaultsSplineOptions(config);
|
|
1521
1521
|
const previousCurve = this.pendingCurves.length ? this.pendingCurves[this.pendingCurves.length - 1] : null;
|
|
1522
1522
|
const defaultDistance = distance2d(this.pointer, end) * 0.25;
|
|
1523
1523
|
let startPoleDirection;
|
|
@@ -2369,7 +2369,7 @@ export {
|
|
|
2369
2369
|
Flatbush as h,
|
|
2370
2370
|
intersect2D as i,
|
|
2371
2371
|
convertSvgEllipseParams as j,
|
|
2372
|
-
|
|
2372
|
+
defaultsSplineOptions as k,
|
|
2373
2373
|
intersectCurves as l,
|
|
2374
2374
|
make2dOffset as m,
|
|
2375
2375
|
filletCurves as n,
|