Skip to content

Commit

Permalink
Cleanup. Update golden spec files.
Browse files Browse the repository at this point in the history
  • Loading branch information
javagl committed Nov 7, 2023
1 parent ab27a46 commit 76ca304
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 77 deletions.
24 changes: 12 additions & 12 deletions specs/data/createTilesetJson/golden/batchedColors.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"root": {
"boundingVolume": {
"box": [
1215021.7983257836,
-4736318.68538002,
4081598.138913876,
99.7920150756836,
0,
0,
0,
-80.52151489257812,
0,
0,
0,
72.69114303588867
1215017.1239874638,
-4736316.080057698,
4081603.1264158455,
-1.2755385681689153,
4.9722508120558055,
-4.3138044394725314,
23.12108928345635,
-52.382444478338165,
-67.21456600138885,
-82.75933184818228,
-27.40170140970006,
-7.11330633281961
]
},
"geometricError": 512,
Expand Down
24 changes: 12 additions & 12 deletions specs/data/createTilesetJson/golden/compositeOfComposite.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"root": {
"boundingVolume": {
"box": [
1215015.9515952666,
-4736316.7498844,
4081604.643510364,
105.63874559267424,
0,
0,
0,
-85.88219007663429,
0,
0,
0,
79.19573952420615
1215015.740633026,
-4736317.709331602,
4081606.5029129568,
91.34493746005317,
25.73468456069652,
2.891651051729513,
-3.4712154541846187,
13.441215114981711,
-9.969208596733905,
-17.541319642226654,
53.4750698059166,
78.20677126109172
]
},
"geometricError": 512,
Expand Down
24 changes: 12 additions & 12 deletions specs/data/createTilesetJson/golden/instancedOrientation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"root": {
"boundingVolume": {
"box": [
1215013.369315262,
-4736318.923572363,
4081608.292171861,
105.34341248765122,
0,
0,
0,
-84.88524048496038,
0,
0,
0,
77.50599225633778
1215013.9553057784,
-4736317.401766716,
4081608.2583208485,
94.07233924993119,
23.409417534178772,
-0.09196835302048761,
3.2299425139499625,
-12.935366781680294,
11.295689722145568,
15.006058393340421,
-60.592329156800474,
-73.67878617799873
]
},
"geometricError": 512,
Expand Down
29 changes: 29 additions & 0 deletions specs/data/createTilesetJson/golden/plane-ds-p-n-32x32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4096,
"root": {
"boundingVolume": {
"box": [
0.5,
-0.5,
0.02373488247394555,
0.5,
0,
0,
0,
0.5,
0,
0,
0,
0.12459570169448853
]
},
"geometricError": 512,
"content": {
"uri": "plane-ds-p-n-32x32.glb"
},
"refine": "ADD"
}
}
20 changes: 10 additions & 10 deletions specs/data/createTilesetJson/golden/pointCloudQuantized.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"root": {
"boundingVolume": {
"box": [
1215012.8828113787,
1215012.8828113785,
-4736313.051275888,
4081605.221184125,
3.29686427093111,
0,
0,
0,
-4.033112077508122,
0,
0,
0,
3.5222400242928416
-0.47557162645481443,
1.8539892637377,
-1.6084590904482619,
0.39970621248826527,
-1.5579853508384909,
-1.9139915123575475,
-2.421716515841628,
-0.6212415655677035,
-0.000046958296472575216
]
},
"geometricError": 512,
Expand Down
22 changes: 11 additions & 11 deletions specs/data/createTilesetJson/golden/pointCloudRGB.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
"boundingVolume": {
"box": [
1215012.8828876738,
-4736313.051199594,
4081605.22126042,
3.2968313694000244,
0,
0,
0,
-4.033046722412109,
0,
0,
0,
3.522307872772217
-4736313.051199592,
4081605.2212604196,
-0.3996615097143036,
1.557944050844271,
1.9139178584858318,
-0.4755807147866653,
1.8538890346388044,
-1.608390185218802,
-2.4215894236642006,
-0.6212136606916396,
2.19486466616894e-8
]
},
"geometricError": 512,
Expand Down
2 changes: 1 addition & 1 deletion specs/tilesetProcessing/TilesetJsonCreatorSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const goldenDir = "./specs/data/createTilesetJson/golden/";

describe("TilesetJsonCreator", function () {
afterEach(function () {
//SpecHelpers.forceDeleteDirectory(targetDir);
SpecHelpers.forceDeleteDirectory(targetDir);
});

it("creates correct tileset JSON for batchedColors", async function () {
Expand Down
2 changes: 1 addition & 1 deletion specs/tilesetProcessing/TilesetMergerSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const overwrite = true;

describe("TilesetMerger", function () {
afterEach(function () {
//SpecHelpers.forceDeleteDirectory("./specs/data/output/mergeTilesets");
SpecHelpers.forceDeleteDirectory("./specs/data/output/mergeTilesets");
});

it("merges tilesets into a single tileset", async function () {
Expand Down
19 changes: 1 addition & 18 deletions src/tilesetProcessing/OrientedBoundingBoxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,16 @@ export class OrientedBoundingBoxes {
* @returns The bounding volume box
*/
static fromPoints(points: number[][]): number[] {
//return OrientedBoundingBoxes.fromPointsCesium(points);
return OrientedBoundingBoxes.fromPointsDitoTs(points);
}

/**
* Implementation of 'fromPoints' based on CesiumJS
*
* @param points - The points, as 3-element arrays
* @returns The bounding volume box
*/
static fromPointsCesium(points: number[][]): number[] {
const positions = points.map(
(p: number[]) => new Cartesian3(p[0], p[1], p[2])
);
const obb = OrientedBoundingBox.fromPoints(positions, undefined);
const result = Array<number>(12);
OrientedBoundingBox.pack(obb, result, 0);
return result;
}

/**
* Implementation of 'fromPoints' based on dito.ts
*
* @param points - The points, as 3-element arrays
* @returns The bounding volume box
*/
static fromPointsDitoTs(points: number[][]): number[] {
private static fromPointsDitoTs(points: number[][]): number[] {
const attribute = {
data: points.flat(),
size: 3,
Expand Down

0 comments on commit 76ca304

Please sign in to comment.