Skip to content

Commit 6490b37

Browse files
committed
Setup typescript + one example
1 parent 33911f0 commit 6490b37

16 files changed

+809
-862
lines changed

dist/export.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
export const version: "1.0.0";
21
import Types from "./blobtree/Types.js";
32
import Element from "./blobtree/Element.js";
43
import Node from "./blobtree/Node.js";
54
import RootNode from "./blobtree/RootNode.js";
65
import RicciNode from "./blobtree/RicciNode.js";
76
import DifferenceNode from "./blobtree/DifferenceNode.js";
87
import MinNode from "./blobtree/MinNode.js";
9-
import MaxNode from "./blobtree/MinNode.js";
108
import TwistNode from "./blobtree/TwistNode";
119
import ScaleNode from "./blobtree/ScaleNode";
10+
import MaxNode from "./blobtree/MinNode.js";
1211
import Primitive from "./blobtree/Primitive.js";
1312
import ScalisMath from "./blobtree/scalis/ScalisMath.js";
1413
import ScalisPrimitive from "./blobtree/scalis/ScalisPrimitive.js";
@@ -32,7 +31,8 @@ import AreaScalisTri from "./blobtree/areas/AreaScalisTri.js";
3231
import AreaSphere from "./blobtree/areas/AreaSphere.js";
3332
import AreaCapsule from "./blobtree/areas/AreaCapsule.js";
3433
import SlidingMarchingCubes from "./polygonizers/SlidingMarchingCubes.js";
35-
import SplitMaxPolygonizer from "./polygonizers/SplitMaxPolygonizer.js";
34+
import { SplitMaxPolygonizer } from "./polygonizers/SplitMaxPolygonizer";
3635
import SplitSMC from "./polygonizers/SplitSMC.js";
37-
export { Types, Element, Node, RootNode, RicciNode, DifferenceNode, MinNode, MaxNode, TwistNode, ScaleNode, Primitive, ScalisMath, ScalisPrimitive, ScalisPoint, ScalisSegment, ScalisTriangle, ScalisVertex, DistanceFunctor, Poly6DistanceFunctor, SDFRootNode, SDFPrimitive, SDFPoint, SDFSegment, SDFSphere, SDFCapsule, Material, Accuracies, Area, AreaScalisSeg, AreaScalisTri, AreaSphere, AreaCapsule, SlidingMarchingCubes, SplitMaxPolygonizer, SplitSMC };
36+
declare const version = "1.0.0";
37+
export { version, Types, Element, Node, RootNode, RicciNode, DifferenceNode, MinNode, MaxNode, TwistNode, ScaleNode, Primitive, ScalisMath, ScalisPrimitive, ScalisPoint, ScalisSegment, ScalisTriangle, ScalisVertex, DistanceFunctor, Poly6DistanceFunctor, SDFRootNode, SDFPrimitive, SDFPoint, SDFSegment, SDFSphere, SDFCapsule, Material, Accuracies, Area, AreaScalisSeg, AreaScalisTri, AreaSphere, AreaCapsule, SlidingMarchingCubes, SplitMaxPolygonizer, SplitSMC, };
3838
//# sourceMappingURL=export.d.ts.map

