Skip to content

Commit

Permalink
support multiple clip regions; cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schuetz committed Jun 6, 2018
1 parent d52ccf4 commit d83f87c
Show file tree
Hide file tree
Showing 7 changed files with 502 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"name": "Launch Program",
"restart": false,
"program": "${workspaceFolder}/src/potree_server.js"
},
}
//,
//{
// "type": "node",
// "request": "launch",
// "name": "Launch Program",
// "restart": false,
// "program": "${workspaceFolder}/src/test.js"
// "program": "${workspaceFolder}/src/test2.js"
//}
]
}
13 changes: 12 additions & 1 deletion src/Plane.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,30 @@
// [1] https://github.com/mrdoob/three.js/blob/dev/src/math/Plane.js
//

let Vector3 = require("./Vector3.js").Vector3;


class Plane{

constructor(normal, distance){
this.normal = normal;
this.normal = (normal !== undefined) ? normal : new Vector3(0, 0, 0);
this.distance = distance;
}

setFromNormalAndCoplanarPoint(normal, point){
this.normal.copy(normal);
this.distance = -point.dot(this.normal);

return this;
}

distanceToPoint(point){
let distance = this.normal.dot(point) + this.distance;
return distance;
}



}

module.exports.Plane = Plane;
2 changes: 1 addition & 1 deletion src/RegionFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ async function traversePointcloud(path){
let isInside = clipRegion.containsPoint(vec);

if(isInside){
outOffset = i * lasRecordLength;
outOffset = insideThis * lasRecordLength;

let ux = (x - boundingBox.min.x) / cloudjs.scale;
let uy = (y - boundingBox.min.y) / cloudjs.scale;
Expand Down
Loading

0 comments on commit d83f87c

Please sign in to comment.