@equinor/videx-map 1.14.3 → 1.14.4
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/dist/EventHandler.d.ts +21 -21
- package/dist/ExplorationLayer.d.ts +38 -38
- package/dist/FaultlineModule.d.ts +51 -51
- package/dist/FieldModule.d.ts +113 -113
- package/dist/GeoJSONModule/GeoJSONModule.d.ts +47 -47
- package/dist/GeoJSONModule/constants.d.ts +13 -13
- package/dist/GeoJSONModule/index.d.ts +6 -6
- package/dist/GeoJSONModule/interfaces.d.ts +15 -15
- package/dist/GeoJSONModule/labels.d.ts +46 -46
- package/dist/GeoJSONModule/linestring.d.ts +55 -55
- package/dist/GeoJSONModule/multipolygon.d.ts +94 -94
- package/dist/GeoJSONModule/point.d.ts +26 -26
- package/dist/GeoJSONModule/polygon.d.ts +96 -96
- package/dist/GeoJSONModule/shader.d.ts +10 -10
- package/dist/ModuleInterface.d.ts +26 -26
- package/dist/OutlineModule.d.ts +81 -81
- package/dist/ResizeConfigInterface.d.ts +14 -14
- package/dist/WellboreModule.d.ts +126 -126
- package/dist/index.d.ts +8 -8
- package/dist/pixiOverlayInterfaces.d.ts +16 -16
- package/dist/utils/ComparableArray.d.ts +60 -60
- package/dist/utils/LineDictionary.d.ts +89 -89
- package/dist/utils/LineInterpolator.d.ts +84 -84
- package/dist/utils/Log.d.ts +1 -1
- package/dist/utils/Mesh.d.ts +46 -46
- package/dist/utils/PointDictionary.d.ts +58 -58
- package/dist/utils/Radius.d.ts +2 -2
- package/dist/utils/Rect.d.ts +27 -27
- package/dist/utils/TriangleDictionary.d.ts +21 -21
- package/dist/utils/WellboreMesh.d.ts +51 -51
- package/dist/utils/centerOfMass.d.ts +8 -8
- package/dist/utils/fields/Highlighter.d.ts +33 -33
- package/dist/utils/fields/LabelManager.d.ts +62 -62
- package/dist/utils/fields/groupLabels.d.ts +5 -5
- package/dist/utils/fields/preprocessFields.d.ts +29 -29
- package/dist/utils/generateCircle.d.ts +10 -10
- package/dist/utils/linePoint.d.ts +27 -27
- package/dist/utils/lineReducer.d.ts +9 -9
- package/dist/utils/wellbores/AsyncLoop.d.ts +35 -35
- package/dist/utils/wellbores/Colors.d.ts +40 -40
- package/dist/utils/wellbores/Config.d.ts +80 -80
- package/dist/utils/wellbores/DataManager.d.ts +15 -15
- package/dist/utils/wellbores/Highlight.d.ts +18 -18
- package/dist/utils/wellbores/LabelType.d.ts +9 -9
- package/dist/utils/wellbores/Projector.d.ts +20 -20
- package/dist/utils/wellbores/RealtimeWellbore.d.ts +21 -21
- package/dist/utils/wellbores/Shader.d.ts +41 -41
- package/dist/utils/wellbores/data/Group.d.ts +48 -48
- package/dist/utils/wellbores/data/RootData.d.ts +29 -29
- package/dist/utils/wellbores/data/SourceData.d.ts +25 -25
- package/dist/utils/wellbores/data/WellboreData.d.ts +76 -76
- package/dist/utils/wellbores/data/WellboreEventData.d.ts +16 -16
- package/dist/utils/wellbores/data/details/Detail.d.ts +20 -20
- package/dist/utils/wellbores/data/details/DetailOptions.d.ts +7 -7
- package/dist/utils/wellbores/data/details/ShoeDetail.d.ts +14 -14
- package/dist/utils/wellbores/data/details/index.d.ts +11 -11
- package/dist/utils/wellbores/data/index.d.ts +6 -6
- package/dist/utils/wellbores/highlight-helper.d.ts +6 -6
- package/dist/utils/wellbores/intervals.d.ts +15 -15
- package/dist/utils/wellbores/labels/Label.d.ts +39 -39
- package/dist/utils/wellbores/labels/index.d.ts +2 -2
- package/dist/utils/wellbores/labels/label-helper.d.ts +3 -3
- package/dist/utils/wellbores/registries/CallbackRegistry.d.ts +23 -23
- package/dist/utils/wellbores/registries/ColorRegistry.d.ts +22 -22
- package/dist/utils/wellbores/registries/index.d.ts +2 -2
- package/package.json +12 -9
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Class for comparing arrays of numbers. Also supports objects with numeric elements.
|
|
3
|
-
*/
|
|
4
|
-
export default class ComparableArray<T extends object> {
|
|
5
|
-
/**
|
|
6
|
-
* Numbers held by comparable array.
|
|
7
|
-
*/
|
|
8
|
-
numbers: number[];
|
|
9
|
-
/**
|
|
10
|
-
* Function used when selecting key from object.
|
|
11
|
-
*/
|
|
12
|
-
selector: (val: T) => number;
|
|
13
|
-
/**
|
|
14
|
-
* Create a new comparable array.
|
|
15
|
-
* @param objects Objects used to fill array
|
|
16
|
-
* @param sort If true, sort objects before storing
|
|
17
|
-
* @param selector Selector used to get numeric element
|
|
18
|
-
*/
|
|
19
|
-
constructor(objects: T[], sort: boolean, selector: (val: T) => number);
|
|
20
|
-
/**
|
|
21
|
-
* Create a new comparable array.
|
|
22
|
-
* @param numbers Collection of numbers used to fill array
|
|
23
|
-
* @param sort If true, sort objects before storing
|
|
24
|
-
*/
|
|
25
|
-
constructor(numbers: number[], sort: boolean);
|
|
26
|
-
/**
|
|
27
|
-
* Create a new comparable array.
|
|
28
|
-
* @param numbers Collection of numbers used to fill array
|
|
29
|
-
*/
|
|
30
|
-
constructor(numbers: number[]);
|
|
31
|
-
/**
|
|
32
|
-
* Create a new comparable array.
|
|
33
|
-
* @param number Single number in array
|
|
34
|
-
*/
|
|
35
|
-
constructor(number: number);
|
|
36
|
-
/**
|
|
37
|
-
* Compares the array to a collection of objects.
|
|
38
|
-
* @param objects Objects to compare with
|
|
39
|
-
* @param sort If true, sort objects before comparing
|
|
40
|
-
* @returns True if arrays are equal
|
|
41
|
-
*/
|
|
42
|
-
compare(objects: T[], sort?: boolean): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Compares the array to a collection of numbers.
|
|
45
|
-
* @param numbers Collection of numbers to compare with
|
|
46
|
-
* @param sort If true, sort objects before comparing
|
|
47
|
-
* @returns True if arrays are equal
|
|
48
|
-
*/
|
|
49
|
-
compare(numbers: number[], sort?: boolean): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Compares the array to a single number.
|
|
52
|
-
* @param number Single number to compare with
|
|
53
|
-
* @returns True if arrays are equal
|
|
54
|
-
*/
|
|
55
|
-
compare(number: number): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Returns the internal array as a string.
|
|
58
|
-
*/
|
|
59
|
-
toString(): string;
|
|
60
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Class for comparing arrays of numbers. Also supports objects with numeric elements.
|
|
3
|
+
*/
|
|
4
|
+
export default class ComparableArray<T extends object> {
|
|
5
|
+
/**
|
|
6
|
+
* Numbers held by comparable array.
|
|
7
|
+
*/
|
|
8
|
+
numbers: number[];
|
|
9
|
+
/**
|
|
10
|
+
* Function used when selecting key from object.
|
|
11
|
+
*/
|
|
12
|
+
selector: (val: T) => number;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new comparable array.
|
|
15
|
+
* @param objects Objects used to fill array
|
|
16
|
+
* @param sort If true, sort objects before storing
|
|
17
|
+
* @param selector Selector used to get numeric element
|
|
18
|
+
*/
|
|
19
|
+
constructor(objects: T[], sort: boolean, selector: (val: T) => number);
|
|
20
|
+
/**
|
|
21
|
+
* Create a new comparable array.
|
|
22
|
+
* @param numbers Collection of numbers used to fill array
|
|
23
|
+
* @param sort If true, sort objects before storing
|
|
24
|
+
*/
|
|
25
|
+
constructor(numbers: number[], sort: boolean);
|
|
26
|
+
/**
|
|
27
|
+
* Create a new comparable array.
|
|
28
|
+
* @param numbers Collection of numbers used to fill array
|
|
29
|
+
*/
|
|
30
|
+
constructor(numbers: number[]);
|
|
31
|
+
/**
|
|
32
|
+
* Create a new comparable array.
|
|
33
|
+
* @param number Single number in array
|
|
34
|
+
*/
|
|
35
|
+
constructor(number: number);
|
|
36
|
+
/**
|
|
37
|
+
* Compares the array to a collection of objects.
|
|
38
|
+
* @param objects Objects to compare with
|
|
39
|
+
* @param sort If true, sort objects before comparing
|
|
40
|
+
* @returns True if arrays are equal
|
|
41
|
+
*/
|
|
42
|
+
compare(objects: T[], sort?: boolean): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Compares the array to a collection of numbers.
|
|
45
|
+
* @param numbers Collection of numbers to compare with
|
|
46
|
+
* @param sort If true, sort objects before comparing
|
|
47
|
+
* @returns True if arrays are equal
|
|
48
|
+
*/
|
|
49
|
+
compare(numbers: number[], sort?: boolean): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Compares the array to a single number.
|
|
52
|
+
* @param number Single number to compare with
|
|
53
|
+
* @returns True if arrays are equal
|
|
54
|
+
*/
|
|
55
|
+
compare(number: number): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the internal array as a string.
|
|
58
|
+
*/
|
|
59
|
+
toString(): string;
|
|
60
|
+
}
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
-
/** Collection of coordinates defining geometry of a line segment. */
|
|
3
|
-
interface Geometry {
|
|
4
|
-
/** X-component of start position. */
|
|
5
|
-
x1: number;
|
|
6
|
-
/** Y-component of start position. */
|
|
7
|
-
y1: number;
|
|
8
|
-
/** X-component of end position. */
|
|
9
|
-
x2: number;
|
|
10
|
-
/** Y-component of end position. */
|
|
11
|
-
y2: number;
|
|
12
|
-
}
|
|
13
|
-
/** Definition of a single line segment. */
|
|
14
|
-
interface LineSegment {
|
|
15
|
-
/** ID of parent line. */
|
|
16
|
-
lineID: number;
|
|
17
|
-
/** Geometry of line segment. */
|
|
18
|
-
geometry: Geometry;
|
|
19
|
-
}
|
|
20
|
-
interface Line<T> {
|
|
21
|
-
id: number;
|
|
22
|
-
value: T;
|
|
23
|
-
segments: LineSegment[];
|
|
24
|
-
}
|
|
25
|
-
/** Dictionary for segmenting lines and finding closest entries. */
|
|
26
|
-
export default class LineDictionary<T> {
|
|
27
|
-
gridsize: number;
|
|
28
|
-
/** Map with collection of segment IDs. */
|
|
29
|
-
tiles: Map<string, LineSegment[]>;
|
|
30
|
-
/** IDs of lines mapped to values. */
|
|
31
|
-
lineValues: Map<number, Line<T>>;
|
|
32
|
-
/** User provided function to test if a line is active or not */
|
|
33
|
-
testActiveFunction: (value: T) => boolean;
|
|
34
|
-
/** Used to assign lineID */
|
|
35
|
-
private lineSeq;
|
|
36
|
-
/**
|
|
37
|
-
* Constructs a new line dictionary with segmentation based on given decimal.
|
|
38
|
-
* @param decimals Defines size of tiles. For example, decimals = 2, would assign
|
|
39
|
-
* both [12, 23] and [19, 21] to a single tile [10, 20]. Decimals also defines
|
|
40
|
-
* maximum search distance. For decimals equals 2, only lines within 10 units will
|
|
41
|
-
* be returned. (Default: 0)
|
|
42
|
-
*/
|
|
43
|
-
constructor(gridsize?: number, testActive?: (value: T) => boolean);
|
|
44
|
-
/**
|
|
45
|
-
* Maps a line up to a given value
|
|
46
|
-
* @param points Collection of points on line
|
|
47
|
-
* @param value Value to return for line
|
|
48
|
-
* @param id Optionally associate an id with this entry
|
|
49
|
-
*/
|
|
50
|
-
add(points: Vector2[], value: T, id?: number): Line<T>;
|
|
51
|
-
/**
|
|
52
|
-
* Add a line segment to the dictionary by start and end position.
|
|
53
|
-
* @param x1 X-component of start position
|
|
54
|
-
* @param y1 Y-component of start position
|
|
55
|
-
* @param x2 X-component of end position
|
|
56
|
-
* @param y2 Y-component of end position
|
|
57
|
-
* @param lineID ID of the line which the segment should belong to
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
60
|
-
addSegment(x1: number, y1: number, x2: number, y2: number, line: Line<T>): void;
|
|
61
|
-
/**
|
|
62
|
-
* Find the closest line to the given coordinates and return its value.
|
|
63
|
-
* @param target Reference position to evaluate
|
|
64
|
-
* @param maxDist Max distance relative to decimals. Given a decimal value of 2, a maxDist of 1 will return lines within a distance of 0.01 units.
|
|
65
|
-
* @returns Value assigned the line
|
|
66
|
-
*/
|
|
67
|
-
getClosest(target: Vector2, maxDist?: number): T;
|
|
68
|
-
/**
|
|
69
|
-
* Find the closest lines to the given coordinates and return their value.
|
|
70
|
-
* @param target Reference position to evaluate
|
|
71
|
-
* @param epsilon Allowed distance between overlapping segments
|
|
72
|
-
* @param maxDist Maximum distance in grid cells.
|
|
73
|
-
* @param filter Function for filtering points based on minimum
|
|
74
|
-
* @returns Values assigned the lines
|
|
75
|
-
*/
|
|
76
|
-
getAllClosest(target: Vector2, epsilon?: number, maxDist?: number, filter?: (min: T, d: T) => boolean): T[];
|
|
77
|
-
isActive(line: Line<T>): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Get unique line segments within a 3 by 3 grid.
|
|
80
|
-
* @private
|
|
81
|
-
* @param x X position of point
|
|
82
|
-
* @param y Y position of point
|
|
83
|
-
* @returns Collection of segments within boundaries
|
|
84
|
-
*/
|
|
85
|
-
getSegmentsOn3Grid(target: Vector2): Set<LineSegment>;
|
|
86
|
-
/** Clear line dictionary to prepare for new data. */
|
|
87
|
-
clear(filter?: (value: T, id: number) => boolean): void;
|
|
88
|
-
}
|
|
89
|
-
export {};
|
|
1
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
+
/** Collection of coordinates defining geometry of a line segment. */
|
|
3
|
+
interface Geometry {
|
|
4
|
+
/** X-component of start position. */
|
|
5
|
+
x1: number;
|
|
6
|
+
/** Y-component of start position. */
|
|
7
|
+
y1: number;
|
|
8
|
+
/** X-component of end position. */
|
|
9
|
+
x2: number;
|
|
10
|
+
/** Y-component of end position. */
|
|
11
|
+
y2: number;
|
|
12
|
+
}
|
|
13
|
+
/** Definition of a single line segment. */
|
|
14
|
+
interface LineSegment {
|
|
15
|
+
/** ID of parent line. */
|
|
16
|
+
lineID: number;
|
|
17
|
+
/** Geometry of line segment. */
|
|
18
|
+
geometry: Geometry;
|
|
19
|
+
}
|
|
20
|
+
interface Line<T> {
|
|
21
|
+
id: number;
|
|
22
|
+
value: T;
|
|
23
|
+
segments: LineSegment[];
|
|
24
|
+
}
|
|
25
|
+
/** Dictionary for segmenting lines and finding closest entries. */
|
|
26
|
+
export default class LineDictionary<T> {
|
|
27
|
+
gridsize: number;
|
|
28
|
+
/** Map with collection of segment IDs. */
|
|
29
|
+
tiles: Map<string, LineSegment[]>;
|
|
30
|
+
/** IDs of lines mapped to values. */
|
|
31
|
+
lineValues: Map<number, Line<T>>;
|
|
32
|
+
/** User provided function to test if a line is active or not */
|
|
33
|
+
testActiveFunction: (value: T) => boolean;
|
|
34
|
+
/** Used to assign lineID */
|
|
35
|
+
private lineSeq;
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new line dictionary with segmentation based on given decimal.
|
|
38
|
+
* @param decimals Defines size of tiles. For example, decimals = 2, would assign
|
|
39
|
+
* both [12, 23] and [19, 21] to a single tile [10, 20]. Decimals also defines
|
|
40
|
+
* maximum search distance. For decimals equals 2, only lines within 10 units will
|
|
41
|
+
* be returned. (Default: 0)
|
|
42
|
+
*/
|
|
43
|
+
constructor(gridsize?: number, testActive?: (value: T) => boolean);
|
|
44
|
+
/**
|
|
45
|
+
* Maps a line up to a given value
|
|
46
|
+
* @param points Collection of points on line
|
|
47
|
+
* @param value Value to return for line
|
|
48
|
+
* @param id Optionally associate an id with this entry
|
|
49
|
+
*/
|
|
50
|
+
add(points: Vector2[], value: T, id?: number): Line<T>;
|
|
51
|
+
/**
|
|
52
|
+
* Add a line segment to the dictionary by start and end position.
|
|
53
|
+
* @param x1 X-component of start position
|
|
54
|
+
* @param y1 Y-component of start position
|
|
55
|
+
* @param x2 X-component of end position
|
|
56
|
+
* @param y2 Y-component of end position
|
|
57
|
+
* @param lineID ID of the line which the segment should belong to
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
addSegment(x1: number, y1: number, x2: number, y2: number, line: Line<T>): void;
|
|
61
|
+
/**
|
|
62
|
+
* Find the closest line to the given coordinates and return its value.
|
|
63
|
+
* @param target Reference position to evaluate
|
|
64
|
+
* @param maxDist Max distance relative to decimals. Given a decimal value of 2, a maxDist of 1 will return lines within a distance of 0.01 units.
|
|
65
|
+
* @returns Value assigned the line
|
|
66
|
+
*/
|
|
67
|
+
getClosest(target: Vector2, maxDist?: number): T;
|
|
68
|
+
/**
|
|
69
|
+
* Find the closest lines to the given coordinates and return their value.
|
|
70
|
+
* @param target Reference position to evaluate
|
|
71
|
+
* @param epsilon Allowed distance between overlapping segments
|
|
72
|
+
* @param maxDist Maximum distance in grid cells.
|
|
73
|
+
* @param filter Function for filtering points based on minimum
|
|
74
|
+
* @returns Values assigned the lines
|
|
75
|
+
*/
|
|
76
|
+
getAllClosest(target: Vector2, epsilon?: number, maxDist?: number, filter?: (min: T, d: T) => boolean): T[];
|
|
77
|
+
isActive(line: Line<T>): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get unique line segments within a 3 by 3 grid.
|
|
80
|
+
* @private
|
|
81
|
+
* @param x X position of point
|
|
82
|
+
* @param y Y position of point
|
|
83
|
+
* @returns Collection of segments within boundaries
|
|
84
|
+
*/
|
|
85
|
+
getSegmentsOn3Grid(target: Vector2): Set<LineSegment>;
|
|
86
|
+
/** Clear line dictionary to prepare for new data. */
|
|
87
|
+
clear(filter?: (value: T, id: number) => boolean): void;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
-
/** Path used by the interpolator. */
|
|
3
|
-
interface PathPoint {
|
|
4
|
-
/** Point along the line. */
|
|
5
|
-
point: Vector2;
|
|
6
|
-
/** Normalized direction towards next point. */
|
|
7
|
-
direction: Vector2;
|
|
8
|
-
/** Distance to point along line. */
|
|
9
|
-
distance: number;
|
|
10
|
-
/** Relative distance to point along line. */
|
|
11
|
-
relative: number;
|
|
12
|
-
}
|
|
13
|
-
/** Point in returned segment. */
|
|
14
|
-
export interface SegmentPoint {
|
|
15
|
-
/** Point along line. */
|
|
16
|
-
position: Vector2;
|
|
17
|
-
/** Normalized direction towards next point. */
|
|
18
|
-
direction: Vector2;
|
|
19
|
-
/** Distance to point along line. */
|
|
20
|
-
distance: number;
|
|
21
|
-
}
|
|
22
|
-
/** Interpolator for finding points and subsegments on a line defined by a collection of Vector2 or 2D vectors. */
|
|
23
|
-
export declare class LineInterpolator {
|
|
24
|
-
/** Amount of provided points. */
|
|
25
|
-
amount: number;
|
|
26
|
-
/** Length of line. */
|
|
27
|
-
length: number;
|
|
28
|
-
/** True if line is an approximation of a single point. */
|
|
29
|
-
singlePoint: boolean;
|
|
30
|
-
/** Collection of points along line with distances. */
|
|
31
|
-
path: PathPoint[];
|
|
32
|
-
/**
|
|
33
|
-
* Construct line interpolator from a collection of points
|
|
34
|
-
* @param points Collection of points as Vector2
|
|
35
|
-
*/
|
|
36
|
-
constructor(points: Vector2[], radius: number);
|
|
37
|
-
/**
|
|
38
|
-
* Get point at relative position.
|
|
39
|
-
* @param relative Relative position along the line between 0 and 1
|
|
40
|
-
* @returns Point at relative position
|
|
41
|
-
*/
|
|
42
|
-
GetPoint(relative: number): SegmentPoint;
|
|
43
|
-
/**
|
|
44
|
-
* Get section at relative position.
|
|
45
|
-
* @param relativeStart Relative position along the line between 0 and 1
|
|
46
|
-
* @param relativeEnd Relative position along the line between 0 and 1
|
|
47
|
-
* @returns Relative section along the line
|
|
48
|
-
*/
|
|
49
|
-
GetSection(relativeStart: number, relativeEnd: number): SegmentPoint[];
|
|
50
|
-
/**
|
|
51
|
-
* Get closest point below provided relative position along the line.
|
|
52
|
-
* Utilizes divide-and-conquer algorithm to speed up search.
|
|
53
|
-
* @param relative Relative position along the line between 0 and 1
|
|
54
|
-
* @returns Index of closest point below relative
|
|
55
|
-
*/
|
|
56
|
-
GetClosestPointBelow(relative: number): number;
|
|
57
|
-
/**
|
|
58
|
-
* Get point with given distance from the start in world space.
|
|
59
|
-
* @param distance Real distance from the start
|
|
60
|
-
* @returns Point at given distance from start
|
|
61
|
-
*/
|
|
62
|
-
GetPointFromStart(distance: number): SegmentPoint;
|
|
63
|
-
/**
|
|
64
|
-
* Get point with given distance from the end in world space.
|
|
65
|
-
* @param distance Real distance from the end
|
|
66
|
-
* @returns Point at given distance from end
|
|
67
|
-
*/
|
|
68
|
-
GetPointFromEnd(distance: number): SegmentPoint;
|
|
69
|
-
/**
|
|
70
|
-
* Get collection of equally space points with given width in real distance.
|
|
71
|
-
* @param relative Start of range
|
|
72
|
-
* @param width Width of range in real distance
|
|
73
|
-
* @param resolution Amount of points within range
|
|
74
|
-
* @returns Collection of equally spaced points within range
|
|
75
|
-
*/
|
|
76
|
-
GetRangeFromStart(relative: number, width: number, resolution?: number): SegmentPoint[];
|
|
77
|
-
/**
|
|
78
|
-
* Get direction towards next point.
|
|
79
|
-
* @param idx Index of point
|
|
80
|
-
* @returns Direction as vector
|
|
81
|
-
*/
|
|
82
|
-
GetDirection(points: Vector2[], idx: number): Vector2;
|
|
83
|
-
}
|
|
84
|
-
export {};
|
|
1
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
+
/** Path used by the interpolator. */
|
|
3
|
+
interface PathPoint {
|
|
4
|
+
/** Point along the line. */
|
|
5
|
+
point: Vector2;
|
|
6
|
+
/** Normalized direction towards next point. */
|
|
7
|
+
direction: Vector2;
|
|
8
|
+
/** Distance to point along line. */
|
|
9
|
+
distance: number;
|
|
10
|
+
/** Relative distance to point along line. */
|
|
11
|
+
relative: number;
|
|
12
|
+
}
|
|
13
|
+
/** Point in returned segment. */
|
|
14
|
+
export interface SegmentPoint {
|
|
15
|
+
/** Point along line. */
|
|
16
|
+
position: Vector2;
|
|
17
|
+
/** Normalized direction towards next point. */
|
|
18
|
+
direction: Vector2;
|
|
19
|
+
/** Distance to point along line. */
|
|
20
|
+
distance: number;
|
|
21
|
+
}
|
|
22
|
+
/** Interpolator for finding points and subsegments on a line defined by a collection of Vector2 or 2D vectors. */
|
|
23
|
+
export declare class LineInterpolator {
|
|
24
|
+
/** Amount of provided points. */
|
|
25
|
+
amount: number;
|
|
26
|
+
/** Length of line. */
|
|
27
|
+
length: number;
|
|
28
|
+
/** True if line is an approximation of a single point. */
|
|
29
|
+
singlePoint: boolean;
|
|
30
|
+
/** Collection of points along line with distances. */
|
|
31
|
+
path: PathPoint[];
|
|
32
|
+
/**
|
|
33
|
+
* Construct line interpolator from a collection of points
|
|
34
|
+
* @param points Collection of points as Vector2
|
|
35
|
+
*/
|
|
36
|
+
constructor(points: Vector2[], radius: number);
|
|
37
|
+
/**
|
|
38
|
+
* Get point at relative position.
|
|
39
|
+
* @param relative Relative position along the line between 0 and 1
|
|
40
|
+
* @returns Point at relative position
|
|
41
|
+
*/
|
|
42
|
+
GetPoint(relative: number): SegmentPoint;
|
|
43
|
+
/**
|
|
44
|
+
* Get section at relative position.
|
|
45
|
+
* @param relativeStart Relative position along the line between 0 and 1
|
|
46
|
+
* @param relativeEnd Relative position along the line between 0 and 1
|
|
47
|
+
* @returns Relative section along the line
|
|
48
|
+
*/
|
|
49
|
+
GetSection(relativeStart: number, relativeEnd: number): SegmentPoint[];
|
|
50
|
+
/**
|
|
51
|
+
* Get closest point below provided relative position along the line.
|
|
52
|
+
* Utilizes divide-and-conquer algorithm to speed up search.
|
|
53
|
+
* @param relative Relative position along the line between 0 and 1
|
|
54
|
+
* @returns Index of closest point below relative
|
|
55
|
+
*/
|
|
56
|
+
GetClosestPointBelow(relative: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Get point with given distance from the start in world space.
|
|
59
|
+
* @param distance Real distance from the start
|
|
60
|
+
* @returns Point at given distance from start
|
|
61
|
+
*/
|
|
62
|
+
GetPointFromStart(distance: number): SegmentPoint;
|
|
63
|
+
/**
|
|
64
|
+
* Get point with given distance from the end in world space.
|
|
65
|
+
* @param distance Real distance from the end
|
|
66
|
+
* @returns Point at given distance from end
|
|
67
|
+
*/
|
|
68
|
+
GetPointFromEnd(distance: number): SegmentPoint;
|
|
69
|
+
/**
|
|
70
|
+
* Get collection of equally space points with given width in real distance.
|
|
71
|
+
* @param relative Start of range
|
|
72
|
+
* @param width Width of range in real distance
|
|
73
|
+
* @param resolution Amount of points within range
|
|
74
|
+
* @returns Collection of equally spaced points within range
|
|
75
|
+
*/
|
|
76
|
+
GetRangeFromStart(relative: number, width: number, resolution?: number): SegmentPoint[];
|
|
77
|
+
/**
|
|
78
|
+
* Get direction towards next point.
|
|
79
|
+
* @param idx Index of point
|
|
80
|
+
* @returns Direction as vector
|
|
81
|
+
*/
|
|
82
|
+
GetDirection(points: Vector2[], idx: number): Vector2;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
package/dist/utils/Log.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function log(text: string): void;
|
|
1
|
+
export default function log(text: string): void;
|
package/dist/utils/Mesh.d.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
-
import * as PIXI from 'pixi.js';
|
|
3
|
-
import { VectorLike } from '@equinor/videx-linear-algebra';
|
|
4
|
-
import { SegmentPoint } from './LineInterpolator';
|
|
5
|
-
export interface WellboreSegmentData {
|
|
6
|
-
vertices: number[];
|
|
7
|
-
triangles: number[];
|
|
8
|
-
vertexData: number[];
|
|
9
|
-
extraData: number[];
|
|
10
|
-
}
|
|
11
|
-
export interface MeshData {
|
|
12
|
-
vertices: number[];
|
|
13
|
-
triangles: number[];
|
|
14
|
-
}
|
|
15
|
-
export interface MeshNormalData extends MeshData {
|
|
16
|
-
normals: number[];
|
|
17
|
-
}
|
|
18
|
-
export default class Mesh {
|
|
19
|
-
/**
|
|
20
|
-
* Create mesh for a line.
|
|
21
|
-
* @param points Collection of points used to construct mesh
|
|
22
|
-
* @param thickness Thickness of line
|
|
23
|
-
* @param type 0: Normal, 1: Interval, 2: Tick
|
|
24
|
-
* @returns Vertex and triangulation for mesh
|
|
25
|
-
*/
|
|
26
|
-
static WellboreSegment(points: SegmentPoint[], thickness: number, type: number): WellboreSegmentData;
|
|
27
|
-
static SimpleLine: (points: VectorLike[], thickness?: number) => MeshNormalData;
|
|
28
|
-
/**
|
|
29
|
-
* Create mesh for a polygon.
|
|
30
|
-
* @param points Collection of points used to construct mesh
|
|
31
|
-
* @returns Vertex and triangulation for mesh
|
|
32
|
-
*/
|
|
33
|
-
static Polygon: (points: Vector2[]) => MeshData;
|
|
34
|
-
static PolygonOutline: (points: VectorLike[], thickness?: number) => MeshNormalData;
|
|
35
|
-
/**
|
|
36
|
-
* Create a simple pixi mesh from vertices, triangles and shaders. Vertices are named 'inputVerts' in shader.
|
|
37
|
-
* @param vertices Vertices belonging to mesh
|
|
38
|
-
* @param triangles Triangulation of mesh
|
|
39
|
-
* @param vertexShader Vertex shader as string
|
|
40
|
-
* @param fragmentShader Fragment shader as string
|
|
41
|
-
* @param uniforms Collection of uniforms
|
|
42
|
-
* @param normals UV data
|
|
43
|
-
* @returns Created pixi mesh
|
|
44
|
-
*/
|
|
45
|
-
static from(vertices: number[], triangles: number[], vertexShader: string, fragmentShader: string, uniforms?: object, normals?: number[]): PIXI.Mesh;
|
|
46
|
-
}
|
|
1
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
+
import * as PIXI from 'pixi.js';
|
|
3
|
+
import { VectorLike } from '@equinor/videx-linear-algebra';
|
|
4
|
+
import { SegmentPoint } from './LineInterpolator';
|
|
5
|
+
export interface WellboreSegmentData {
|
|
6
|
+
vertices: number[];
|
|
7
|
+
triangles: number[];
|
|
8
|
+
vertexData: number[];
|
|
9
|
+
extraData: number[];
|
|
10
|
+
}
|
|
11
|
+
export interface MeshData {
|
|
12
|
+
vertices: number[];
|
|
13
|
+
triangles: number[];
|
|
14
|
+
}
|
|
15
|
+
export interface MeshNormalData extends MeshData {
|
|
16
|
+
normals: number[];
|
|
17
|
+
}
|
|
18
|
+
export default class Mesh {
|
|
19
|
+
/**
|
|
20
|
+
* Create mesh for a line.
|
|
21
|
+
* @param points Collection of points used to construct mesh
|
|
22
|
+
* @param thickness Thickness of line
|
|
23
|
+
* @param type 0: Normal, 1: Interval, 2: Tick
|
|
24
|
+
* @returns Vertex and triangulation for mesh
|
|
25
|
+
*/
|
|
26
|
+
static WellboreSegment(points: SegmentPoint[], thickness: number, type: number): WellboreSegmentData;
|
|
27
|
+
static SimpleLine: (points: VectorLike[], thickness?: number) => MeshNormalData;
|
|
28
|
+
/**
|
|
29
|
+
* Create mesh for a polygon.
|
|
30
|
+
* @param points Collection of points used to construct mesh
|
|
31
|
+
* @returns Vertex and triangulation for mesh
|
|
32
|
+
*/
|
|
33
|
+
static Polygon: (points: Vector2[]) => MeshData;
|
|
34
|
+
static PolygonOutline: (points: VectorLike[], thickness?: number) => MeshNormalData;
|
|
35
|
+
/**
|
|
36
|
+
* Create a simple pixi mesh from vertices, triangles and shaders. Vertices are named 'inputVerts' in shader.
|
|
37
|
+
* @param vertices Vertices belonging to mesh
|
|
38
|
+
* @param triangles Triangulation of mesh
|
|
39
|
+
* @param vertexShader Vertex shader as string
|
|
40
|
+
* @param fragmentShader Fragment shader as string
|
|
41
|
+
* @param uniforms Collection of uniforms
|
|
42
|
+
* @param normals UV data
|
|
43
|
+
* @returns Created pixi mesh
|
|
44
|
+
*/
|
|
45
|
+
static from(vertices: number[], triangles: number[], vertexShader: string, fragmentShader: string, uniforms?: object, normals?: number[]): PIXI.Mesh;
|
|
46
|
+
}
|