@bitbybit-dev/manifold 0.20.13 → 0.20.14
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 +64 -1
- package/lib/api/inputs/manifold-inputs.js +56 -0
- package/lib/api/services/cross-section/cross-section-transforms.d.ts +1 -0
- package/lib/api/services/cross-section/cross-section-transforms.js +3 -0
- package/lib/api/services/manifold/manifold-evaluate.d.ts +1 -0
- package/lib/api/services/manifold/manifold-evaluate.js +3 -0
- package/lib/api/services/manifold/manifold-operations.d.ts +2 -0
- package/lib/api/services/manifold/manifold-operations.js +6 -0
- package/lib/api/services/manifold/manifold-transforms.d.ts +1 -0
- package/lib/api/services/manifold/manifold-transforms.js +3 -0
- package/package.json +2 -2
|
@@ -21,7 +21,8 @@ export declare namespace Manifold {
|
|
|
21
21
|
enum manifoldJoinTypeEnum {
|
|
22
22
|
square = "Square",
|
|
23
23
|
round = "Round",
|
|
24
|
-
miter = "Miter"
|
|
24
|
+
miter = "Miter",
|
|
25
|
+
bevel = "Bevel"
|
|
25
26
|
}
|
|
26
27
|
class DecomposedManifoldMeshDto {
|
|
27
28
|
numProp: number;
|
|
@@ -459,6 +460,44 @@ export declare namespace Manifold {
|
|
|
459
460
|
*/
|
|
460
461
|
normalIdx: number;
|
|
461
462
|
}
|
|
463
|
+
class ManifoldSimplifyDto<T> {
|
|
464
|
+
constructor(manifold?: T, tolerance?: number);
|
|
465
|
+
/**
|
|
466
|
+
* Manifold shape
|
|
467
|
+
*/
|
|
468
|
+
manifold: T;
|
|
469
|
+
/**
|
|
470
|
+
* The maximum distance between the original and simplified meshes.
|
|
471
|
+
* If not given or is less than the current tolerance, the current tolerance is used.
|
|
472
|
+
* The result will contain a subset of the original verts and all surfaces will have moved by less than tolerance.
|
|
473
|
+
* @default undefined
|
|
474
|
+
* @minimum 0
|
|
475
|
+
* @maximum Infinity
|
|
476
|
+
* @step 0.001
|
|
477
|
+
*/
|
|
478
|
+
tolerance?: number;
|
|
479
|
+
}
|
|
480
|
+
class ManifoldSetPropertiesDto<T> {
|
|
481
|
+
constructor(manifold?: T, numProp?: number, propFunc?: (newProp: number[], position: Base.Vector3, oldProp: number[]) => void);
|
|
482
|
+
/**
|
|
483
|
+
* Manifold shape
|
|
484
|
+
*/
|
|
485
|
+
manifold: T;
|
|
486
|
+
/**
|
|
487
|
+
* The new number of properties per vertex
|
|
488
|
+
* @default 3
|
|
489
|
+
* @minimum 3
|
|
490
|
+
* @maximum Infinity
|
|
491
|
+
* @step 1
|
|
492
|
+
*/
|
|
493
|
+
numProp: number;
|
|
494
|
+
/**
|
|
495
|
+
* A function that modifies the properties of a given vertex.
|
|
496
|
+
* Note: undefined behavior will result if you read past the number of input properties or write past the number of output properties.
|
|
497
|
+
* @default undefined
|
|
498
|
+
*/
|
|
499
|
+
propFunc: (newProp: number[], position: Base.Vector3, oldProp: number[]) => void;
|
|
500
|
+
}
|
|
462
501
|
class ManifoldSmoothOutDto<T> {
|
|
463
502
|
constructor(manifold?: T, minSharpAngle?: number, minSmoothness?: number);
|
|
464
503
|
/**
|
|
@@ -839,6 +878,18 @@ export declare namespace Manifold {
|
|
|
839
878
|
*/
|
|
840
879
|
transform: Base.TransformMatrix3x3;
|
|
841
880
|
}
|
|
881
|
+
class CrossSectionWarpDto<T> {
|
|
882
|
+
constructor(crossSection?: T, warpFunc?: (vert: Base.Vector2) => void);
|
|
883
|
+
/**
|
|
884
|
+
* Cross section
|
|
885
|
+
*/
|
|
886
|
+
crossSection: T;
|
|
887
|
+
/**
|
|
888
|
+
* A function that modifies a given vertex position
|
|
889
|
+
* @default undefined
|
|
890
|
+
*/
|
|
891
|
+
warpFunc: (vert: Base.Vector2) => void;
|
|
892
|
+
}
|
|
842
893
|
class MirrorDto<T> {
|
|
843
894
|
constructor(manifold?: T, normal?: Base.Vector3);
|
|
844
895
|
/**
|
|
@@ -997,6 +1048,18 @@ export declare namespace Manifold {
|
|
|
997
1048
|
*/
|
|
998
1049
|
transforms: Base.TransformMatrixes;
|
|
999
1050
|
}
|
|
1051
|
+
class ManifoldWarpDto<T> {
|
|
1052
|
+
constructor(manifold?: T, warpFunc?: (vert: Base.Vector3) => void);
|
|
1053
|
+
/**
|
|
1054
|
+
* Manifold shape
|
|
1055
|
+
*/
|
|
1056
|
+
manifold: T;
|
|
1057
|
+
/**
|
|
1058
|
+
* A function that modifies a given vertex position
|
|
1059
|
+
* @default undefined
|
|
1060
|
+
*/
|
|
1061
|
+
warpFunc: (vert: Base.Vector3) => void;
|
|
1062
|
+
}
|
|
1000
1063
|
class TwoCrossSectionsDto<T> {
|
|
1001
1064
|
constructor(crossSection1?: T, crossSection2?: T);
|
|
1002
1065
|
/**
|
|
@@ -13,6 +13,7 @@ export var Manifold;
|
|
|
13
13
|
manifoldJoinTypeEnum["square"] = "Square";
|
|
14
14
|
manifoldJoinTypeEnum["round"] = "Round";
|
|
15
15
|
manifoldJoinTypeEnum["miter"] = "Miter";
|
|
16
|
+
manifoldJoinTypeEnum["bevel"] = "Bevel";
|
|
16
17
|
})(manifoldJoinTypeEnum = Manifold.manifoldJoinTypeEnum || (Manifold.manifoldJoinTypeEnum = {}));
|
|
17
18
|
class DecomposedManifoldMeshDto {
|
|
18
19
|
}
|
|
@@ -535,6 +536,39 @@ export var Manifold;
|
|
|
535
536
|
}
|
|
536
537
|
}
|
|
537
538
|
Manifold.ManifoldSmoothByNormalsDto = ManifoldSmoothByNormalsDto;
|
|
539
|
+
class ManifoldSimplifyDto {
|
|
540
|
+
constructor(manifold, tolerance) {
|
|
541
|
+
if (manifold !== undefined) {
|
|
542
|
+
this.manifold = manifold;
|
|
543
|
+
}
|
|
544
|
+
if (tolerance !== undefined) {
|
|
545
|
+
this.tolerance = tolerance;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
Manifold.ManifoldSimplifyDto = ManifoldSimplifyDto;
|
|
550
|
+
class ManifoldSetPropertiesDto {
|
|
551
|
+
constructor(manifold, numProp, propFunc) {
|
|
552
|
+
/**
|
|
553
|
+
* The new number of properties per vertex
|
|
554
|
+
* @default 3
|
|
555
|
+
* @minimum 3
|
|
556
|
+
* @maximum Infinity
|
|
557
|
+
* @step 1
|
|
558
|
+
*/
|
|
559
|
+
this.numProp = 3;
|
|
560
|
+
if (manifold !== undefined) {
|
|
561
|
+
this.manifold = manifold;
|
|
562
|
+
}
|
|
563
|
+
if (numProp !== undefined) {
|
|
564
|
+
this.numProp = numProp;
|
|
565
|
+
}
|
|
566
|
+
if (propFunc !== undefined) {
|
|
567
|
+
this.propFunc = propFunc;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
Manifold.ManifoldSetPropertiesDto = ManifoldSetPropertiesDto;
|
|
538
572
|
class ManifoldSmoothOutDto {
|
|
539
573
|
constructor(manifold, minSharpAngle, minSmoothness) {
|
|
540
574
|
/**
|
|
@@ -935,6 +969,17 @@ export var Manifold;
|
|
|
935
969
|
}
|
|
936
970
|
}
|
|
937
971
|
Manifold.TransformCrossSectionDto = TransformCrossSectionDto;
|
|
972
|
+
class CrossSectionWarpDto {
|
|
973
|
+
constructor(crossSection, warpFunc) {
|
|
974
|
+
if (crossSection !== undefined) {
|
|
975
|
+
this.crossSection = crossSection;
|
|
976
|
+
}
|
|
977
|
+
if (warpFunc !== undefined) {
|
|
978
|
+
this.warpFunc = warpFunc;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
Manifold.CrossSectionWarpDto = CrossSectionWarpDto;
|
|
938
983
|
class MirrorDto {
|
|
939
984
|
constructor(manifold, normal) {
|
|
940
985
|
/**
|
|
@@ -1120,6 +1165,17 @@ export var Manifold;
|
|
|
1120
1165
|
}
|
|
1121
1166
|
}
|
|
1122
1167
|
Manifold.TransformsDto = TransformsDto;
|
|
1168
|
+
class ManifoldWarpDto {
|
|
1169
|
+
constructor(manifold, warpFunc) {
|
|
1170
|
+
if (manifold !== undefined) {
|
|
1171
|
+
this.manifold = manifold;
|
|
1172
|
+
}
|
|
1173
|
+
if (warpFunc !== undefined) {
|
|
1174
|
+
this.warpFunc = warpFunc;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
Manifold.ManifoldWarpDto = ManifoldWarpDto;
|
|
1123
1179
|
class TwoCrossSectionsDto {
|
|
1124
1180
|
constructor(crossSection1, crossSection2) {
|
|
1125
1181
|
if (crossSection1 !== undefined) {
|
|
@@ -10,4 +10,5 @@ export declare class CrossSectionTransforms {
|
|
|
10
10
|
translateXY(inputs: Inputs.Manifold.TranslateXYCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
11
11
|
rotate(inputs: Inputs.Manifold.RotateCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
12
12
|
transform(inputs: Inputs.Manifold.TransformCrossSectionDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
13
|
+
warp(inputs: Inputs.Manifold.CrossSectionWarpDto<Manifold3D.CrossSection>): Manifold3D.CrossSection;
|
|
13
14
|
}
|
|
@@ -16,4 +16,5 @@ export declare class ManifoldEvaluate {
|
|
|
16
16
|
genus(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
17
17
|
minGap(inputs: Inputs.Manifold.ManifoldsMinGapDto<Manifold3D.Manifold>): number;
|
|
18
18
|
originalID(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): number;
|
|
19
|
+
status(inputs: Inputs.Manifold.ManifoldDto<Manifold3D.Manifold>): string;
|
|
19
20
|
}
|
|
@@ -19,4 +19,6 @@ export declare class ManifoldOperations {
|
|
|
19
19
|
refine(inputs: Inputs.Manifold.ManifoldRefineDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
20
20
|
smoothOut(inputs: Inputs.Manifold.ManifoldSmoothOutDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
21
21
|
smoothByNormals(inputs: Inputs.Manifold.ManifoldSmoothByNormalsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
22
|
+
simplify(inputs: Inputs.Manifold.ManifoldSimplifyDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
23
|
+
setProperties(inputs: Inputs.Manifold.ManifoldSetPropertiesDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
22
24
|
}
|
|
@@ -56,4 +56,10 @@ export class ManifoldOperations {
|
|
|
56
56
|
smoothByNormals(inputs) {
|
|
57
57
|
return inputs.manifold.smoothByNormals(inputs.normalIdx);
|
|
58
58
|
}
|
|
59
|
+
simplify(inputs) {
|
|
60
|
+
return inputs.manifold.simplify(inputs.tolerance);
|
|
61
|
+
}
|
|
62
|
+
setProperties(inputs) {
|
|
63
|
+
return inputs.manifold.setProperties(inputs.numProp, inputs.propFunc);
|
|
64
|
+
}
|
|
59
65
|
}
|
|
@@ -13,4 +13,5 @@ export declare class ManifoldTransforms {
|
|
|
13
13
|
translateXYZ(inputs: Inputs.Manifold.TranslateXYZDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
14
14
|
transform(inputs: Inputs.Manifold.TransformDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
15
15
|
transforms(inputs: Inputs.Manifold.TransformsDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
16
|
+
warp(inputs: Inputs.Manifold.ManifoldWarpDto<Manifold3D.Manifold>): Manifold3D.Manifold;
|
|
16
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitbybit-dev/manifold",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.14",
|
|
4
4
|
"description": "Bit By Bit Developers Manifold based CAD Library to Program Geometry",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"types": "./index.d.ts",
|
|
59
59
|
"type": "module",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"manifold-3d": "3.
|
|
61
|
+
"manifold-3d": "3.3.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"shx":"0.4.0",
|