diff --git a/src/exporter/DXFExporter.js b/src/exporter/DXFExporter.js index a2cd38c7..9624a428 100644 --- a/src/exporter/DXFExporter.js +++ b/src/exporter/DXFExporter.js @@ -8,14 +8,32 @@ Potree.DXFExporter = class DXFExporter{ - static measurementSection(measurement){ + static measurementPointSection(measurement){ - if(measurement.points.length <= 1){ + let position = measurement.points[0].position; + + if(!position){ return ""; } - - + let dxfSection = `0 +CIRCLE +8 +layer_point +10 +${position.x} +20 +${position.y} +30 +${position.z} +40 +1.0 +`; + + return dxfSection; + } + + static measurementPolylineSection(measurement){ // bit code for polygons/polylines: // https://www.autodesk.com/techpubs/autocad/acad2000/dxf/polyline_dxf_06.htm let geomCode = 8; @@ -24,13 +42,9 @@ Potree.DXFExporter = class DXFExporter{ } let dxfSection = `0 -SECTION -2 -ENTITIES -0 POLYLINE 8 -0 +layer_polyline 62 1 66 @@ -68,16 +82,29 @@ ${point.z} 32 `; + } dxfSection += `0 SEQEND -0 -ENDSEC `; - } return dxfSection; } + static measurementSection(measurement){ + + //if(measurement.points.length <= 1){ + // return ""; + //} + + if(measurement.points.length === 0){ + return ""; + }else if(measurement.points.length === 1){ + return Potree.DXFExporter.measurementPointSection(measurement); + }else if(measurement.points.length >= 2){ + return Potree.DXFExporter.measurementPolylineSection(measurement); + } + } + static toString(measurements){ @@ -136,6 +163,10 @@ ${max.y} ${max.z} 0 ENDSEC +0 +SECTION +2 +ENTITIES `; let dxfBody = ""; diff --git a/src/materials/shaders/pointcloud.vs b/src/materials/shaders/pointcloud.vs index 62260fdd..fcbfda5b 100644 --- a/src/materials/shaders/pointcloud.vs +++ b/src/materials/shaders/pointcloud.vs @@ -446,7 +446,13 @@ void main() { #endif }else{ #if defined clip_highlight_inside - vColor.r += 0.5; + vColor.r += 0.5; + + //vec3 hsv = rgb2hsv(vColor); + //hsv.x = hsv.x - 0.3; + //hsv.z = hsv.z + 0.1; + //vColor = hsv2rgb(hsv); + #endif } #endif diff --git a/src/navigation/OrbitControls.js b/src/navigation/OrbitControls.js index e755d18f..32b26f47 100644 --- a/src/navigation/OrbitControls.js +++ b/src/navigation/OrbitControls.js @@ -54,10 +54,16 @@ Potree.OrbitControls = class OrbitControls extends THREE.EventDispatcher{ if(e.drag.mouse === Potree.MOUSE.LEFT){ this.yawDelta += ndrag.x * this.rotationSpeed; this.pitchDelta += ndrag.y * this.rotationSpeed; + + this.stopTweens(); }else if(e.drag.mouse === Potree.MOUSE.RIGHT){ this.panDelta.x += ndrag.x; this.panDelta.y += ndrag.y; + + this.stopTweens(); } + + }; let drop = e => { @@ -69,7 +75,7 @@ Potree.OrbitControls = class OrbitControls extends THREE.EventDispatcher{ this.radiusDelta += -e.delta * resolvedRadius * 0.1; - //this.radiusDelta -= e.delta; + this.stopTweens(); }; let dblclick = (e) => { @@ -104,9 +110,8 @@ Potree.OrbitControls = class OrbitControls extends THREE.EventDispatcher{ let resolvedRadius = this.scene.view.radius + this.radiusDelta; let newRadius = resolvedRadius / delta; this.radiusDelta = newRadius - resolvedRadius; - - //let newRadius = prevDist * (resolvedRadius / currDist); - //this.radiusDelta = newRadius - resolvedRadius; + + this.stopTweens(); } previousTouch = e; @@ -198,19 +203,15 @@ Potree.OrbitControls = class OrbitControls extends THREE.EventDispatcher{ } } + stopTweens(){ + this.tweens.forEach( e => e.stop() ); + this.tweens = []; + } + update(delta){ let view = this.scene.view; - { // cancel move animations on user input - let changes = [ this.yawDelta, this.pitchDelta, this.radiusDelta, this.panDelta.length() ]; - let changeHappens = changes.some( e => Math.abs(e) > 0.001); - if(changeHappens && this.tweens.length > 0){ - this.tweens.forEach( e => e.stop() ); - this.tweens = []; - } - } - { // apply rotation let progression = Math.min(1, this.fadeFactor * delta); diff --git a/src/viewer/map.js b/src/viewer/map.js index ea6b64ec..de4f1b7b 100644 --- a/src/viewer/map.js +++ b/src/viewer/map.js @@ -652,6 +652,7 @@ Potree.MapView = class{ this.sourcesLabelLayer.getSource().addFeature(feature); } }); + } toggle(){ diff --git a/src/viewer/potree.css b/src/viewer/potree.css index c5539220..3eecdaa9 100644 --- a/src/viewer/potree.css +++ b/src/viewer/potree.css @@ -790,3 +790,8 @@ label:hover{ // outline-radius: 2px; //} + +.ui-slider { + margin-top: 3px; + margin-bottom: 10px; +} \ No newline at end of file diff --git a/src/viewer/sidebar.js b/src/viewer/sidebar.js index 75ffaa39..45424d0e 100644 --- a/src/viewer/sidebar.js +++ b/src/viewer/sidebar.js @@ -577,9 +577,9 @@ function initMeasurementDetails(){ let row = $(`