dist/export.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,56 @@
1-
export = SplitMaxPolygonizer;
2-
/**
3-
* @typedef {import('./SlidingMarchingCubes').SMCParams} SMCParams
4-
*/
1+
import RootNode from "../blobtree/RootNode";
2+
declare type ConvergenceParams = {
3+
ratio?: number;
4+
step?: number;
5+
};
6+
declare type SMCParams = {
7+
zResolution?: "adaptive" | "uniform";
8+
detailRatio?: number;
9+
progress?: (percent: number) => void;
10+
convergence?: ConvergenceParams;
11+
dichotomy?: number;
12+
};
513
/**
6-
* @typedef {SMCParams & {class: any}} SubPolygonizerParams
14+
* Parameters for the subpolygonizer to use.
15+
* Contain a className which will be mapped to a constructor, and parameters related to that polygonizer
716
*/
17+
declare type SubPolygonizerParams = {
18+
className: "SlidingMarchingCubes";
19+
smcParams?: SMCParams;
20+
};
821
/**
922
* @typedef {Object} SplitMaxPolygonizerParams
10-
* @property {SubPolygonizerParams=} subPolygonizer Parameters for the subpolygonizer to use.
11-
* Must contain all parameters for the given subPolygonizer (like detailRatio, etc...)
12-
* The class of the subpolygonizer (default to SlidingMarchingCubes) is in additional parameter class
13-
* @property {Boolean=} smpParams.uniformRes If true, uniform resolution will be used on all primitives, according to the minimum accuracy in the blobtree.
14-
* @property {Function=} smpParams.progress Progress callback, taking a percentage as parameter.
15-
* @property {Number=} smpParams.ricciThreshold The RicciNode coefficient above which it will be considered like a MaxNode.
23+
* @property {SubPolygonizerParams=} subPolygonizer P
24+
* @property {Boolean=} smpParams.uniformRes
25+
* @property {Function=} smpParams.progress
26+
* @property {Number=} smpParams.ricciThreshold
1627
*/
28+
export declare type SplitMaxPolygonizerParams = {
29+
subPolygonizer?: SubPolygonizerParams;
30+
uniformRes?: boolean;
31+
progress?: (percent: number) => void;
32+
ricciThreshold?: number;
33+
};
1734
/**
1835
* This class will polygonize nodes independantly when they blend with a MaxNode or a RicciNode
1936
* (for RicciNode, only if the coefficient of at least "ricciThreshold", threshold being a parameter).
2037
* It will create a mesh made of several shells but intersections will be better looking than with some
2138
* global polygonizers like MarchingCubes.
2239
*/
23-
declare class SplitMaxPolygonizer {
24-
/**
25-
* @param {SplitMaxPolygonizerParams=} smpParams Parameters and option for this polygonizer.
26-
*/
27-
constructor(blobtree: any, smpParams?: SplitMaxPolygonizerParams | undefined);
28-
blobtree: any;
29-
uniformRes: boolean;
30-
min_acc: any;
31-
minAccs: any[];
32-
/** @type {SubPolygonizerParams} */
33-
subPolygonizer: SubPolygonizerParams;
34-
ricciThreshold: number;
35-
progress: Function;
36-
subtrees: any[];
37-
progCoeff: any[];
38-
totalCoeff: number;
39-
constructor: typeof import("./SplitMaxPolygonizer");
40-
setBlobtree(blobtree: any): void;
41-
compute(): THREE.BufferGeometry;
42-
}
43-
declare namespace SplitMaxPolygonizer {
44-
export { SMCParams, SubPolygonizerParams, SplitMaxPolygonizerParams };
40+
export declare class SplitMaxPolygonizer {
41+
private blobtree;
42+
private uniformRes;
43+
private min_acc;
44+
private minAccs;
45+
private subPolygonizer;
46+
readonly ricciThreshold: number;
47+
private progress;
48+
private subtrees;
49+
private progCoeff;
50+
private totalCoeff;
51+
constructor(blobtree: RootNode, smpParams: SplitMaxPolygonizerParams);
52+
setBlobtree(blobtree: RootNode): void;
53+
compute(): import("three").BufferGeometry;
4554
}
46-
type SubPolygonizerParams = SMCParams & {
47-
class: any;
48-
};
49-
type SplitMaxPolygonizerParams = {
50-
/**
51-
* Parameters for the subpolygonizer to use.
52-
* Must contain all parameters for the given subPolygonizer (like detailRatio, etc...)
53-
* The class of the subpolygonizer (default to SlidingMarchingCubes) is in additional parameter class
54-
*/
55-
subPolygonizer?: SubPolygonizerParams | undefined;
56-
/**
57-
* If true, uniform resolution will be used on all primitives, according to the minimum accuracy in the blobtree.
58-
*/
59-
uniformRes?: boolean | undefined;
60-
/**
61-
* Progress callback, taking a percentage as parameter.
62-
*/
63-
progress?: Function | undefined;
64-
/**
65-
* The RicciNode coefficient above which it will be considered like a MaxNode.
66-
*/
67-
ricciThreshold?: number | undefined;
68-
};
69-
type SMCParams = import('./SlidingMarchingCubes').SMCParams;
55+
export {};
7056
//# sourceMappingURL=SplitMaxPolygonizer.d.ts.map

dist/polygonizers/SplitMaxPolygonizer.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)