Skip to content

Commit

Permalink
test(potree): Potree1 and Potree2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Oct 4, 2024
1 parent 6b22846 commit 4d591f7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions test/unit/potree.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe('Potree', function () {
const source = new PotreeSource({
file: fileName,
url: baseurl,
crs: 'EPSG:4978',
});

// Configure Point Cloud layer
Expand Down
14 changes: 8 additions & 6 deletions test/unit/potree2.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ describe('Potree2', function () {

before(function () {
renderer = new Renderer();
viewer = new View('EPSG:3946', renderer.domElement, { renderer });
viewer = new View('EPSG:4978', renderer.domElement, { renderer });
viewer.camera.camera3D.position.copy(new Vector3(0, 0, 10));

// Configure Point Cloud layer
const source = new Potree2Source({
file: 'metadata.json',
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
networkOptions: process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {},
crs: 'EPSG:4978',
});
potreeLayer = new Potree2Layer('lion', {
source: new Potree2Source({
file: 'metadata.json',
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
networkOptions: process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {},
}),
source,
crs: viewer.referenceCrs,
});

Expand Down
4 changes: 4 additions & 0 deletions test/unit/potree2layerparsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe('Potree2 Provider', function () {
file: 'metadata.json',
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
networkOptions: process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {},
crs: 'EPSG:4978',
metadata,
});

Expand All @@ -65,6 +66,7 @@ describe('Potree2 Provider', function () {
file: 'metadata.json',
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
networkOptions: process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {},
crs: 'EPSG:4978',
metadata: {
version: '2.0',
name: 'lion',
Expand Down Expand Up @@ -132,6 +134,7 @@ describe('Potree2 Provider', function () {
file: 'metadata.json',
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
networkOptions: process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {},
crs: 'EPSG:4978',
metadata: {
version: '2.0',
name: 'lion',
Expand Down Expand Up @@ -199,6 +202,7 @@ describe('Potree2 Provider', function () {
file: 'metadata.json',
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
networkOptions: process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {},
crs: 'EPSG:4978',
metadata: {
version: '2.0',
name: 'lion',
Expand Down
16 changes: 12 additions & 4 deletions test/unit/potreelayerparsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('Potree Provider', function () {
it('cloud with no normal information', function _it(done) {
// No normals
const cloud = {
boundingBox: { lx: 0, ly: 1, ux: 2, uy: 3 },
boundingBox: { lx: 10, ly: 20, ux: 30, uy: 40 },
tightBoundingBox: { lx: 1, ly: 2, ux: 3, uy: 4 },
scale: 1.0,
pointAttributes: ['POSITION', 'RGB'],
octreeDir: 'data',
Expand All @@ -51,6 +52,7 @@ describe('Potree Provider', function () {
const source = new PotreeSource({
file: fileName,
url: baseurl,
crs: 'EPSG:4978',
cloud,
});

Expand All @@ -66,7 +68,8 @@ describe('Potree Provider', function () {
it('cloud with normals as vector', function _it(done) {
// // // // normals as vector
const cloud = {
boundingBox: { lx: 0, ly: 1, ux: 2, uy: 3 },
boundingBox: { lx: 10, ly: 20, ux: 30, uy: 40 },
tightBoundingBox: { lx: 1, ly: 2, ux: 3, uy: 4 },
scale: 1.0,
pointAttributes: ['POSITION', 'NORMAL', 'CLASSIFICATION'],
octreeDir: 'data',
Expand All @@ -75,6 +78,7 @@ describe('Potree Provider', function () {
const source = new PotreeSource({
file: fileName,
url: baseurl,
crs: 'EPSG:4978',
cloud,
});

Expand All @@ -91,14 +95,16 @@ describe('Potree Provider', function () {
it('cloud with spheremapped normals', function _it(done) {
// // spheremapped normals
const cloud = {
boundingBox: { lx: 0, ly: 1, ux: 2, uy: 3 },
boundingBox: { lx: 10, ly: 20, ux: 30, uy: 40 },
tightBoundingBox: { lx: 1, ly: 2, ux: 3, uy: 4 },
scale: 1.0,
pointAttributes: ['POSITION', 'COLOR_PACKED', 'NORMAL_SPHEREMAPPED'],
octreeDir: 'data',
};
const source = new PotreeSource({
file: fileName,
url: baseurl,
crs: 'EPSG:4978',
cloud,
});
const layer = new PotreeLayer('pointsCloud3', { source, crs: view.referenceCrs });
Expand All @@ -115,14 +121,16 @@ describe('Potree Provider', function () {
it('cloud with oct16 normals', function _it(done) {
// // // oct16 normals
const cloud = {
boundingBox: { lx: 0, ly: 1, ux: 2, uy: 3 },
boundingBox: { lx: 10, ly: 20, ux: 30, uy: 40 },
tightBoundingBox: { lx: 1, ly: 2, ux: 3, uy: 4 },
scale: 1.0,
pointAttributes: ['POSITION', 'COLOR_PACKED', 'CLASSIFICATION', 'NORMAL_OCT16'],
octreeDir: 'data',
};
const source = new PotreeSource({
file: fileName,
url: baseurl,
crs: 'EPSG:4978',
cloud,
});
const layer = new PotreeLayer('pointsCloud4', { source, crs: view.referenceCrs });
Expand Down

0 comments on commit 4d591f7

Please sign in to comment.