@itwin/core-geometry 4.4.0-dev.3 → 4.4.0-dev.5
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/cjs/topology/Graph.d.ts +19 -9
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +19 -9
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.d.ts +23 -18
- package/lib/cjs/topology/HalfEdgeGraphValidation.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js +23 -18
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.d.ts +17 -10
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +38 -17
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +19 -9
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +19 -9
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.d.ts +23 -18
- package/lib/esm/topology/HalfEdgeGraphValidation.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js +23 -18
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.d.ts +17 -10
- package/lib/esm/topology/HalfEdgeNodeXYZUV.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js +38 -17
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/package.json +5 -5
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
// Search services for HalfEdgeGraph
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
6
|
+
/**
|
|
7
|
+
* HalfEdgePointerInspector has methods to check HalfEdge objects for pointer errors.
|
|
8
|
+
* * For a one-step test of the whole graph.
|
|
8
9
|
*/
|
|
9
10
|
export class HalfEdgePointerInspector {
|
|
10
11
|
constructor() {
|
|
@@ -16,7 +17,7 @@ export class HalfEdgePointerInspector {
|
|
|
16
17
|
this.numTested = 0;
|
|
17
18
|
this.numWithMatchedEdgeMate = 0;
|
|
18
19
|
}
|
|
19
|
-
/** Clear all counts */
|
|
20
|
+
/** Clear all counts. */
|
|
20
21
|
clearCounts() {
|
|
21
22
|
this.numUndefinedEdgeMate = 0;
|
|
22
23
|
this.numUndefinedFP = 0;
|
|
@@ -26,7 +27,7 @@ export class HalfEdgePointerInspector {
|
|
|
26
27
|
this.numWithMatchedEdgeMate = 0;
|
|
27
28
|
this.numTested = 0;
|
|
28
29
|
}
|
|
29
|
-
/** Inspect a single half edge.
|
|
30
|
+
/** Inspect a single half edge. Increment counters according to the half edge's pointers. */
|
|
30
31
|
inspectHalfEdge(he) {
|
|
31
32
|
this.numTested++;
|
|
32
33
|
if (he.facePredecessor === undefined)
|
|
@@ -44,10 +45,11 @@ export class HalfEdgePointerInspector {
|
|
|
44
45
|
else
|
|
45
46
|
this.numMatePairError++;
|
|
46
47
|
}
|
|
47
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Return true if all pointer pairings are correct for a closed half edge graph (with no boundary):
|
|
48
50
|
* * For each he: `he.edgeMate.edgeMate === he`
|
|
49
|
-
* * For each he: `he.faceSuccessor.facePredecessor
|
|
50
|
-
* * For each he: `he.facePredecessor.faceSuccessor
|
|
51
|
+
* * For each he: `he.faceSuccessor.facePredecessor === he`
|
|
52
|
+
* * For each he: `he.facePredecessor.faceSuccessor === he`
|
|
51
53
|
*/
|
|
52
54
|
get isValidClosedHalfEdgeGraph() {
|
|
53
55
|
return this.numWithMatchedEdgeMate === this.numTested
|
|
@@ -56,10 +58,11 @@ export class HalfEdgePointerInspector {
|
|
|
56
58
|
&& this.numFSFPError === 0
|
|
57
59
|
&& this.numMatePairError === 0;
|
|
58
60
|
}
|
|
59
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Return true if all pointer pairings are correct for a half edge graph with possible boundary:
|
|
60
63
|
* * For each he: `he.edgeMate.edgeMate === he`
|
|
61
|
-
* * For each he: `he.faceSuccessor.facePredecessor
|
|
62
|
-
* * For each he: `he.facePredecessor.faceSuccessor
|
|
64
|
+
* * For each he: `he.faceSuccessor.facePredecessor === he`
|
|
65
|
+
* * For each he: `he.facePredecessor.faceSuccessor === he`
|
|
63
66
|
*/
|
|
64
67
|
get isValidHalfEdgeGraphAllowRaggedBoundary() {
|
|
65
68
|
return this.numWithMatchedEdgeMate + this.numUndefinedEdgeMate === this.numTested
|
|
@@ -68,17 +71,19 @@ export class HalfEdgePointerInspector {
|
|
|
68
71
|
&& this.numFSFPError === 0
|
|
69
72
|
&& this.numMatePairError === 0;
|
|
70
73
|
}
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
74
|
+
/**
|
|
75
|
+
* Inspect all half edges of graph.
|
|
76
|
+
* * All pointer counts are left in member vars for later inspection.
|
|
73
77
|
*/
|
|
74
78
|
inspectHalfEdges(graph) {
|
|
75
79
|
this.clearCounts();
|
|
76
80
|
for (const he of graph.allHalfEdges)
|
|
77
81
|
this.inspectHalfEdge(he);
|
|
78
82
|
}
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @
|
|
83
|
+
/**
|
|
84
|
+
* Inspect a graph's pointer properties.
|
|
85
|
+
* @param expectAllMates true for "complete" graph.
|
|
86
|
+
* @returns true if all pointers are valid.
|
|
82
87
|
*/
|
|
83
88
|
static inspectGraph(graph, expectAllMates) {
|
|
84
89
|
const inspector = new HalfEdgePointerInspector();
|
|
@@ -88,13 +93,13 @@ export class HalfEdgePointerInspector {
|
|
|
88
93
|
return inspector.isValidHalfEdgeGraphAllowRaggedBoundary;
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
|
-
/**
|
|
96
|
+
/** Static methods to inspect mask consistency properties in HalfEdgeGraph. */
|
|
92
97
|
export class HalfEdgeMaskValidation {
|
|
93
98
|
/**
|
|
94
99
|
* Test if a mask is used consistently around faces.
|
|
95
|
-
* * At the low level, there is no actual traversal around faces.
|
|
100
|
+
* * At the low level, there is no actual traversal around faces. It is only necessary to verify that the mask
|
|
101
|
+
* matches for each HalfEdge and its faceSuccessor.
|
|
96
102
|
* @returns Return true if mask is "all or nothing around all faces"
|
|
97
|
-
*
|
|
98
103
|
*/
|
|
99
104
|
static isMaskConsistentAroundAllFaces(graph, mask) {
|
|
100
105
|
for (const he of graph.allHalfEdges) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgeGraphValidation.js","sourceRoot":"","sources":["../../../src/topology/HalfEdgeGraphValidation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,oCAAoC;AACpC
|
|
1
|
+
{"version":3,"file":"HalfEdgeGraphValidation.js","sourceRoot":"","sources":["../../../src/topology/HalfEdgeGraphValidation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,oCAAoC;AACpC;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAArC;QACS,yBAAoB,GAAW,CAAC,CAAC;QACjC,mBAAc,GAAW,CAAC,CAAC;QAC3B,mBAAc,GAAW,CAAC,CAAC;QAC3B,iBAAY,GAAW,CAAC,CAAC;QACzB,qBAAgB,GAAW,CAAC,CAAC;QAC7B,cAAS,GAAW,CAAC,CAAC;QACtB,2BAAsB,GAAW,CAAC,CAAC;IA8E5C,CAAC;IA7EC,wBAAwB;IACjB,WAAW;QAChB,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,CAAC,CA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AAK,CAAC;eACzB,IAAI,CAAC,YAAY,KAAK,CAAC;eACvB,IAAI,CAAC,gBAAgB,KAAK,CAAC,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,gBAAgB,CAAC,KAAoB;QAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,YAAY;YACjC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,KAAoB,EAAE,cAAuB;QACtE,MAAM,SAAS,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACjD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,cAAc;YAChB,OAAO,SAAS,CAAC,0BAA0B,CAAC;QAC9C,OAAO,SAAS,CAAC,uCAAuC,CAAC;IAC3D,CAAC;CACF;AACD,8EAA8E;AAC9E,MAAM,OAAO,sBAAsB;IACjC;;;;;OAKG;IACI,MAAM,CAAC,8BAA8B,CAAC,KAAoB,EAAE,IAAkB;QACnF,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,YAAY,EAAE;YACnC,IAAI,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;gBACrD,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Topology\r\n */\r\n// cspell:word FSFP\r\nimport { HalfEdge, HalfEdgeGraph, HalfEdgeMask } from \"./Graph\";\r\n\r\n// Search services for HalfEdgeGraph\r\n/**\r\n * HalfEdgePointerInspector has methods to check HalfEdge objects for pointer errors.\r\n * * For a one-step test of the whole graph.\r\n */\r\nexport class HalfEdgePointerInspector {\r\n public numUndefinedEdgeMate: number = 0;\r\n public numUndefinedFS: number = 0;\r\n public numUndefinedFP: number = 0;\r\n public numFSFPError: number = 0;\r\n public numMatePairError: number = 0;\r\n public numTested: number = 0;\r\n public numWithMatchedEdgeMate: number = 0;\r\n /** Clear all counts. */\r\n public clearCounts() {\r\n this.numUndefinedEdgeMate = 0;\r\n this.numUndefinedFP = 0;\r\n this.numUndefinedFS = 0;\r\n this.numFSFPError = 0;\r\n this.numMatePairError = 0;\r\n this.numWithMatchedEdgeMate = 0;\r\n this.numTested = 0;\r\n }\r\n /** Inspect a single half edge. Increment counters according to the half edge's pointers. */\r\n public inspectHalfEdge(he: HalfEdge) {\r\n this.numTested++;\r\n if (he.facePredecessor === undefined)\r\n this.numUndefinedFP++;\r\n else if (he.facePredecessor.faceSuccessor !== he)\r\n this.numFSFPError++;\r\n\r\n if (he.faceSuccessor === undefined)\r\n this.numUndefinedFS++;\r\n else if (he.faceSuccessor.facePredecessor !== he)\r\n this.numFSFPError++;\r\n\r\n if (he.edgeMate === undefined)\r\n this.numUndefinedEdgeMate++;\r\n else if (he.edgeMate.edgeMate === he)\r\n this.numWithMatchedEdgeMate++;\r\n else\r\n this.numMatePairError++;\r\n }\r\n /**\r\n * Return true if all pointer pairings are correct for a closed half edge graph (with no boundary):\r\n * * For each he: `he.edgeMate.edgeMate === he`\r\n * * For each he: `he.faceSuccessor.facePredecessor === he`\r\n * * For each he: `he.facePredecessor.faceSuccessor === he`\r\n */\r\n public get isValidClosedHalfEdgeGraph(): boolean {\r\n return this.numWithMatchedEdgeMate === this.numTested\r\n && this.numUndefinedFS === 0\r\n && this.numUndefinedFP === 0\r\n && this.numFSFPError === 0\r\n && this.numMatePairError === 0;\r\n }\r\n /**\r\n * Return true if all pointer pairings are correct for a half edge graph with possible boundary:\r\n * * For each he: `he.edgeMate.edgeMate === he`\r\n * * For each he: `he.faceSuccessor.facePredecessor === he`\r\n * * For each he: `he.facePredecessor.faceSuccessor === he`\r\n */\r\n public get isValidHalfEdgeGraphAllowRaggedBoundary(): boolean {\r\n return this.numWithMatchedEdgeMate + this.numUndefinedEdgeMate === this.numTested\r\n && this.numUndefinedFS === 0\r\n && this.numUndefinedFP === 0\r\n && this.numFSFPError === 0\r\n && this.numMatePairError === 0;\r\n }\r\n /**\r\n * Inspect all half edges of graph.\r\n * * All pointer counts are left in member vars for later inspection.\r\n */\r\n public inspectHalfEdges(graph: HalfEdgeGraph) {\r\n this.clearCounts();\r\n for (const he of graph.allHalfEdges)\r\n this.inspectHalfEdge(he);\r\n }\r\n /**\r\n * Inspect a graph's pointer properties.\r\n * @param expectAllMates true for \"complete\" graph.\r\n * @returns true if all pointers are valid.\r\n */\r\n public static inspectGraph(graph: HalfEdgeGraph, expectAllMates: boolean): boolean {\r\n const inspector = new HalfEdgePointerInspector();\r\n inspector.inspectHalfEdges(graph);\r\n if (expectAllMates)\r\n return inspector.isValidClosedHalfEdgeGraph;\r\n return inspector.isValidHalfEdgeGraphAllowRaggedBoundary;\r\n }\r\n}\r\n/** Static methods to inspect mask consistency properties in HalfEdgeGraph. */\r\nexport class HalfEdgeMaskValidation {\r\n /**\r\n * Test if a mask is used consistently around faces.\r\n * * At the low level, there is no actual traversal around faces. It is only necessary to verify that the mask\r\n * matches for each HalfEdge and its faceSuccessor.\r\n * @returns Return true if mask is \"all or nothing around all faces\"\r\n */\r\n public static isMaskConsistentAroundAllFaces(graph: HalfEdgeGraph, mask: HalfEdgeMask): boolean {\r\n for (const he of graph.allHalfEdges) {\r\n if (he.faceSuccessor.getMask(mask) !== he.getMask(mask))\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n"]}
|
|
@@ -16,30 +16,37 @@ export declare class NodeXYZUV {
|
|
|
16
16
|
private _z;
|
|
17
17
|
private _u;
|
|
18
18
|
private _v;
|
|
19
|
+
/** Constructor */
|
|
19
20
|
private constructor();
|
|
20
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Set all content directly from args.
|
|
21
23
|
* @returns `this` reference
|
|
22
24
|
*/
|
|
23
25
|
set(node: HalfEdge, x: number, y: number, z: number, u: number, v: number): NodeXYZUV;
|
|
26
|
+
/** Set from `other` */
|
|
24
27
|
setFrom(other: NodeXYZUV): void;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* *
|
|
28
|
+
/**
|
|
29
|
+
* Create a `NodeXYZUV` with:
|
|
30
|
+
* * node from the given HalfEdge.
|
|
31
|
+
* * x,y,z as the coordinates of `node`.
|
|
32
|
+
* * u as the xy dot product of vectorA with `ray.direction`, where vectorA is the vector from ray origin to
|
|
33
|
+
* `node` coordinates.
|
|
34
|
+
* * v as the xy cross product of `ray.direction` with vectorA.
|
|
28
35
|
*/
|
|
29
36
|
static createNodeAndRayOrigin(node: HalfEdge, ray: Ray3d, result?: NodeXYZUV): NodeXYZUV;
|
|
30
|
-
/** Create a `NodeXYZUV` with explicit node
|
|
37
|
+
/** Create a `NodeXYZUV` with explicit `node`, xyz, uv. */
|
|
31
38
|
static create(node: HalfEdge, x?: number, y?: number, z?: number, u?: number, v?: number): NodeXYZUV;
|
|
32
39
|
/** Access the node. */
|
|
33
40
|
get node(): HalfEdge;
|
|
34
|
-
/** Access the x coordinate */
|
|
41
|
+
/** Access the x coordinate. */
|
|
35
42
|
get x(): number;
|
|
36
|
-
/** Access the y coordinate */
|
|
43
|
+
/** Access the y coordinate. */
|
|
37
44
|
get y(): number;
|
|
38
|
-
/** Access the z coordinate */
|
|
45
|
+
/** Access the z coordinate. */
|
|
39
46
|
get z(): number;
|
|
40
|
-
/** Access the u coordinate */
|
|
47
|
+
/** Access the u coordinate. */
|
|
41
48
|
get u(): number;
|
|
42
|
-
/** Access the v coordinate */
|
|
49
|
+
/** Access the v coordinate. */
|
|
43
50
|
get v(): number;
|
|
44
51
|
/** Access the x,y,z coordinates as Point3d with optional caller-supplied result. */
|
|
45
52
|
getXYZAsPoint3d(result?: Point3d): Point3d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgeNodeXYZUV.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgeNodeXYZUV.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC;;GAEG;AACH;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;
|
|
1
|
+
{"version":3,"file":"HalfEdgeNodeXYZUV.d.ts","sourceRoot":"","sources":["../../../src/topology/HalfEdgeNodeXYZUV.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC;;GAEG;AACH;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IACnB,kBAAkB;IAClB,OAAO;IAQP;;;OAGG;IACI,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,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
|
|
16
17
|
constructor(node, x, y, z, u, v) {
|
|
17
18
|
this._x = x;
|
|
18
19
|
this._y = y;
|
|
@@ -21,7 +22,8 @@ export class NodeXYZUV {
|
|
|
21
22
|
this._v = v;
|
|
22
23
|
this._node = node;
|
|
23
24
|
}
|
|
24
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Set all content directly from args.
|
|
25
27
|
* @returns `this` reference
|
|
26
28
|
*/
|
|
27
29
|
set(node, x, y, z, u, v) {
|
|
@@ -33,6 +35,7 @@ export class NodeXYZUV {
|
|
|
33
35
|
this._node = node;
|
|
34
36
|
return this;
|
|
35
37
|
}
|
|
38
|
+
/** Set from `other` */
|
|
36
39
|
setFrom(other) {
|
|
37
40
|
this._x = other.x;
|
|
38
41
|
this._y = other.y;
|
|
@@ -41,9 +44,13 @@ export class NodeXYZUV {
|
|
|
41
44
|
this._v = other.v;
|
|
42
45
|
this._node = other.node;
|
|
43
46
|
}
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* *
|
|
47
|
+
/**
|
|
48
|
+
* Create a `NodeXYZUV` with:
|
|
49
|
+
* * node from the given HalfEdge.
|
|
50
|
+
* * x,y,z as the coordinates of `node`.
|
|
51
|
+
* * u as the xy dot product of vectorA with `ray.direction`, where vectorA is the vector from ray origin to
|
|
52
|
+
* `node` coordinates.
|
|
53
|
+
* * v as the xy cross product of `ray.direction` with vectorA.
|
|
47
54
|
*/
|
|
48
55
|
static createNodeAndRayOrigin(node, ray, result) {
|
|
49
56
|
const x = node.x;
|
|
@@ -57,28 +64,42 @@ export class NodeXYZUV {
|
|
|
57
64
|
return result.set(node, x, y, z, u, v);
|
|
58
65
|
return new NodeXYZUV(node, x, y, z, u, v);
|
|
59
66
|
}
|
|
60
|
-
/** Create a `NodeXYZUV` with explicit node
|
|
67
|
+
/** Create a `NodeXYZUV` with explicit `node`, xyz, uv. */
|
|
61
68
|
static create(node, x = 0, y = 0, z = 0, u = 0, v = 0) {
|
|
62
69
|
return new NodeXYZUV(node, x, y, z, u, v);
|
|
63
70
|
}
|
|
64
71
|
/** Access the node. */
|
|
65
|
-
get node() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/** Access the
|
|
69
|
-
get
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/** Access the
|
|
73
|
-
get
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
get node() {
|
|
73
|
+
return this._node;
|
|
74
|
+
}
|
|
75
|
+
/** Access the x coordinate. */
|
|
76
|
+
get x() {
|
|
77
|
+
return this._x;
|
|
78
|
+
}
|
|
79
|
+
/** Access the y coordinate. */
|
|
80
|
+
get y() {
|
|
81
|
+
return this._y;
|
|
82
|
+
}
|
|
83
|
+
/** Access the z coordinate. */
|
|
84
|
+
get z() {
|
|
85
|
+
return this._z;
|
|
86
|
+
}
|
|
87
|
+
/** Access the u coordinate. */
|
|
88
|
+
get u() {
|
|
89
|
+
return this._u;
|
|
90
|
+
}
|
|
91
|
+
/** Access the v coordinate. */
|
|
92
|
+
get v() {
|
|
93
|
+
return this._v;
|
|
94
|
+
}
|
|
76
95
|
/** Access the x,y,z coordinates as Point3d with optional caller-supplied result. */
|
|
77
96
|
getXYZAsPoint3d(result) {
|
|
78
97
|
return Point3d.create(this._x, this._y, this._z, result);
|
|
79
98
|
}
|
|
80
99
|
/** Access the uv coordinates as Point2d with optional caller-supplied result. */
|
|
81
|
-
getUVAsPoint2d(result) {
|
|
100
|
+
getUVAsPoint2d(result) {
|
|
101
|
+
return Point2d.create(this._u, this._v, result);
|
|
102
|
+
}
|
|
82
103
|
/** Toleranced comparison function for u coordinate */
|
|
83
104
|
classifyU(target, tol) {
|
|
84
105
|
const delta = this.u - target;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HalfEdgeNodeXYZUV.js","sourceRoot":"","sources":["../../../src/topology/HalfEdgeNodeXYZUV.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,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AI,CAAC,CAAC,GAAG,MAAM,CAAC;QAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;YACxB,OAAO,CAAC,CAAC;QACX,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,sDAAsD;IAC/C,SAAS,CAAC,MAAc,EAAE,GAAW;QAC1C,MAAM,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;YACxB,OAAO,CAAC,CAAC;QACX,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { HalfEdge } from \"./Graph\";\r\n\r\n/** @packageDocumentation\r\n * @module Topology\r\n */\r\n/**\r\n * Reference to a HalfEdge node with extra XYZ and UV data.\r\n * @internal\r\n */\r\nexport class NodeXYZUV {\r\n private _node: HalfEdge;\r\n private _x: number;\r\n private _y: number;\r\n private _z: number;\r\n private _u: number;\r\n private _v: number;\r\n /** Constructor */\r\n private constructor(node: HalfEdge, x: number, y: number, z: number, u: number, v: number) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._u = u;\r\n this._v = v;\r\n this._node = node;\r\n }\r\n /**\r\n * Set all content directly from args.\r\n * @returns `this` reference\r\n */\r\n public set(node: HalfEdge, x: number, y: number, z: number, u: number, v: number): NodeXYZUV {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._u = u;\r\n this._v = v;\r\n this._node = node;\r\n return this;\r\n }\r\n /** Set from `other` */\r\n public setFrom(other: NodeXYZUV): void {\r\n this._x = other.x;\r\n this._y = other.y;\r\n this._z = other.z;\r\n this._u = other.u;\r\n this._v = other.v;\r\n this._node = other.node;\r\n }\r\n /**\r\n * Create a `NodeXYZUV` with:\r\n * * node from the given HalfEdge.\r\n * * x,y,z as the coordinates of `node`.\r\n * * u as the xy dot product of vectorA with `ray.direction`, where vectorA is the vector from ray origin to\r\n * `node` coordinates.\r\n * * v as the xy cross product of `ray.direction` with vectorA.\r\n */\r\n public static createNodeAndRayOrigin(node: HalfEdge, ray: Ray3d, result?: NodeXYZUV): NodeXYZUV {\r\n const x = node.x;\r\n const y = node.y;\r\n const z = node.z;\r\n const dx = x - ray.origin.x;\r\n const dy = y - ray.origin.y;\r\n const u = Geometry.dotProductXYXY(dx, dy, ray.direction.x, ray.direction.y);\r\n const v = Geometry.crossProductXYXY(ray.direction.x, ray.direction.y, dx, dy);\r\n if (result)\r\n return result.set(node, x, y, z, u, v);\r\n return new NodeXYZUV(node, x, y, z, u, v);\r\n }\r\n /** Create a `NodeXYZUV` with explicit `node`, xyz, uv. */\r\n public static create(\r\n node: HalfEdge, x: number = 0, y: number = 0, z: number = 0, u: number = 0, v: number = 0,\r\n ): NodeXYZUV {\r\n return new NodeXYZUV(node, x, y, z, u, v);\r\n }\r\n /** Access the node. */\r\n public get node(): HalfEdge {\r\n return this._node;\r\n }\r\n /** Access the x coordinate. */\r\n public get x(): number {\r\n return this._x;\r\n }\r\n /** Access the y coordinate. */\r\n public get y(): number {\r\n return this._y;\r\n }\r\n /** Access the z coordinate. */\r\n public get z(): number {\r\n return this._z;\r\n }\r\n /** Access the u coordinate. */\r\n public get u(): number {\r\n return this._u;\r\n }\r\n /** Access the v coordinate. */\r\n public get v(): number {\r\n return this._v;\r\n }\r\n /** Access the x,y,z coordinates as Point3d with optional caller-supplied result. */\r\n public getXYZAsPoint3d(result?: Point3d): Point3d {\r\n return Point3d.create(this._x, this._y, this._z, result);\r\n }\r\n /** Access the uv coordinates as Point2d with optional caller-supplied result. */\r\n public getUVAsPoint2d(result?: Point2d): Point2d {\r\n return Point2d.create(this._u, this._v, result);\r\n }\r\n /** Toleranced comparison function for u coordinate */\r\n public classifyU(target: number, tol: number): number {\r\n const delta = this.u - target;\r\n if (Math.abs(delta) <= tol)\r\n return 0;\r\n return delta >= 0 ? 1 : -1;\r\n }\r\n /** Toleranced comparison function for v coordinate */\r\n public classifyV(target: number, tol: number): number {\r\n const delta = target - this._v;\r\n if (Math.abs(delta) <= tol)\r\n return 0;\r\n return delta >= 0 ? 1 : -1;\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-geometry",
|
|
3
|
-
"version": "4.4.0-dev.
|
|
3
|
+
"version": "4.4.0-dev.5",
|
|
4
4
|
"description": "iTwin.js Core Geometry library",
|
|
5
5
|
"main": "lib/cjs/core-geometry.js",
|
|
6
6
|
"module": "lib/esm/core-geometry.js",
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
"@itwin/eslint-plugin": "4.0.0-dev.44",
|
|
27
27
|
"@types/chai": "4.3.1",
|
|
28
28
|
"@types/flatbuffers": "~1.10.0",
|
|
29
|
-
"@types/mocha": "^
|
|
29
|
+
"@types/mocha": "^10.0.6",
|
|
30
30
|
"chai": "^4.3.10",
|
|
31
31
|
"debug": "^2.6.9",
|
|
32
32
|
"eslint": "^8.44.0",
|
|
33
|
-
"mocha": "^10.
|
|
33
|
+
"mocha": "^10.2.0",
|
|
34
34
|
"nyc": "^15.1.0",
|
|
35
35
|
"rimraf": "^3.0.2",
|
|
36
36
|
"typescript": "~5.0.2",
|
|
37
|
-
"@itwin/build-tools": "4.4.0-dev.
|
|
37
|
+
"@itwin/build-tools": "4.4.0-dev.5"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"flatbuffers": "~1.12.0",
|
|
41
|
-
"@itwin/core-bentley": "4.4.0-dev.
|
|
41
|
+
"@itwin/core-bentley": "4.4.0-dev.5"
|
|
42
42
|
},
|
|
43
43
|
"nyc": {
|
|
44
44
|
"extends": "./node_modules/@itwin/build-tools/.nycrc",
|