add unlocked / single axis scale / sizing. add label action for locking and scale
This commit is contained in:
parent
22eb7eeff1
commit
e8ce2f66d1
4 changed files with 51 additions and 10 deletions
3
notes.md
3
notes.md
|
|
@ -99,8 +99,9 @@
|
||||||
|
|
||||||
* `P` common part pre-analyze to speed up 'slice' and improve shadow (overhangs)
|
* `P` common part pre-analyze to speed up 'slice' and improve shadow (overhangs)
|
||||||
* `P` redo all path route / planning in prepare to account for terrain before camOut
|
* `P` redo all path route / planning in prepare to account for terrain before camOut
|
||||||
* `P` detect render message backlog and pause or warn
|
* `P` detect render message backlog and pause or warn?
|
||||||
* `P` allow faster z movements when contouring (not plunging)
|
* `P` allow faster z movements when contouring (not plunging)
|
||||||
|
* `P` common / faster shadow generator using vertices shared with ledges
|
||||||
|
|
||||||
# Laser
|
# Laser
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1999,9 +1999,17 @@
|
||||||
xv = parseFloat(UI.sizeX.was),
|
xv = parseFloat(UI.sizeX.was),
|
||||||
yv = parseFloat(UI.sizeY.was),
|
yv = parseFloat(UI.sizeY.was),
|
||||||
zv = parseFloat(UI.sizeZ.was),
|
zv = parseFloat(UI.sizeZ.was),
|
||||||
xr = (UI.lockX.checked ? ra : 1),
|
ta = e.target,
|
||||||
yr = (UI.lockY.checked ? ra : 1),
|
xc = UI.lockX.checked,
|
||||||
zr = (UI.lockZ.checked ? ra : 1);
|
yc = UI.lockY.checked,
|
||||||
|
zc = UI.lockZ.checked,
|
||||||
|
xt = ta === UI.sizeX,
|
||||||
|
yt = ta === UI.sizeY,
|
||||||
|
zt = ta === UI.sizeZ,
|
||||||
|
tl = (xt && xc) || (yt && yc) || (zt && zc),
|
||||||
|
xr = ((tl && xc) || (!tl && xt) ? ra : 1),
|
||||||
|
yr = ((tl && yc) || (!tl && yt) ? ra : 1),
|
||||||
|
zr = ((tl && zc) || (!tl && zt) ? ra : 1);
|
||||||
API.selection.scale(xr,yr,zr);
|
API.selection.scale(xr,yr,zr);
|
||||||
UI.sizeX.was = UI.sizeX.value = xv * xr;
|
UI.sizeX.was = UI.sizeX.value = xv * xr;
|
||||||
UI.sizeY.was = UI.sizeY.value = yv * yr;
|
UI.sizeY.was = UI.sizeY.value = yv * yr;
|
||||||
|
|
@ -2015,9 +2023,17 @@
|
||||||
xv = parseFloat(UI.scaleX.was),
|
xv = parseFloat(UI.scaleX.was),
|
||||||
yv = parseFloat(UI.scaleY.was),
|
yv = parseFloat(UI.scaleY.was),
|
||||||
zv = parseFloat(UI.scaleZ.was),
|
zv = parseFloat(UI.scaleZ.was),
|
||||||
xr = (UI.lockX.checked ? ra : 1),
|
ta = e.target,
|
||||||
yr = (UI.lockY.checked ? ra : 1),
|
xc = UI.lockX.checked,
|
||||||
zr = (UI.lockZ.checked ? ra : 1);
|
yc = UI.lockY.checked,
|
||||||
|
zc = UI.lockZ.checked,
|
||||||
|
xt = ta === UI.scaleX,
|
||||||
|
yt = ta === UI.scaleY,
|
||||||
|
zt = ta === UI.scaleZ,
|
||||||
|
tl = (xt && xc) || (yt && yc) || (zt && zc),
|
||||||
|
xr = ((tl && xc) || (!tl && xt) ? ra : 1),
|
||||||
|
yr = ((tl && yc) || (!tl && yt) ? ra : 1),
|
||||||
|
zr = ((tl && zc) || (!tl && zt) ? ra : 1);
|
||||||
API.selection.scale(xr,yr,zr);
|
API.selection.scale(xr,yr,zr);
|
||||||
UI.scaleX.was = UI.scaleX.value = xv * xr;
|
UI.scaleX.was = UI.scaleX.value = xv * xr;
|
||||||
UI.scaleY.was = UI.scaleY.value = yv * yr;
|
UI.scaleY.was = UI.scaleY.value = yv * yr;
|
||||||
|
|
@ -2053,6 +2069,22 @@
|
||||||
$('rot_z'), selectionRotate
|
$('rot_z'), selectionRotate
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$('lab-axis').onclick = () => {
|
||||||
|
UI.lockX.checked =
|
||||||
|
UI.lockY.checked =
|
||||||
|
UI.lockZ.checked = !(
|
||||||
|
UI.lockX.checked ||
|
||||||
|
UI.lockY.checked ||
|
||||||
|
UI.lockZ.checked
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
$('lab-scale').onclick = () => {
|
||||||
|
API.selection.scale(1 / UI.scaleX.was, 1 / UI.scaleY.was, 1 / UI.scaleZ.was);
|
||||||
|
UI.scaleX.value = UI.scaleY.value = UI.scaleZ.value =
|
||||||
|
UI.scaleX.was = UI.scaleY.was = UI.scaleZ.was = 1;
|
||||||
|
};
|
||||||
|
|
||||||
UC.onBlur([
|
UC.onBlur([
|
||||||
UI.toolName,
|
UI.toolName,
|
||||||
UI.toolNum,
|
UI.toolNum,
|
||||||
|
|
|
||||||
|
|
@ -1500,3 +1500,11 @@ th, tr, td, label {
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
margin: 5px 0 5px 0;
|
margin: 5px 0 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#lab-axis, #lab-scale {
|
||||||
|
padding: 0 6px 0 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
#lab-axis:hover, #lab-scale:hover {
|
||||||
|
background-color: rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -222,9 +222,9 @@
|
||||||
<div><input id="scale_z" xsize="8" class="value" value="1"/></div>
|
<div><input id="scale_z" xsize="8" class="value" value="1"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="f-col j-center">
|
<div class="f-col j-center">
|
||||||
<div><label>axis</label></div>
|
<div><label id="lab-axis">axis</label></div>
|
||||||
<div><label>size</label></div>
|
<div><label id="lab-size">size</label></div>
|
||||||
<div><label>scale</label></div>
|
<div><label id="lab-scale">scale</label></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue