|
@@ -11,23 +11,79 @@ const defaultBoxWidth = 16; //navvis: 10
|
|
|
|
|
|
var Clip = {
|
|
var Clip = {
|
|
bus : new THREE.EventDispatcher,
|
|
bus : new THREE.EventDispatcher,
|
|
- selectedDatasets : [],
|
|
|
|
- changeCallback(force){
|
|
|
|
- viewer.controls.setTarget(this.box.position)//绕其旋转
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ init(){
|
|
|
|
+ let {pos,scale,rotation} = this.getBoxPose()
|
|
|
|
+ this.box = new BoxVolume({
|
|
|
|
+ clip:true , lineMat: new THREE.LineDashedMaterial({
|
|
|
|
+ dashSize:0.1,
|
|
|
|
+ gapSize:0.1,
|
|
|
|
+ color:"#fff",
|
|
|
|
+ transparent:true,
|
|
|
|
+ opacity:0.5,
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.box.clipTask = ClipTask['SHOW_INSIDE_Big' ]
|
|
|
|
+ this.box.showBox = true
|
|
|
|
+ this.box.name = "ClipBox";
|
|
|
|
+ this.box.position.copy(pos)
|
|
|
|
+ this.box.scale.copy(scale)
|
|
|
|
+ this.box.rotation.copy(rotation)
|
|
|
|
+ viewer.scene.addVolume(this.box);
|
|
|
|
+
|
|
|
|
|
|
- if(Potree.settings.isOfficial){
|
|
|
|
- let fun = ()=>{
|
|
|
|
- let pointclouds = this.getIntersectPointcloud()
|
|
|
|
- if( Common.getDifferenceSet(pointclouds,this.selectedDatasets).length){
|
|
|
|
- this.selectedDatasets = pointclouds
|
|
|
|
- //console.error('clipSelectedDatasets',selectedDatasets)
|
|
|
|
- this.bus.dispatchEvent({type:'updateSelectedDatasets', selectedDatasets:pointclouds.map(e=>e.dataset_id) })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ viewer.addEventListener('addBaseLine',(e)=>{
|
|
|
|
+ let data = this.getBoxData()
|
|
|
|
+ if(!data.rotByUser){
|
|
|
|
+ data.rotAngle = this.getRotByBaseLine(e.measure)
|
|
|
|
+ this.box.rotation.setZ(data.rotAngle)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ viewer.addEventListener('removeBaseLine',(e)=>{
|
|
|
|
+ let data = this.getBoxData()
|
|
|
|
+ if(!data.rotByUser){
|
|
|
|
+ data.rotAngle = 0
|
|
|
|
+ this.box.rotation.setZ(0)
|
|
}
|
|
}
|
|
- if(force)fun()
|
|
|
|
- else Common.intervalTool.isWaiting('clipSelectedDatasets', fun , 300)
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ getBoxPose(){
|
|
|
|
+ //box底部不变,永远在bound的底部。但top会根据height改变
|
|
|
|
+ let boxData = this.getBoxData()
|
|
|
|
+ let bound = viewer.bound.boundingBox.clone();
|
|
|
|
+ let scale = viewer.bound.boundSize.clone().setZ(boxData.height)
|
|
|
|
+ let pos = viewer.bound.center.clone().setZ(bound.min.z + boxData.height/2)
|
|
|
|
+ let rotation = new THREE.Euler(0,0,boxData.rotAngle)
|
|
|
|
+ scale.setX(scale.x*boxData.scaleXY).setY(scale.y*boxData.scaleXY)
|
|
|
|
+
|
|
|
|
+ return {pos,scale,rotation}
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //暂定为在手动设置旋转之前 , 如果有基准线,使用基准线的旋转角。
|
|
|
|
+ getDefaultData(){
|
|
|
|
+ this.boxData = {
|
|
|
|
+ height : 1, scaleXY:1, //水平缩放比率。1代表和bound相同
|
|
|
|
+ rotAngle:this.getRotByBaseLine(), rotByUser: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getRotByBaseLine(baseLine){
|
|
|
|
+ baseLine = baseLine || viewer.scene.measurements.find(e=>e.isBaseLine && e.points.length == 2) //使基准线在俯视图中水平
|
|
|
|
+
|
|
|
|
+ let yaw = baseLine ? new THREE.Vector2().subVectors(baseLine.points[0], baseLine.points[1]).angle() : 0
|
|
|
|
+ return yaw
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getBoxData(){
|
|
|
|
+ this.boxData || this.getDefaultData()
|
|
|
|
+ return this.boxData
|
|
},
|
|
},
|
|
|
|
|
|
enter:function(){
|
|
enter:function(){
|
|
@@ -39,100 +95,21 @@ var Clip = {
|
|
ifShowMarker : Potree.settings.ifShowMarker,
|
|
ifShowMarker : Potree.settings.ifShowMarker,
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- let pointcloud = this.getPointcloud()
|
|
|
|
- let bound = pointcloud.bound //只选取其中一个数据集的bound,而非整体,是因为担心两个数据集中间有空隙,于是刚好落在没有点云的地方。
|
|
|
|
- let boundSize = bound.getSize(new THREE.Vector3())
|
|
|
|
- let target = this.getTarget(bound.getCenter(new THREE.Vector3())); //navvis的位置xy是用相机位置 this.ViewService.mainView.getCamera().position 我觉得也可以用第一个漫游点的,或者最接近bound中心的漫游点
|
|
|
|
- let scale = new THREE.Vector3(defaultBoxWidth,defaultBoxWidth, boundSize.z)//z和navvis一样
|
|
|
|
-
|
|
|
|
- let eyeDir = viewer.scene.view.direction.clone().setZ(0/* -boundSize.z/3 */).multiplyScalar(-defaultBoxWidth) //为了使所在楼层不变,不修改z
|
|
|
|
-
|
|
|
|
- //let eyeDir = scale.clone().setZ(boundSize.z/3).multiplyScalar(1.3)
|
|
|
|
- let position = new THREE.Vector3().addVectors(target, eyeDir)
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ this.box.visible = true
|
|
|
|
+
|
|
Potree.settings.displayMode = 'showPointCloud'
|
|
Potree.settings.displayMode = 'showPointCloud'
|
|
- viewer.setView({
|
|
|
|
|
|
+ /* viewer.setView({
|
|
position ,
|
|
position ,
|
|
target,
|
|
target,
|
|
duration:300,
|
|
duration:300,
|
|
callback:function(){
|
|
callback:function(){
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ }) */
|
|
//viewer.setControls(viewer.orbitControls);
|
|
//viewer.setControls(viewer.orbitControls);
|
|
viewer.setLimitFar(false)
|
|
viewer.setLimitFar(false)
|
|
- //viewer.setClipState(false) //暂时关闭旧的clipping
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- this.box = new BoxVolume({
|
|
|
|
- clip:true
|
|
|
|
- })
|
|
|
|
- this.box.clipTask = ClipTask['SHOW_INSIDE_Big' /* "SHOW_INSIDE" */]
|
|
|
|
- this.box.showBox = false
|
|
|
|
- this.box.name = "ClipBox";
|
|
|
|
- this.box.position.copy(target)
|
|
|
|
- this.box.scale.copy(scale)
|
|
|
|
- //带动mapBox
|
|
|
|
- this.box.addEventListener('position_changed',e=>{
|
|
|
|
- this.mapBox.center.setX(this.box.position.x)
|
|
|
|
- this.mapBox.center.setY(this.box.position.y)
|
|
|
|
- this.mapBox.updatePoints()
|
|
|
|
- this.changeCallback()
|
|
|
|
- })
|
|
|
|
- this.box.addEventListener('scale_changed',e=>{
|
|
|
|
- var scale = this.box.scale
|
|
|
|
- this.mapBox.updatePoints(scale)
|
|
|
|
- this.changeCallback()
|
|
|
|
- })
|
|
|
|
- this.box.addEventListener('orientation_changed',e=>{
|
|
|
|
- this.mapBox.angle = this.box.rotation.z
|
|
|
|
- this.mapBox.rotateBar.rotation.z = this.mapBox.angle
|
|
|
|
- this.mapBox.updatePoints()
|
|
|
|
- this.changeCallback()
|
|
|
|
- })
|
|
|
|
- viewer.scene.addVolume(this.box);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- {//map
|
|
|
|
- let boxRotateBack = ()=>{//不知道是不是这么写。 因为可能z的旋转不一定都在z
|
|
|
|
- this.box.rotation.x = 0;
|
|
|
|
- this.box.rotation.y = 0;
|
|
|
|
- }
|
|
|
|
- this.mapBox = new mapClipBox(target, scale)
|
|
|
|
- viewer.mapViewer.scene.add(this.mapBox)
|
|
|
|
- //带动box
|
|
|
|
- this.mapBox.addEventListener('repos',e=>{
|
|
|
|
- this.box.position.setX(this.mapBox.center.x)
|
|
|
|
- this.box.position.setY(this.mapBox.center.y)
|
|
|
|
- boxRotateBack()
|
|
|
|
- this.changeCallback()
|
|
|
|
- })
|
|
|
|
- this.mapBox.addEventListener('dragChange',e=>{
|
|
|
|
- var scale = this.mapBox.getScale()
|
|
|
|
- this.box.scale.setX(scale.x)
|
|
|
|
- this.box.scale.setY(scale.y)
|
|
|
|
- this.box.position.setX(this.mapBox.center.x)
|
|
|
|
- this.box.position.setY(this.mapBox.center.y)
|
|
|
|
- boxRotateBack()
|
|
|
|
- this.changeCallback()
|
|
|
|
- })
|
|
|
|
- this.mapBox.addEventListener('rotate',e=>{
|
|
|
|
- this.box.rotation.z = this.mapBox.angle
|
|
|
|
- boxRotateBack()
|
|
|
|
- this.changeCallback()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- //viewer.setClipTask(ClipTask["SHOW_INSIDE"])
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ /*
|
|
Potree.settings.unableNavigate = true
|
|
Potree.settings.unableNavigate = true
|
|
Potree.settings.ifShowMarker = false
|
|
Potree.settings.ifShowMarker = false
|
|
Potree.Utils.updateVisible(viewer.measuringTool.scene, 'clipModel', false)
|
|
Potree.Utils.updateVisible(viewer.measuringTool.scene, 'clipModel', false)
|
|
@@ -140,10 +117,9 @@ var Clip = {
|
|
viewer.inputHandler.toggleSelection(this.box);
|
|
viewer.inputHandler.toggleSelection(this.box);
|
|
viewer.inputHandler.fixSelection = true
|
|
viewer.inputHandler.fixSelection = true
|
|
viewer.transformationTool.frame.material.color.set(Potree.config.clip.color)//navvis 15899953
|
|
viewer.transformationTool.frame.material.color.set(Potree.config.clip.color)//navvis 15899953
|
|
- viewer.setPointStandardMat(true)
|
|
|
|
|
|
+ viewer.setPointStandardMat(true) */
|
|
|
|
|
|
- {
|
|
|
|
- let mapVisi = false
|
|
|
|
|
|
+ {
|
|
this.events = {
|
|
this.events = {
|
|
flyToPos : (e)=>{
|
|
flyToPos : (e)=>{
|
|
let dis = 2
|
|
let dis = 2
|
|
@@ -164,59 +140,18 @@ var Clip = {
|
|
viewer.scene.view.setView({position, duration, target})
|
|
viewer.scene.view.setView({position, duration, target})
|
|
|
|
|
|
},
|
|
},
|
|
- mapVisiChange(e){
|
|
|
|
- mapVisi = e.visible
|
|
|
|
- let delay = 100 //因resize了camera需要时间更新projectionMatrix
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- let boundingBox = Clip.box.boundingBox.clone().applyMatrix4(Clip.box.matrixWorld)
|
|
|
|
- if(mapVisi){//切换地图
|
|
|
|
-
|
|
|
|
- if(viewer.fpVisiDatasets.length == 0){//不会显示任何一个floorplan图,就要就近移动到一个可见数据集里
|
|
|
|
- let clouds = viewer.scene.pointclouds.filter(e=>e.visible)
|
|
|
|
- if(clouds.length == 0)clouds = viewer.scene.pointclouds
|
|
|
|
- let scores = clouds.map((e,i)=>{
|
|
|
|
- return [ -viewer.scene.view.position.distanceToSquared(e.bound2) , i]
|
|
|
|
- })
|
|
|
|
- scores = scores.sort((a,b)=> a[0] - b[0])
|
|
|
|
- let neareast = clouds[scores[0][1]]
|
|
|
|
- viewer.flyToDataset({ pointcloud : neareast, duration:0})
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if(Clip.switchMapCount == 0 || !Potree.Utils.getPos2d(viewer.scene.view.position, viewer.mapViewer.camera, viewer.mapViewer.renderArea, viewer.mapViewer.viewports[0]).inSight
|
|
|
|
- || !Potree.Utils.isInsideFrustum(boundingBox, viewer.mapViewer.camera)){ //要使box框和游标都在屏幕内。因为游标是3d的当前位置,很可能是准备去框住的位置
|
|
|
|
- let bound = boundingBox.clone()
|
|
|
|
- bound.expandByPoint(viewer.scene.view.position)
|
|
|
|
- let size = bound.getSize(new THREE.Vector3)
|
|
|
|
- let center = bound.getCenter(new THREE.Vector3)
|
|
|
|
- let margin = viewer.mainViewport.resolution.clone().multiplyScalar(0.3)
|
|
|
|
- viewer.mapViewer.moveTo(center, size, 100, margin)
|
|
|
|
- }
|
|
|
|
- Clip.switchMapCount++
|
|
|
|
- //关于究竟是focus box还是dataset有点纠结,又或是两个的union。box和数据集可能离得很远,且无法确定当前想选择的数据集,且数据集可能无floorplan, 即使有可能也不展示……
|
|
|
|
- }else{//切换3d
|
|
|
|
- if(!Potree.Utils.isInsideFrustum(boundingBox, viewer.scene.getActiveCamera())){//屏幕上没有box的话
|
|
|
|
- viewer.focusOnObject({boundingBox}, 'boundingBox', 100 )
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },delay)
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
- this.switchMapCount = 0
|
|
|
|
- this.bus.addEventListener('flyToPos',this.events.flyToPos)
|
|
|
|
- viewer.mapViewer.addEventListener('forceVisible',this.events.mapVisiChange)
|
|
|
|
|
|
+
|
|
|
|
+ //this.bus.addEventListener('flyToPos',this.events.flyToPos)
|
|
}
|
|
}
|
|
this.editing = true
|
|
this.editing = true
|
|
-
|
|
|
|
- setTimeout(()=>{this.changeCallback(true)},1)
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
- leave:function(){
|
|
|
|
- viewer.inputHandler.fixSelection = false
|
|
|
|
- viewer.scene.removeVolume(this.box);
|
|
|
|
|
|
+ leave:function(){
|
|
|
|
+ this.box.visible = false
|
|
|
|
|
|
- this.mapBox.dispose()
|
|
|
|
//viewer.setControls(viewer.fpControls);
|
|
//viewer.setControls(viewer.fpControls);
|
|
|
|
|
|
Potree.settings.unableNavigate = false
|
|
Potree.settings.unableNavigate = false
|
|
@@ -228,31 +163,13 @@ var Clip = {
|
|
viewer.setPointStandardMat(false)
|
|
viewer.setPointStandardMat(false)
|
|
//viewer.setClipState(true)
|
|
//viewer.setClipState(true)
|
|
viewer.controls.setTarget(null)
|
|
viewer.controls.setTarget(null)
|
|
- {
|
|
|
|
- this.bus.removeEventListener('flyToPos',this.events.flyToPos)
|
|
|
|
- viewer.mapViewer.removeEventListener('forceVisible',this.events.mapVisiChange)
|
|
|
|
-
|
|
|
|
- this.events = null
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
this.editing = false
|
|
this.editing = false
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- getPointcloud:function(){ //找一个离当前最近的点云,且最好有漫游点
|
|
|
|
- let pointclouds = viewer.scene.pointclouds.filter(e=>e.panos.length>0)
|
|
|
|
- if(pointclouds.length == 0)pointclouds = viewer.scene.pointclouds;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- let result = Common.sortByScore(pointclouds,[],[e=>{
|
|
|
|
- let center = e.bound.getCenter(new THREE.Vector3)
|
|
|
|
- let size = e.bound.getSize(new THREE.Vector3).length() / 2
|
|
|
|
- let posToCenter = viewer.images360.position.distanceTo(center)
|
|
|
|
- return size / posToCenter
|
|
|
|
- }])
|
|
|
|
-
|
|
|
|
- return result[0].item
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
getTarget:function(boundCenter){//box位置。要找一个有点云的地方。方案1相机位置, 方案2接近相机的漫游点, 方案3接近中心的漫游点。选择方案2,因最大概率有点云
|
|
getTarget:function(boundCenter){//box位置。要找一个有点云的地方。方案1相机位置, 方案2接近相机的漫游点, 方案3接近中心的漫游点。选择方案2,因最大概率有点云
|
|
@@ -268,119 +185,9 @@ var Clip = {
|
|
|
|
|
|
return target
|
|
return target
|
|
},
|
|
},
|
|
- /* switchMap:function(state){
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }, */
|
|
|
|
-
|
|
|
|
- download:function( ){
|
|
|
|
-
|
|
|
|
- if(this.getIntersectPointcloud().length == 0){
|
|
|
|
- return null
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- var visiPointclouds = viewer.scene.pointclouds.filter(e=> Potree.Utils.getObjVisiByReason(e, 'datasetSelection'))
|
|
|
|
- let data = {
|
|
|
|
- transformation_matrix: visiPointclouds.map((cloud)=>{
|
|
|
|
- let data = {
|
|
|
|
- id: cloud.dataset_id,
|
|
|
|
- matrix : this.getTransformationMatrix(cloud).elements, //剪裁大框
|
|
|
|
- VisiMatrixes: cloud.material.clipBoxes_in.map(e=>this.getTransformationMatrix(cloud, e.inverse).elements), //若干个可见型小框(虽然现在用不到了,因为普通界面不展示这些剪裁区域)
|
|
|
|
- UnVisiMatrixes: cloud.material.clipBoxes_out.map(e=>this.getTransformationMatrix(cloud, e.inverse).elements), //若干个不可见型小框
|
|
|
|
- modelMatrix:(new THREE.Matrix4).copy(cloud.transformMatrix).transpose().elements
|
|
|
|
- }
|
|
|
|
- return data
|
|
|
|
- }) ,
|
|
|
|
- aabb: "b-0.5 -0.5 -0.5 0.5 0.5 0.5" //剪裁空间( 所有点在乘上这个矩阵后, 还能落在 1 * 1 * 1的box内的点就是所裁剪的
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return data
|
|
|
|
- //https://testlaser.4dkankan.com/indoor/t-ia44BhY/api/pointcloud/crop
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- downloadNoCrop(){//不剪裁 下载整个点云
|
|
|
|
-
|
|
|
|
- var visiPointclouds = viewer.scene.pointclouds.filter(e=> Potree.Utils.getObjVisiByReason(e, 'datasetSelection'))
|
|
|
|
- let data = {
|
|
|
|
- transformation_matrix: visiPointclouds.map((cloud)=>{
|
|
|
|
- let data = {
|
|
|
|
- id: cloud.dataset_id,
|
|
|
|
- matrix : new THREE.Matrix4().elements, //固定值
|
|
|
|
- modelMatrix:(new THREE.Matrix4).copy(cloud.transformMatrix).transpose().elements
|
|
|
|
- }
|
|
|
|
- return data
|
|
|
|
- }) ,
|
|
|
|
- aabb: "b-12742000 -12742000 -12742000 12742000 12742000 12742000" //固定剪裁空间
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- console.log(data)
|
|
|
|
- return data
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- getTransformationMatrix:function(pointcloud, invMatrix) {//剪裁矩阵
|
|
|
|
- var invMatrix = invMatrix || this.box.matrixWorld.clone().invert()
|
|
|
|
- return (new THREE.Matrix4).multiplyMatrices(invMatrix, pointcloud.transformMatrix).transpose()
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /* getIntersectPointcloud(){
|
|
|
|
- var boxBound = new THREE.Box3(
|
|
|
|
- new THREE.Vector3(-0.5,-0.5,-0.5), new THREE.Vector3(0.5,0.5,0.5),
|
|
|
|
- ).applyMatrix4(this.box.matrixWorld) //large boundingbox
|
|
|
|
-
|
|
|
|
- let boxMatrixInverse = new THREE.Matrix4().copy(this.box.matrixWorld).invert();
|
|
|
|
-
|
|
|
|
- let boxPoints = [
|
|
|
|
- new THREE.Vector3(boxBound.min.x, boxBound.min.y,0),
|
|
|
|
- new THREE.Vector3(boxBound.max.x, boxBound.min.y,0),
|
|
|
|
- new THREE.Vector3(boxBound.max.x, boxBound.max.y,0),
|
|
|
|
- new THREE.Vector3(boxBound.min.x, boxBound.max.y,0)
|
|
|
|
- ]
|
|
|
|
-
|
|
|
|
- var intersect = (pointcloud)=>{
|
|
|
|
-
|
|
|
|
- if(!pointcloud.bound.intersectsBox(boxBound))return false
|
|
|
|
- //判断box和点云的tight bound是否相交(因为box可以任意旋转,且实在找不到三维中的立方体相交的函数,所以直接用boxBound)
|
|
|
|
- var points = pointcloud.getUnrotBoundPoint('all')
|
|
|
|
- let rings = math.getPolygonsMixedRings([points.slice(0,4), boxPoints] , true)
|
|
|
|
- //console.log(pointcloud.dataset_id, pointcloud.name, rings.length)
|
|
|
|
- if(rings.length > 1 )return false
|
|
|
|
-
|
|
|
|
- {//再用frustum和数据集的sphere相交试试,能排除一些错误
|
|
|
|
- let a = Potree.Utils.isIntersectBox(points, this.box.matrixWorld)
|
|
|
|
- if(!a){
|
|
|
|
- console.log('没能经过isInsideBox测试')
|
|
|
|
- }
|
|
|
|
- return a
|
|
|
|
- }
|
|
|
|
- return true
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return viewer.scene.pointclouds.filter(e=>intersect(e))
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- } */
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- getIntersectPointcloud(){
|
|
|
|
-
|
|
|
|
- var intersect = (pointcloud)=>{
|
|
|
|
- if(pointcloud.intersectBox(this.box.matrixWorld))return true
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return viewer.scene.pointclouds.filter(e=>intersect(e))
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -388,7 +195,4 @@ var Clip = {
|
|
|
|
|
|
export {Clip}
|
|
export {Clip}
|
|
|
|
|
|
-
|
|
|
|
-/*
|
|
|
|
-裁剪点云时,2D界面显示全部平面图,按楼层切换显示。
|
|
|
|
- */
|
|
|
|
|
|
+
|