|
|
@@ -541,9 +541,15 @@ export class Path extends ctrlPolygon{
|
|
|
|
|
|
}
|
|
|
|
|
|
+ reDraw(){
|
|
|
+ this.pauseUpdateEdge = true
|
|
|
+ super.reDraw()
|
|
|
+ this.pauseUpdateEdge = false
|
|
|
+ this.updateEdge()
|
|
|
+ }
|
|
|
|
|
|
updateEdge(){
|
|
|
- if(this.lastUpdatePoints_ && Potree.Common.ifSame(this.lastUpdatePoints_,this.points) && this.halfPathWidth == this.lastHalfPathWidth) return //没变 不更新
|
|
|
+ if(this.pauseUpdateEdge || this.lastUpdatePoints_ && Potree.Common.ifSame(this.lastUpdatePoints_,this.points) && this.halfPathWidth == this.lastHalfPathWidth) return //没变 不更新
|
|
|
//this.edge.geometry = MeshDraw.getExtrudeGeo(edgeExtrudePoints, null, {extrudePath: this.points, openEnded:true, shapeDontClose:true/* , dontSmooth:true, steps: this.points.length-1 */})
|
|
|
//getExtrudeGeo是平滑过的曲线,和设计不一样,且容易翻转,转角有时候细分过少
|
|
|
|
|
|
@@ -622,7 +628,8 @@ export class Path extends ctrlPolygon{
|
|
|
let sideVec //该点两边对应的向量
|
|
|
let uvX
|
|
|
if(i==0 || i==count-1){
|
|
|
- sideVec = new THREE.Vector3().copy(math.getNormal2d({p1: i==0 ? B : O, p2: i==0 ? O : A})).setZ(0).multiplyScalar(this.halfPathWidth) //垂线
|
|
|
+ let nor = math.getNormal2d({p1: i==0 ? B : O, p2: i==0 ? O : A}) || new THREE.Vector3(1,0,0)
|
|
|
+ sideVec = new THREE.Vector3().copy(nor).setZ(0).multiplyScalar(this.halfPathWidth) //垂线
|
|
|
uvX = i==0 ? 0 : 1 //percent of length
|
|
|
}else{
|
|
|
let OA = new THREE.Vector3().subVectors(A,O).setZ(0).normalize() //只保证俯视角度正确。(如果两点有高度差,该段四个点不会在同一平面,看起来有扭转,有的地方会肥大,但从俯视角度看是正确的。)
|
|
|
@@ -630,7 +637,8 @@ export class Path extends ctrlPolygon{
|
|
|
let angle = math.getAngle(OA, OB, 'z')
|
|
|
|
|
|
if(math.closeTo(angle,0,1e-4) || math.closeTo(angle,Math.PI,1e-4) || math.closeTo(angle, -Math.PI,1e-4)){ //这时候直接加两个向量算出的平分线不准,故直接找垂线
|
|
|
- sideVec = new THREE.Vector3().copy(math.getNormal2d({p1: O, p2: A})).setZ(0).multiplyScalar(this.halfPathWidth) //垂线
|
|
|
+ let nor = math.getNormal2d({p1: O, p2: A}) || new THREE.Vector3(1,0,0)
|
|
|
+ sideVec = new THREE.Vector3().copy(nor).setZ(0).multiplyScalar(this.halfPathWidth) //垂线
|
|
|
//console.log('接近0或180',angle, sideVec)
|
|
|
}else{
|
|
|
let midVecLength = this.halfPathWidth / Math.sin(angle/2)
|
|
|
@@ -1264,7 +1272,7 @@ export class Path extends ctrlPolygon{
|
|
|
|
|
|
Path.prototype.cloneMarker = Measure.prototype.cloneMarker
|
|
|
Path.prototype.updateDatasetBelong = Measure.prototype.updateDatasetBelong
|
|
|
-Path.prototype.reDraw = Measure.prototype.reDraw
|
|
|
+//Path.prototype.reDraw = Measure.prototype.reDraw
|
|
|
/*
|
|
|
没有intersect的点的dataset_point怎么赋值
|
|
|
|