fix dxf export; fix coordinate editing in Edge; default edl strength 0.4
This commit is contained in:
parent
d9cd3d382f
commit
f0d8b4396e
@ -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 = "";
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -652,6 +652,7 @@ Potree.MapView = class{
|
||||
this.sourcesLabelLayer.getSource().addFeature(feature);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
toggle(){
|
||||
|
||||
@ -790,3 +790,8 @@ label:hover{
|
||||
// outline-radius: 2px;
|
||||
//}
|
||||
|
||||
|
||||
.ui-slider {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
@ -577,9 +577,9 @@ function initMeasurementDetails(){
|
||||
|
||||
let row = $(`
|
||||
<tr>
|
||||
<td>${x}</td>
|
||||
<td>${y}</td>
|
||||
<td>${z}</td>
|
||||
<td><span>${x}</span></td>
|
||||
<td><span>${y}</span></td>
|
||||
<td><span>${z}</span></td>
|
||||
</tr>
|
||||
`);
|
||||
|
||||
@ -1128,7 +1128,7 @@ function initMeasurementDetails(){
|
||||
return !isNaN(Number(input));
|
||||
};
|
||||
|
||||
let cells = coordinatesTable.find("td");
|
||||
let cells = coordinatesTable.find("span");
|
||||
cells.attr("contenteditable", "true");
|
||||
|
||||
cells = cells.toArray();
|
||||
|
||||
@ -523,7 +523,7 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{
|
||||
this.setFOV(60);
|
||||
this.setEDLEnabled(false);
|
||||
this.setEDLRadius(1.4);
|
||||
this.setEDLStrength(1.0);
|
||||
this.setEDLStrength(0.4);
|
||||
this.setClipMode(Potree.ClipMode.HIGHLIGHT_INSIDE);
|
||||
this.setPointBudget(1*1000*1000);
|
||||
this.setShowBoundingBox(false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user