Skip to content

Commit 196da68

Browse files
committed
CJS => ESM
1 parent cd9b90b commit 196da68

File tree

144 files changed

+7245
-10128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+7245
-10128
lines changed

dist/three-js-blobtree.module.js

Lines changed: 4913 additions & 6459 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/three-js-blobtree.module.js.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: 27 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export = DifferenceNode;
1+
import { Node } from "./Node";
22
/**
33
* @typedef {import('./Element.js')} Element
44
* @typedef {import('./Element.js').Json} Json
@@ -14,62 +14,40 @@ export = DifferenceNode;
1414
* @constructor
1515
* @extends Node
1616
*/
17-
declare class DifferenceNode extends Node {
17+
export declare class DifferenceNode extends Node {
18+
static type: string;
1819
/**
1920
* @param {DifferenceNodeJSON} json
2021
* @returns {DifferenceNode}
2122
*/
22-
static fromJSON(json: DifferenceNodeJSON): DifferenceNode;
23+
static fromJSON(json: any): DifferenceNode;
2324
/**
2425
*
2526
* @param {!Node} node0 The first node
2627
* @param {!Node} node1 The second node, its value will be substracted to the node 0 value.
2728
* @param {number} alpha Power of the second field : the greater alpha the sharper the difference. Default is 1, must be > 1.
2829
*/
29-
constructor(node0: Node, node1: Node, alpha: number);
30-
/** @type {number} */
31-
alpha: number;
32-
/**
33-
* For now, this field value is clamped to 0
34-
* @type {number}
35-
*/
36-
clamped: number;
37-
/** @type {{v:number, g:THREE.Vector3, m:Material}} */
38-
tmp_res0: {
39-
v: number;
40-
g: THREE.Vector3;
41-
m: Material;
42-
};
43-
/** @type {{v:number, g:THREE.Vector3, m:Material}} */
44-
tmp_res1: {
45-
v: number;
46-
g: THREE.Vector3;
47-
m: Material;
48-
};
49-
/** @type {THREE.Vector3} */
50-
g0: THREE.Vector3;
51-
/** @type {Material} */
52-
m0: Material;
53-
/** @type {THREE.Vector3} */
54-
g1: THREE.Vector3;
55-
/** @type {Material} */
56-
m1: Material;
57-
/** @type {Float32Array} */
58-
tmp_v_arr: Float32Array;
59-
/** @type {Array<Material|null>} */
60-
tmp_m_arr: Array<Material | null>;
30+
constructor(node0: any, node1: any, alpha: any);
6131
/**
6232
* @returns {number}
6333
*/
64-
getAlpha(): number;
34+
getAlpha(): any;
6535
/**
6636
* @param {number} alpha
6737
*/
68-
setAlpha(alpha: number): void;
38+
setAlpha(alpha: any): void;
6939
/**
7040
* @returns {DifferenceNodeJSON}
7141
*/
72-
toJSON(): DifferenceNodeJSON;
42+
toJSON(): {
43+
alpha: any;
44+
children: never[];
45+
type: string;
46+
};
47+
/**
48+
* @link Node.prepareForEval for a complete description
49+
**/
50+
prepareForEval(): void;
7351
/**
7452
* Compute the value and/or gradient and/or material
7553
* of the element at position p in space. return computations in res (see below)
@@ -83,24 +61,16 @@ declare class DifferenceNode extends Node {
8361
* @param {number=} res.step The next step we can safely walk without missing the iso (0). Mostly used for convergence function or ray marching.
8462
* @param {number=} res.stepOrtho
8563
*/
86-
value(p: THREE.Vector3, res: {
87-
v: number;
88-
m: Material;
89-
g: THREE.Vector3;
90-
step?: number | undefined;
91-
stepOrtho?: number | undefined;
92-
}): void;
93-
}
94-
declare namespace DifferenceNode {
95-
export { Element, Json, NodeJSON, DifferenceNodeJSON };
64+
value(p: any, res: any): void;
65+
/**
66+
* @link Element.trim for a complete description.
67+
*
68+
* Trim must be redefined for DifferenceNode since in this node we cannot trim one of the 2 nodes without trimming the other.
69+
*
70+
* @param {THREE.Box3} aabb
71+
* @param {Array.<Element>} trimmed
72+
* @param {Array.<Node>} parents
73+
*/
74+
trim(aabb: any, trimmed: any, parents: any): void;
9675
}
97-
import Node = require("./Node.js");
98-
import THREE = require("three");
99-
import Material = require("./Material.js");
100-
type Element = import('./Element.js');
101-
type Json = import('./Element.js').Json;
102-
type NodeJSON = import('./Node.js').NodeJSON;
103-
type DifferenceNodeJSON = {
104-
alpha: number;
105-
} & NodeJSON;
10676
//# sourceMappingURL=DifferenceNode.d.ts.map

dist/types/blobtree/DifferenceNode.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.

dist/types/blobtree/Element.d.ts

Lines changed: 18 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
export = Element;
21
/**
32
* A superclass for Node and Primitive in the blobtree.
43
* @class
54
* @constructor
65
*/
7-
declare class Element {
6+
export declare class Element {
87
static type: string;
98
/**
109
* @param {ElementJSON} _json
1110
*/
12-
static fromJSON(_json: ElementJSON): void;
13-
id: number;
14-
aabb: THREE.Box3;
15-
valid_aabb: boolean;
16-
/** @type {Node} */
17-
parentNode: Node;
11+
static fromJSON(_json: any): void;
12+
constructor();
1813
/**
1914
* Return a Javscript Object respecting JSON convention.
2015
* All classes must defined it.
2116
* @return {ElementJSON}
2217
*/
23-
toJSON(): ElementJSON;
18+
toJSON(): {
19+
type: string;
20+
};
2421
/**
2522
* Clone the object.
2623
* @return {Element}
2724
*/
28-
clone(): Element;
25+
clone(): any;
2926
/**
3027
* @return {Node} The parent node of this primitive.
3128
*/
32-
getParentNode(): Node;
29+
getParentNode(): any;
3330
/**
3431
* @return {string} Type of the element
3532
*/
@@ -39,7 +36,7 @@ declare class Element {
3936
* especially on calls to value.
4037
* @protected
4138
*/
42-
protected computeHelpVariables(): void;
39+
computeHelpVariables(): void;
4340
/**
4441
* @abstract
4542
* Compute the Axis Aligned Bounding Box (AABB) for the current primitive.
@@ -52,12 +49,12 @@ declare class Element {
5249
* isValidAABB before to ensure the current AABB does correspond to the primitive
5350
* settings.
5451
*/
55-
getAABB(): THREE.Box3;
52+
getAABB(): any;
5653
/**
5754
* @return {boolean} True if the current aabb is valid, ie it does
5855
* correspond to the internal primitive parameters.
5956
*/
60-
isValidAABB(): boolean;
57+
isValidAABB(): any;
6158
/**
6259
* Invalid the bounding boxes recursively up to the root
6360
*/
@@ -82,13 +79,13 @@ declare class Element {
8279
* @param {THREE.Vector3} _p Point where we want to evaluate the primitive field
8380
* @param {ValueResultType} _res
8481
*/
85-
value(_p: THREE.Vector3, _res: ValueResultType): void;
82+
value(_p: any, _res: any): void;
8683
/**
8784
* @param {THREE.Vector3} p The point where we want the numerical gradient
8885
* @param {THREE.Vector3} res The resulting gradient
8986
* @param {number} epsilon The step value for the numerical evaluation
9087
*/
91-
numericalGradient: (p: THREE.Vector3, res: THREE.Vector3, epsilon: number) => void;
88+
numericalGradient: (p: any, res: any, epsilon: any) => void;
9289
/**
9390
* @abstract
9491
* Get the Area object.
@@ -97,24 +94,20 @@ declare class Element {
9794
* capture the feature nicely, etc etc...).
9895
* @returns {Array.<{aabb: THREE.Box3, bv:Area, obj:Primitive}>} The Areas object corresponding to the node/primitive, in an array
9996
*/
100-
getAreas(): Array<{
101-
aabb: THREE.Box3;
102-
bv: Area;
103-
obj: Primitive;
104-
}>;
97+
getAreas(): never[];
10598
/**
10699
* @abstract
107100
* This function is called when a point is outside of the potential influence of a primitive/node.
108101
* @param {THREE.Vector3} _p
109102
* @return {number} The next step length to do with respect to this primitive/node
110103
*/
111-
distanceTo(_p: THREE.Vector3): number;
104+
distanceTo(_p: any): void;
112105
/**
113106
* @abstract
114107
* This function is called when a point is within the potential influence of a primitive/node.
115108
* @return {number} The next step length to do with respect to this primitive/node.
116109
*/
117-
heuristicStepWithin(): number;
110+
heuristicStepWithin(): void;
118111
/**
119112
* Trim the tree to keep only nodes influencing a given bounding box.
120113
* The tree must be prepared for eval for this process to be working.
@@ -125,51 +118,13 @@ declare class Element {
125118
* @param {Array.<Element>} _trimmed Array of trimmed Elements
126119
* @param {Array.<Node>} _parents Array of fathers from which each trimmed element has been removed.
127120
*/
128-
trim(_aabb: THREE.Box3, _trimmed: Array<Element>, _parents: Array<Node>): void;
121+
trim(_aabb: any, _trimmed: any, _parents: any): void;
129122
/**
130123
* count the number of elements of class cls in this node and subnodes
131124
* @param {Function} _cls the class of the elements we want to count
132125
* @return {number} The number of element of class cls
133126
*/
134-
count(_cls: Function): number;
127+
count(_cls: any): number;
135128
destroy(): void;
136129
}
137-
declare namespace Element {
138-
export { Material, Node, Primitive, Json, Area, ElementJSON, ValueResultType };
139-
}
140-
import THREE = require("three");
141-
type Node = import('./Node.js');
142-
type Material = import('./Material.js');
143-
type Primitive = import('./Primitive');
144-
type Json = any;
145-
type Area = import('./areas/Area');
146-
type ElementJSON = {
147-
type: string;
148-
};
149-
/**
150-
* Computed values will be stored here. Each values should exist and
151-
* be allocated already.
152-
*/
153-
type ValueResultType = {
154-
/**
155-
* Value, must be defined
156-
*/
157-
v: number;
158-
/**
159-
* Material, must be allocated and defined if wanted
160-
*/
161-
m?: Material | undefined;
162-
/**
163-
* Gradient, must be allocated and defined if wanted
164-
*/
165-
g?: THREE.Vector3 | undefined;
166-
/**
167-
* ??? Not sure, probably a "safe" step for raymarching
168-
*/
169-
step?: number | undefined;
170-
/**
171-
* ??? Same as step but in orthogonal direction ?
172-
*/
173-
stepOrtho?: number | undefined;
174-
};
175130
//# sourceMappingURL=Element.d.ts.map

dist/types/blobtree/Element.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)