[Refactor] Point Cloud Nodes -> homogeneisation#2687
[Refactor] Point Cloud Nodes -> homogeneisation#2687ftoromanoff wants to merge 17 commits intoiTowns:masterfrom
Conversation
6827bb5 to
faf41ae
Compare
7316f52 to
fb2d9ab
Compare
c595be4 to
fb61387
Compare
c595be4 to
fb61387
Compare
Desplandis
left a comment
There was a problem hiding this comment.
Those are my comment for now. As for the tests, I was thinking that you had rewrote them to not depend on external data sources (using sinon)? Or maybe is this in another PR?
Note that when using sinon, you could put all your stub in a sandbox (see https://sinonjs.org/releases/latest/sandbox/), that way we could restore the context and avoid side-effects!
|
|
||
| const red = new THREE.Color(0xff0000); | ||
| // const blue = new THREE.Color(0x0000ff); | ||
| const yellow = new THREE.Color(0xffff00); |
There was a problem hiding this comment.
I implemented an event-driven tool so you'll have difficulty to rebase. However I'm interested in some of the changes here!
| const center = new Coordinates(options.in.crs) | ||
| .setFromVector3(options.in.clampOBB.center); | ||
| const centerZ0 = projZ0(center, source.crs, options.in.crs); | ||
| const quaternion = getQuaternion(centerZ0, source.crs, options.in.crs); | ||
| const quaternionArr = quaternion.toArray(); |
There was a problem hiding this comment.
I don't understand this code. The clampOBB is already in the target coordinates reference system, why should we need to project it again if we need the "center" (at z = 0)? I don't understand why we can't just take the center of the bbox multiplied by the matrix of the OBB? Are we sure that this optimisation gives us more precision?
This comment also applies for the similar code in LASParser & Potree2BinParser.
There was a problem hiding this comment.
There is 2 things:
- We want to use as origin for the parsing, a value at z=0, on the origin crs, to be able to directly have access to the elevation in a point.
- I recompute the center of the OBB, as I consider that a projection add a 'deformation' to space and not only a rotation and transalation. Thus the center of the OBB in the native crs and on the projected crs will not be the same.
If we want to make abstraction of the 'deformation' we can indeed just use
new THREE.Vector3().applyMatrix4(options.in.clampOBB.matrixWorld
as the clampedOBB geometry has already been centered (thus x0 et y0 are at the center) and as we want z to be at 0 as well.
It will simplified the code, should I use it ?
There was a problem hiding this comment.
I did use the simplification
| geometry.boundingBox = new THREE.Box3().fromJSON(parsedData.box); | ||
| geometry.userData.header = parsedData.header; | ||
|
|
||
| const geometry = await parse(data, options, 'parseFile'); |
There was a problem hiding this comment.
I would prefer for typing reasons to have some functions shared by parseFile and parseChunk. One for synthesising the common parameters from options, one for setting the buffer geometry and boundingBoxes, position, quaternion.
There was a problem hiding this comment.
I did change it, Does it correspond more at what you had in mind ? @Desplandis
In this PR, I propose a new organisation of the pointcloudnode test, but I rewrote them in another PR... |
…OT PUSH into MASTER
fb61387 to
4a50dd1
Compare
4a50dd1 to
ccb25af
Compare
ccb25af to
620ae7c
Compare
Light refactorisation of Point Cloud Node and fix.
PointCloudDebug :
PointCloud refactor
refactorisation of Potree and Potree2 and fix for potree
Proposal of a new structure for PointCloudNode test:
The commit with the Potree2 Arene data will be removed, but I let it for test on Potree2 if needed