|
@@ -6503,11 +6503,11 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
|
|
|
var index = 0
|
|
|
- var addMesh = ({color, path, height,fromDataset, radius=0.08, datasetId=Potree.settings.originDatasetId, spaceDis, tension=0.1, visiEntity}={})=>{//height:在path之上的高度,负数代表在path之下
|
|
|
+ function addMesh({color, path, height,fromDataset, radius=0.08, datasetId=Potree.settings.originDatasetId, tension=0.3, visiEntity}={}){//height:在path之上的高度,负数代表在path之下
|
|
|
var name = 'tube_'+index
|
|
|
-
|
|
|
+ let options = arguments[0]
|
|
|
|
|
|
- let radialSegments = 30//THREE.Math.clamp( Math.round(radius * 800), 10, 40)
|
|
|
+ let radialSegments = THREE.Math.clamp( Math.round(radius * 800), 10, 40)
|
|
|
let radSegments = Math.PI*2 / radialSegments
|
|
|
var circlePts = [];//横截面
|
|
|
for(let i=0;i<radialSegments;i++){
|
|
@@ -6524,27 +6524,27 @@ export class Viewer extends ViewerBase{
|
|
|
pos = Potree.Utils.datasetPosTransform({ fromDataset: true, position:e, datasetId})
|
|
|
}else{
|
|
|
pos = new THREE.Vector3().copy(e)
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
return pos.setZ(pos.z+height)
|
|
|
})
|
|
|
console.log(linePath)
|
|
|
- let geo = MeshDraw.getExtrudeGeo( circlePts, null,{ extrudePath:linePath, tension, spaceDis} )
|
|
|
+ let geo = MeshDraw.getExtrudeGeo( circlePts, null, Object.assign(options, { extrudePath:linePath, tension }) )
|
|
|
var mesh = new THREE.Mesh(geo,mat);
|
|
|
mesh.name = name
|
|
|
window[name] = mesh
|
|
|
-
|
|
|
+
|
|
|
mesh.boundingBox = boundingBox
|
|
|
mesh.matrixAutoUpdate = false
|
|
|
fromDataset || mesh.matrix.copy(viewer.scene.pointclouds[0].transformMatrix)
|
|
|
mesh.matrixWorldNeedsUpdate = true
|
|
|
|
|
|
- this.scene.scene.add(mesh);
|
|
|
+ viewer.scene.scene.add(mesh);
|
|
|
|
|
|
|
|
|
|
|
|
if(visiEntity){
|
|
|
- this.modules.SiteModel.bus.addEventListener('buildingChange',(e)=>{
|
|
|
+ viewer.modules.SiteModel.bus.addEventListener('buildingChange',(e)=>{
|
|
|
Potree.Utils.updateVisible(mesh,'isInEntity', e.entity && e.entity.name == visiEntity)
|
|
|
})
|
|
|
}
|
|
@@ -6566,7 +6566,7 @@ export class Viewer extends ViewerBase{
|
|
|
JSON.stringify(viewer.scene.measurements.find(e=>e.visible).dataset_points.map(e=>Potree.math.toPrecision(e.toArray(),3)))
|
|
|
|
|
|
*/
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
addSprite(e){//api
|
|
|
let sprite
|