@bitbybit-dev/manifold 0.19.0-alpha.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/LICENSE +21 -0
- package/README.md +63 -0
- package/babel.config.cjs +14 -0
- package/babel.config.d.cts +5 -0
- package/index.d.ts +1 -0
- package/index.js +4 -0
- package/lib/api/inputs/base-inputs.d.ts +38 -0
- package/lib/api/inputs/base-inputs.js +1 -0
- package/lib/api/inputs/index.d.ts +2 -0
- package/lib/api/inputs/index.js +2 -0
- package/lib/api/inputs/inputs.d.ts +2 -0
- package/lib/api/inputs/inputs.js +2 -0
- package/lib/api/inputs/manifold-inputs.d.ts +1131 -0
- package/lib/api/inputs/manifold-inputs.js +1270 -0
- package/lib/api/manifold-service.d.ts +14 -0
- package/lib/api/manifold-service.js +28 -0
- package/lib/api/services/cross-section/cross-section-booleans.d.ts +15 -0
- package/lib/api/services/cross-section/cross-section-booleans.js +44 -0
- package/lib/api/services/cross-section/cross-section-evaluate.d.ts +11 -0
- package/lib/api/services/cross-section/cross-section-evaluate.js +21 -0
- package/lib/api/services/cross-section/cross-section-operations.d.ts +13 -0
- package/lib/api/services/cross-section/cross-section-operations.js +34 -0
- package/lib/api/services/cross-section/cross-section-shapes.d.ts +10 -0
- package/lib/api/services/cross-section/cross-section-shapes.js +24 -0
- package/lib/api/services/cross-section/cross-section-transforms.d.ts +13 -0
- package/lib/api/services/cross-section/cross-section-transforms.js +26 -0
- package/lib/api/services/cross-section/cross-section.d.ts +20 -0
- package/lib/api/services/cross-section/cross-section.js +35 -0
- package/lib/api/services/index.d.ts +0 -0
- package/lib/api/services/index.js +0 -0
- package/lib/api/services/manifold/manifold-booleans.d.ts +18 -0
- package/lib/api/services/manifold/manifold-booleans.js +53 -0
- package/lib/api/services/manifold/manifold-evaluate.d.ts +19 -0
- package/lib/api/services/manifold/manifold-evaluate.js +45 -0
- package/lib/api/services/manifold/manifold-operations.d.ts +22 -0
- package/lib/api/services/manifold/manifold-operations.js +59 -0
- package/lib/api/services/manifold/manifold-shapes.d.ts +11 -0
- package/lib/api/services/manifold/manifold-shapes.js +29 -0
- package/lib/api/services/manifold/manifold-transforms.d.ts +16 -0
- package/lib/api/services/manifold/manifold-transforms.js +48 -0
- package/lib/api/services/manifold/manifold.d.ts +18 -0
- package/lib/api/services/manifold/manifold.js +27 -0
- package/lib/api/services/mesh/mesh-evaluate.d.ts +15 -0
- package/lib/api/services/mesh/mesh-evaluate.js +37 -0
- package/lib/api/services/mesh/mesh-operations.d.ts +7 -0
- package/lib/api/services/mesh/mesh-operations.js +8 -0
- package/lib/api/services/mesh/mesh.d.ts +9 -0
- package/lib/api/services/mesh/mesh.js +9 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/package.json +94 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Manifold3D from "manifold-3d";
|
|
2
|
+
import * as Inputs from "./inputs";
|
|
3
|
+
import { Manifold } from "./services/manifold/manifold";
|
|
4
|
+
import { CrossSection } from "./services/cross-section/cross-section";
|
|
5
|
+
import { Mesh } from "./services/mesh/mesh";
|
|
6
|
+
export declare class ManifoldService {
|
|
7
|
+
plugins: any;
|
|
8
|
+
crossSection: CrossSection;
|
|
9
|
+
manifold: Manifold;
|
|
10
|
+
mesh: Mesh;
|
|
11
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
12
|
+
decomposeManifoldOrCrossSection(inputs: Inputs.Manifold.DecomposeManifoldOrCrossSectionDto<Manifold3D.Manifold | Manifold3D.CrossSection>): Manifold3D.Mesh | Manifold3D.SimplePolygon[];
|
|
13
|
+
decomposeManifoldsOrCrossSections(inputs: Inputs.Manifold.DecomposeManifoldsOrCrossSectionsDto<Manifold3D.Manifold | Manifold3D.CrossSection>): (Manifold3D.Mesh | Manifold3D.SimplePolygon[])[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Manifold } from "./services/manifold/manifold";
|
|
2
|
+
import { CrossSection } from "./services/cross-section/cross-section";
|
|
3
|
+
import { Mesh } from "./services/mesh/mesh";
|
|
4
|
+
// Worker make an instance of this class itself
|
|
5
|
+
export class ManifoldService {
|
|
6
|
+
constructor(wasm) {
|
|
7
|
+
this.crossSection = new CrossSection(wasm);
|
|
8
|
+
this.manifold = new Manifold(wasm);
|
|
9
|
+
this.mesh = new Mesh(wasm);
|
|
10
|
+
}
|
|
11
|
+
decomposeManifoldOrCrossSection(inputs) {
|
|
12
|
+
if (inputs.manifoldOrCrossSection.getMesh) {
|
|
13
|
+
return inputs.manifoldOrCrossSection.getMesh(inputs.normalIdx);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return inputs.manifoldOrCrossSection.toPolygons();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
decomposeManifoldsOrCrossSections(inputs) {
|
|
20
|
+
return inputs.manifoldsOrCrossSections.map((manifoldOrCrossSection, index) => {
|
|
21
|
+
const normalIdx = inputs.normalIdx ? inputs.normalIdx[index] : undefined;
|
|
22
|
+
return this.decomposeManifoldOrCrossSection({
|
|
23
|
+
manifoldOrCrossSection,
|
|
24
|
+
normalIdx
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class CrossSectionBooleans {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
subtract(inputs: Inputs.Manifold.TwoCrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
7
|
+
add(inputs: Inputs.Manifold.TwoCrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
8
|
+
intersect(inputs: Inputs.Manifold.TwoCrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
9
|
+
differenceTwo(inputs: Inputs.Manifold.TwoCrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
10
|
+
difference(inputs: Inputs.Manifold.CrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
11
|
+
unionTwo(inputs: Inputs.Manifold.TwoCrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
12
|
+
union(inputs: Inputs.Manifold.CrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
13
|
+
intersectionTwo(inputs: Inputs.Manifold.TwoCrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
14
|
+
intersection(inputs: Inputs.Manifold.CrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
15
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export class CrossSectionBooleans {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
subtract(inputs) {
|
|
6
|
+
return inputs.crossSection1.subtract(inputs.crossSection2);
|
|
7
|
+
}
|
|
8
|
+
add(inputs) {
|
|
9
|
+
return inputs.crossSection1.add(inputs.crossSection2);
|
|
10
|
+
}
|
|
11
|
+
intersect(inputs) {
|
|
12
|
+
return inputs.crossSection1.intersect(inputs.crossSection2);
|
|
13
|
+
}
|
|
14
|
+
differenceTwo(inputs) {
|
|
15
|
+
const { CrossSection } = this.manifold;
|
|
16
|
+
const { difference } = CrossSection;
|
|
17
|
+
return difference(inputs.crossSection1, inputs.crossSection2);
|
|
18
|
+
}
|
|
19
|
+
difference(inputs) {
|
|
20
|
+
const { CrossSection } = this.manifold;
|
|
21
|
+
const { difference } = CrossSection;
|
|
22
|
+
return difference(inputs.crossSections);
|
|
23
|
+
}
|
|
24
|
+
unionTwo(inputs) {
|
|
25
|
+
const { CrossSection } = this.manifold;
|
|
26
|
+
const { union } = CrossSection;
|
|
27
|
+
return union(inputs.crossSection1, inputs.crossSection2);
|
|
28
|
+
}
|
|
29
|
+
union(inputs) {
|
|
30
|
+
const { CrossSection } = this.manifold;
|
|
31
|
+
const { union } = CrossSection;
|
|
32
|
+
return union(inputs.crossSections);
|
|
33
|
+
}
|
|
34
|
+
intersectionTwo(inputs) {
|
|
35
|
+
const { CrossSection } = this.manifold;
|
|
36
|
+
const { intersection } = CrossSection;
|
|
37
|
+
return intersection(inputs.crossSection1, inputs.crossSection2);
|
|
38
|
+
}
|
|
39
|
+
intersection(inputs) {
|
|
40
|
+
const { CrossSection } = this.manifold;
|
|
41
|
+
const { intersection } = CrossSection;
|
|
42
|
+
return intersection(inputs.crossSections);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class CrossSectionEvaluate {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
area(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): number;
|
|
7
|
+
isEmpty(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): boolean;
|
|
8
|
+
numVert(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): number;
|
|
9
|
+
numContour(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): number;
|
|
10
|
+
bounds(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): Inputs.Base.Vector2[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class CrossSectionEvaluate {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
area(inputs) {
|
|
6
|
+
return inputs.crossSection.area();
|
|
7
|
+
}
|
|
8
|
+
isEmpty(inputs) {
|
|
9
|
+
return inputs.crossSection.isEmpty();
|
|
10
|
+
}
|
|
11
|
+
numVert(inputs) {
|
|
12
|
+
return inputs.crossSection.numVert();
|
|
13
|
+
}
|
|
14
|
+
numContour(inputs) {
|
|
15
|
+
return inputs.crossSection.numContour();
|
|
16
|
+
}
|
|
17
|
+
bounds(inputs) {
|
|
18
|
+
const bounds = inputs.crossSection.bounds();
|
|
19
|
+
return [bounds.min, bounds.max];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class CrossSectionOperations {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
hull(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
7
|
+
extrude(inputs: Inputs.Manifold.ExtrudeDto<Manifold3D.CrossSection>): Manifold3D.Manifold;
|
|
8
|
+
revolve(inputs: Inputs.Manifold.RevolveDto<Manifold3D.CrossSection>): Manifold3D.Manifold;
|
|
9
|
+
offset(inputs: Inputs.Manifold.OffsetDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
10
|
+
simplify(inputs: Inputs.Manifold.SimplifyDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
11
|
+
compose(inputs: Inputs.Manifold.ComposeDto<(Manifold3D.CrossSection | Manifold3D.Polygons)[]>): Manifold3D.CrossSection;
|
|
12
|
+
decompose(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export class CrossSectionOperations {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
hull(inputs) {
|
|
6
|
+
return inputs.crossSection.hull();
|
|
7
|
+
}
|
|
8
|
+
extrude(inputs) {
|
|
9
|
+
return inputs.crossSection.extrude(inputs.height, inputs.nDivisions, inputs.twistDegrees, [inputs.scaleTopX, inputs.scaleTopY], inputs.center);
|
|
10
|
+
}
|
|
11
|
+
revolve(inputs) {
|
|
12
|
+
const res = inputs.crossSection.revolve(inputs.circularSegments, inputs.revolveDegrees);
|
|
13
|
+
if (inputs.matchProfile) {
|
|
14
|
+
return res.rotate([90, 0, 0]);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return res;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
offset(inputs) {
|
|
21
|
+
return inputs.crossSection.offset(inputs.delta, inputs.joinType, inputs.miterLimit, inputs.circularSegments);
|
|
22
|
+
}
|
|
23
|
+
simplify(inputs) {
|
|
24
|
+
return inputs.crossSection.simplify(inputs.epsilon);
|
|
25
|
+
}
|
|
26
|
+
compose(inputs) {
|
|
27
|
+
const { CrossSection } = this.manifold;
|
|
28
|
+
const { compose } = CrossSection;
|
|
29
|
+
return compose(inputs.polygons);
|
|
30
|
+
}
|
|
31
|
+
decompose(inputs) {
|
|
32
|
+
return inputs.crossSection.decompose();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class CrossSectionShapes {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
create(inputs: Inputs.Manifold.CreateContourSectionDto): Manifold3D.CrossSection;
|
|
7
|
+
square(inputs: Inputs.Manifold.SquareDto): Manifold3D.CrossSection;
|
|
8
|
+
circle(inputs: Inputs.Manifold.CircleDto): Manifold3D.CrossSection;
|
|
9
|
+
rectangle(inputs: Inputs.Manifold.RectangleDto): Manifold3D.CrossSection;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class CrossSectionShapes {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
create(inputs) {
|
|
6
|
+
const { CrossSection } = this.manifold;
|
|
7
|
+
return new CrossSection(inputs.polygons, inputs.fillRule);
|
|
8
|
+
}
|
|
9
|
+
square(inputs) {
|
|
10
|
+
const { CrossSection } = this.manifold;
|
|
11
|
+
const { square } = CrossSection;
|
|
12
|
+
return square(inputs.size, inputs.center);
|
|
13
|
+
}
|
|
14
|
+
circle(inputs) {
|
|
15
|
+
const { CrossSection } = this.manifold;
|
|
16
|
+
const { circle } = CrossSection;
|
|
17
|
+
return circle(inputs.radius, inputs.circularSegments);
|
|
18
|
+
}
|
|
19
|
+
rectangle(inputs) {
|
|
20
|
+
const { CrossSection } = this.manifold;
|
|
21
|
+
const { square } = CrossSection;
|
|
22
|
+
return square([inputs.length, inputs.height], inputs.center);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class CrossSectionTransforms {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
scale2D(inputs: Inputs.Manifold.Scale2DCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
7
|
+
scale(inputs: Inputs.Manifold.ScaleCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
8
|
+
mirror(inputs: Inputs.Manifold.MirrorCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
9
|
+
translate(inputs: Inputs.Manifold.TranslateCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
10
|
+
translateXY(inputs: Inputs.Manifold.TranslateXYCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
11
|
+
rotate(inputs: Inputs.Manifold.RotateCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
12
|
+
transform(inputs: Inputs.Manifold.TransformCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class CrossSectionTransforms {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
scale2D(inputs) {
|
|
6
|
+
return inputs.crossSection.scale(inputs.vector);
|
|
7
|
+
}
|
|
8
|
+
scale(inputs) {
|
|
9
|
+
return inputs.crossSection.scale(inputs.factor);
|
|
10
|
+
}
|
|
11
|
+
mirror(inputs) {
|
|
12
|
+
return inputs.crossSection.mirror(inputs.normal);
|
|
13
|
+
}
|
|
14
|
+
translate(inputs) {
|
|
15
|
+
return inputs.crossSection.translate(inputs.vector);
|
|
16
|
+
}
|
|
17
|
+
translateXY(inputs) {
|
|
18
|
+
return inputs.crossSection.translate([inputs.x, inputs.y]);
|
|
19
|
+
}
|
|
20
|
+
rotate(inputs) {
|
|
21
|
+
return inputs.crossSection.rotate(inputs.degrees);
|
|
22
|
+
}
|
|
23
|
+
transform(inputs) {
|
|
24
|
+
return inputs.crossSection.transform(inputs.transform);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
import { CrossSectionShapes } from "./cross-section-shapes";
|
|
4
|
+
import { CrossSectionOperations } from "./cross-section-operations";
|
|
5
|
+
import { CrossSectionTransforms } from "./cross-section-transforms";
|
|
6
|
+
import { CrossSectionBooleans } from "./cross-section-booleans";
|
|
7
|
+
import { CrossSectionEvaluate } from "./cross-section-evaluate";
|
|
8
|
+
export declare class CrossSection {
|
|
9
|
+
shapes: CrossSectionShapes;
|
|
10
|
+
operations: CrossSectionOperations;
|
|
11
|
+
transforms: CrossSectionTransforms;
|
|
12
|
+
booleans: CrossSectionBooleans;
|
|
13
|
+
evaluate: CrossSectionEvaluate;
|
|
14
|
+
private manifold;
|
|
15
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
16
|
+
crossSectionToPolygons(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): Manifold3D.SimplePolygon[];
|
|
17
|
+
crossSectionsToPolygons(inputs: Inputs.Manifold.CrossSectionsDto<Manifold3D.CrossSection>): Manifold3D.SimplePolygon[][];
|
|
18
|
+
deleteCrossSection(inputs: Inputs.Manifold.CrossSectionDto<Manifold3D.CrossSection>): void;
|
|
19
|
+
deleteCrossSections(inputs: Inputs.Manifold.CrossSectionsDto<Manifold3D.CrossSection>): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CrossSectionShapes } from "./cross-section-shapes";
|
|
2
|
+
import { CrossSectionOperations } from "./cross-section-operations";
|
|
3
|
+
import { CrossSectionTransforms } from "./cross-section-transforms";
|
|
4
|
+
import { CrossSectionBooleans } from "./cross-section-booleans";
|
|
5
|
+
import { CrossSectionEvaluate } from "./cross-section-evaluate";
|
|
6
|
+
export class CrossSection {
|
|
7
|
+
constructor(wasm) {
|
|
8
|
+
this.manifold = wasm;
|
|
9
|
+
this.shapes = new CrossSectionShapes(wasm);
|
|
10
|
+
this.operations = new CrossSectionOperations(wasm);
|
|
11
|
+
this.transforms = new CrossSectionTransforms(wasm);
|
|
12
|
+
this.booleans = new CrossSectionBooleans(wasm);
|
|
13
|
+
this.evaluate = new CrossSectionEvaluate(wasm);
|
|
14
|
+
}
|
|
15
|
+
crossSectionToPolygons(inputs) {
|
|
16
|
+
return inputs.crossSection.toPolygons();
|
|
17
|
+
}
|
|
18
|
+
crossSectionsToPolygons(inputs) {
|
|
19
|
+
return inputs.crossSections.map((crossSection) => {
|
|
20
|
+
return this.crossSectionToPolygons({
|
|
21
|
+
crossSection
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
deleteCrossSection(inputs) {
|
|
26
|
+
inputs.crossSection.delete();
|
|
27
|
+
}
|
|
28
|
+
deleteCrossSections(inputs) {
|
|
29
|
+
inputs.crossSections.forEach((crossSection) => {
|
|
30
|
+
return this.deleteCrossSection({
|
|
31
|
+
crossSection
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class ManifoldBooleans {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
split(inputs: Inputs.Manifold.SplitManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold[];
|
|
7
|
+
splitByPlane(inputs: Inputs.Manifold.SplitByPlaneDto<Manifold3D.Manifold>): Manifold3D.Manifold[];
|
|
8
|
+
trimByPlane(inputs: Inputs.Manifold.TrimByPlaneDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
9
|
+
subtract(inputs: Inputs.Manifold.TwoManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
10
|
+
add(inputs: Inputs.Manifold.TwoManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
11
|
+
intersect(inputs: Inputs.Manifold.TwoManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
12
|
+
differenceTwo(inputs: Inputs.Manifold.TwoManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
13
|
+
difference(inputs: Inputs.Manifold.ManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
14
|
+
unionTwo(inputs: Inputs.Manifold.TwoManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
15
|
+
union(inputs: Inputs.Manifold.ManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
16
|
+
intersectionTwo(inputs: Inputs.Manifold.TwoManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
17
|
+
intersection(inputs: Inputs.Manifold.ManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
18
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export class ManifoldBooleans {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
split(inputs) {
|
|
6
|
+
return inputs.manifoldToSplit.split(inputs.manifoldCutter);
|
|
7
|
+
}
|
|
8
|
+
splitByPlane(inputs) {
|
|
9
|
+
return inputs.manifold.splitByPlane(inputs.normal, inputs.originOffset);
|
|
10
|
+
}
|
|
11
|
+
trimByPlane(inputs) {
|
|
12
|
+
return inputs.manifold.asOriginal().trimByPlane(inputs.normal, inputs.originOffset);
|
|
13
|
+
}
|
|
14
|
+
subtract(inputs) {
|
|
15
|
+
return inputs.manifold1.subtract(inputs.manifold2);
|
|
16
|
+
}
|
|
17
|
+
add(inputs) {
|
|
18
|
+
return inputs.manifold1.add(inputs.manifold2);
|
|
19
|
+
}
|
|
20
|
+
intersect(inputs) {
|
|
21
|
+
return inputs.manifold1.intersect(inputs.manifold2);
|
|
22
|
+
}
|
|
23
|
+
differenceTwo(inputs) {
|
|
24
|
+
const { Manifold } = this.manifold;
|
|
25
|
+
const { difference } = Manifold;
|
|
26
|
+
return difference(inputs.manifold1, inputs.manifold2);
|
|
27
|
+
}
|
|
28
|
+
difference(inputs) {
|
|
29
|
+
const { Manifold } = this.manifold;
|
|
30
|
+
const { difference } = Manifold;
|
|
31
|
+
return difference(inputs.manifolds);
|
|
32
|
+
}
|
|
33
|
+
unionTwo(inputs) {
|
|
34
|
+
const { Manifold } = this.manifold;
|
|
35
|
+
const { union } = Manifold;
|
|
36
|
+
return union(inputs.manifold1, inputs.manifold2);
|
|
37
|
+
}
|
|
38
|
+
union(inputs) {
|
|
39
|
+
const { Manifold } = this.manifold;
|
|
40
|
+
const { union } = Manifold;
|
|
41
|
+
return union(inputs.manifolds);
|
|
42
|
+
}
|
|
43
|
+
intersectionTwo(inputs) {
|
|
44
|
+
const { Manifold } = this.manifold;
|
|
45
|
+
const { intersection } = Manifold;
|
|
46
|
+
return intersection(inputs.manifold1, inputs.manifold2);
|
|
47
|
+
}
|
|
48
|
+
intersection(inputs) {
|
|
49
|
+
const { Manifold } = this.manifold;
|
|
50
|
+
const { intersection } = Manifold;
|
|
51
|
+
return intersection(inputs.manifolds);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class ManifoldEvaluate {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
volume(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
7
|
+
surfaceArea(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
8
|
+
isEmpty(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): boolean;
|
|
9
|
+
numVert(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
10
|
+
numTri(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
11
|
+
numEdge(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
12
|
+
numProp(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
13
|
+
numPropVert(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
14
|
+
boundingBox(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Inputs.Base.Vector3[];
|
|
15
|
+
tolerance(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
16
|
+
genus(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
17
|
+
minGap(inputs: Inputs.Manifold.ManifoldsMinGapDto<Manifold3D.Manifold>): number;
|
|
18
|
+
originalID(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export class ManifoldEvaluate {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
volume(inputs) {
|
|
6
|
+
return inputs.manifold.volume();
|
|
7
|
+
}
|
|
8
|
+
surfaceArea(inputs) {
|
|
9
|
+
return inputs.manifold.surfaceArea();
|
|
10
|
+
}
|
|
11
|
+
isEmpty(inputs) {
|
|
12
|
+
return inputs.manifold.isEmpty();
|
|
13
|
+
}
|
|
14
|
+
numVert(inputs) {
|
|
15
|
+
return inputs.manifold.numVert();
|
|
16
|
+
}
|
|
17
|
+
numTri(inputs) {
|
|
18
|
+
return inputs.manifold.numTri();
|
|
19
|
+
}
|
|
20
|
+
numEdge(inputs) {
|
|
21
|
+
return inputs.manifold.numEdge();
|
|
22
|
+
}
|
|
23
|
+
numProp(inputs) {
|
|
24
|
+
return inputs.manifold.numProp();
|
|
25
|
+
}
|
|
26
|
+
numPropVert(inputs) {
|
|
27
|
+
return inputs.manifold.numPropVert();
|
|
28
|
+
}
|
|
29
|
+
boundingBox(inputs) {
|
|
30
|
+
const bounds = inputs.manifold.boundingBox();
|
|
31
|
+
return [bounds.min, bounds.max];
|
|
32
|
+
}
|
|
33
|
+
tolerance(inputs) {
|
|
34
|
+
return inputs.manifold.tolerance();
|
|
35
|
+
}
|
|
36
|
+
genus(inputs) {
|
|
37
|
+
return inputs.manifold.genus();
|
|
38
|
+
}
|
|
39
|
+
minGap(inputs) {
|
|
40
|
+
return inputs.manifold1.minGap(inputs.manifold2, inputs.searchLength);
|
|
41
|
+
}
|
|
42
|
+
originalID(inputs) {
|
|
43
|
+
return inputs.manifold.originalID();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class ManifoldOperations {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
hull(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
7
|
+
hullPoints(inputs: Inputs.Manifold.HullPointsDto<(Inputs.Base.Point3 | Manifold3D.Manifold)[]>): Manifold3D.Manifold;
|
|
8
|
+
slice(inputs: Inputs.Manifold.SliceDto<Manifold3D.Manifold>): Manifold3D.CrossSection;
|
|
9
|
+
project(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.CrossSection;
|
|
10
|
+
setTolerance(inputs: Inputs.Manifold.ManifoldRefineToleranceDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
11
|
+
asOriginal(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
12
|
+
reserveIds(inputs: Inputs.Manifold.CountDto): number;
|
|
13
|
+
compose(inputs: Inputs.Manifold.ManifoldsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
14
|
+
decompose(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): Manifold3D.Manifold[];
|
|
15
|
+
calculateNormals(inputs: Inputs.Manifold.CalculateNormalsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
16
|
+
calculateCurvature(inputs: Inputs.Manifold.CalculateCurvatureDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
17
|
+
refineToTolerance(inputs: Inputs.Manifold.ManifoldRefineToleranceDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
18
|
+
refineToLength(inputs: Inputs.Manifold.ManifoldRefineLengthDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
19
|
+
refine(inputs: Inputs.Manifold.ManifoldRefineDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
20
|
+
smoothOut(inputs: Inputs.Manifold.ManifoldSmoothOutDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
21
|
+
smoothByNormals(inputs: Inputs.Manifold.ManifoldSmoothByNormalsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
22
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export class ManifoldOperations {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
hull(inputs) {
|
|
6
|
+
return inputs.manifold.hull();
|
|
7
|
+
}
|
|
8
|
+
hullPoints(inputs) {
|
|
9
|
+
const { Manifold } = this.manifold;
|
|
10
|
+
const { hull } = Manifold;
|
|
11
|
+
return hull(inputs.points);
|
|
12
|
+
}
|
|
13
|
+
slice(inputs) {
|
|
14
|
+
return inputs.manifold.slice(inputs.height);
|
|
15
|
+
}
|
|
16
|
+
project(inputs) {
|
|
17
|
+
return inputs.manifold.project();
|
|
18
|
+
}
|
|
19
|
+
setTolerance(inputs) {
|
|
20
|
+
return inputs.manifold.setTolerance(inputs.tolerance);
|
|
21
|
+
}
|
|
22
|
+
asOriginal(inputs) {
|
|
23
|
+
return inputs.manifold.asOriginal();
|
|
24
|
+
}
|
|
25
|
+
reserveIds(inputs) {
|
|
26
|
+
const { Manifold } = this.manifold;
|
|
27
|
+
const { reserveIDs } = Manifold;
|
|
28
|
+
return reserveIDs(inputs.count);
|
|
29
|
+
}
|
|
30
|
+
compose(inputs) {
|
|
31
|
+
const { Manifold } = this.manifold;
|
|
32
|
+
const { compose } = Manifold;
|
|
33
|
+
return compose(inputs.manifolds);
|
|
34
|
+
}
|
|
35
|
+
decompose(inputs) {
|
|
36
|
+
return inputs.manifold.decompose();
|
|
37
|
+
}
|
|
38
|
+
calculateNormals(inputs) {
|
|
39
|
+
return inputs.manifold.calculateNormals(inputs.normalIdx, inputs.minSharpAngle);
|
|
40
|
+
}
|
|
41
|
+
calculateCurvature(inputs) {
|
|
42
|
+
return inputs.manifold.calculateCurvature(inputs.gaussianIdx, inputs.meanIdx);
|
|
43
|
+
}
|
|
44
|
+
refineToTolerance(inputs) {
|
|
45
|
+
return inputs.manifold.refineToTolerance(inputs.tolerance);
|
|
46
|
+
}
|
|
47
|
+
refineToLength(inputs) {
|
|
48
|
+
return inputs.manifold.refineToLength(inputs.length);
|
|
49
|
+
}
|
|
50
|
+
refine(inputs) {
|
|
51
|
+
return inputs.manifold.refine(inputs.number);
|
|
52
|
+
}
|
|
53
|
+
smoothOut(inputs) {
|
|
54
|
+
return inputs.manifold.smoothOut(inputs.minSharpAngle, inputs.minSmoothness);
|
|
55
|
+
}
|
|
56
|
+
smoothByNormals(inputs) {
|
|
57
|
+
return inputs.manifold.smoothByNormals(inputs.normalIdx);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class ManifoldShapes {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
manifoldFromMesh(inputs: Inputs.Manifold.CreateFromMeshDto): Manifold3D.Manifold;
|
|
7
|
+
cube(inputs: Inputs.Manifold.CubeDto): Manifold3D.Manifold;
|
|
8
|
+
sphere(inputs: Inputs.Manifold.SphereDto): Manifold3D.Manifold;
|
|
9
|
+
tetrahedron(): Manifold3D.Manifold;
|
|
10
|
+
cylinder(inputs: Inputs.Manifold.CylinderDto): Manifold3D.Manifold;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class ManifoldShapes {
|
|
2
|
+
constructor(wasm) {
|
|
3
|
+
this.manifold = wasm;
|
|
4
|
+
}
|
|
5
|
+
manifoldFromMesh(inputs) {
|
|
6
|
+
const { Manifold } = this.manifold;
|
|
7
|
+
return new Manifold(inputs.mesh);
|
|
8
|
+
}
|
|
9
|
+
cube(inputs) {
|
|
10
|
+
const { Manifold } = this.manifold;
|
|
11
|
+
const { cube } = Manifold;
|
|
12
|
+
return cube(inputs.size, inputs.center);
|
|
13
|
+
}
|
|
14
|
+
sphere(inputs) {
|
|
15
|
+
const { Manifold } = this.manifold;
|
|
16
|
+
const { sphere } = Manifold;
|
|
17
|
+
return sphere(inputs.radius, inputs.circularSegments);
|
|
18
|
+
}
|
|
19
|
+
tetrahedron() {
|
|
20
|
+
const { Manifold } = this.manifold;
|
|
21
|
+
const { tetrahedron } = Manifold;
|
|
22
|
+
return tetrahedron();
|
|
23
|
+
}
|
|
24
|
+
cylinder(inputs) {
|
|
25
|
+
const { Manifold } = this.manifold;
|
|
26
|
+
const { cylinder } = Manifold;
|
|
27
|
+
return cylinder(inputs.height, inputs.radiusLow, inputs.radiusHigh, inputs.circularSegments, inputs.center);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Inputs from "../../inputs/manifold-inputs";
|
|
2
|
+
import * as Manifold3D from "manifold-3d";
|
|
3
|
+
export declare class ManifoldTransforms {
|
|
4
|
+
private manifold;
|
|
5
|
+
constructor(wasm: Manifold3D.ManifoldToplevel);
|
|
6
|
+
scale3D(inputs: Inputs.Manifold.Scale3DDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
7
|
+
scale(inputs: Inputs.Manifold.Scale3DDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
8
|
+
mirror(inputs: Inputs.Manifold.MirrorDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
9
|
+
translate(inputs: Inputs.Manifold.TranslateDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
10
|
+
translateByVectors(inputs: Inputs.Manifold.TranslateByVectorsDto<Manifold3D.Manifold>): Manifold3D.Manifold[];
|
|
11
|
+
rotate(inputs: Inputs.Manifold.RotateDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
12
|
+
rotateXYZ(inputs: Inputs.Manifold.RotateXYZDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
13
|
+
translateXYZ(inputs: Inputs.Manifold.TranslateXYZDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
14
|
+
transform(inputs: Inputs.Manifold.TransformDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
15
|
+
transforms(inputs: Inputs.Manifold.TransformsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
16
|
+
}
|