add orthographic display preference. fixes #31
This commit is contained in:
parent
50d95e6077
commit
3edf74f027
5 changed files with 30 additions and 13 deletions
6
notes.md
6
notes.md
|
|
@ -7,8 +7,8 @@
|
|||
* `P` duplicate objects should share same slice data unless rotated or scaled
|
||||
* `P` allow selection to me decimated on demand (context menu?)
|
||||
* `P` improve decimation speed: omit point conversion or use wasm
|
||||
* `P` client/worker interface normalization
|
||||
* `P` explore widget vertex reloading / replacing (Onshape primarily)
|
||||
* `P` client/worker message interface normalization
|
||||
* `P` explore widget vertex reloading / replacing (Onshape) (issue #48)
|
||||
|
||||
* `F` show slider range values in workspace units (on hover?)
|
||||
* `F` allow select of a range by typing in values in slices or workspace units
|
||||
|
|
@ -73,6 +73,7 @@
|
|||
* `B` climb vs conventional not fully consistent after refactor
|
||||
* `B` outside cutting direction in roughing mode inverted
|
||||
|
||||
* `F` user-selectable origin (issue #28)
|
||||
* `F` import SVG into a path that can be overlaid onto a 3D mesh (laser?)
|
||||
* `F` intelligently turn circle hole pocket clear into spiral down
|
||||
* `F` trace follow hole that matches endmill should turn into a drill op
|
||||
|
|
@ -97,7 +98,6 @@
|
|||
* `F` support lathe mode / A-axis / rotary
|
||||
* `F` gcode output option as zip for multiple or flip ops or tool change
|
||||
* `F` ease-down should be engaged in all descending cutting operations
|
||||
* `F` entirely user-selectable origin
|
||||
* `F` maintain several part orientations + op chains in a single profile
|
||||
|
||||
* `P` common part pre-analyze to speed up 'slice' and improve shadow (overhangs)
|
||||
|
|
|
|||
|
|
@ -658,7 +658,8 @@
|
|||
decimate: true,
|
||||
detail: "good",
|
||||
animesh: "200",
|
||||
healMesh: false
|
||||
healMesh: false,
|
||||
ortho: false
|
||||
},
|
||||
// label state preferences
|
||||
labels: {
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@
|
|||
function booleanSave() {
|
||||
let control = settings().controller;
|
||||
let isDark = control.dark;
|
||||
let doAlert = UI.ortho.checked !== control.ortho;
|
||||
control.decals = UI.decals.checked;
|
||||
control.danger = UI.danger.checked;
|
||||
control.showOrigin = UI.showOrigin.checked;
|
||||
|
|
@ -153,6 +154,7 @@
|
|||
control.exportPreview = UI.exportPreview.checked;
|
||||
control.decimate = UI.decimate.checked;
|
||||
control.healMesh = UI.healMesh.checked;
|
||||
control.ortho = UI.ortho.checked;
|
||||
SPACE.view.setZoom(control.reverseZoom, control.zoomSpeed);
|
||||
// platform.layout();
|
||||
API.conf.save();
|
||||
|
|
@ -168,6 +170,9 @@
|
|||
clearDeviceTexture();
|
||||
}
|
||||
API.event.emit('boolean.update');
|
||||
if (doAlert) {
|
||||
API.show.alert("change requires page refresh");
|
||||
}
|
||||
}
|
||||
|
||||
function updateFPS() {
|
||||
|
|
@ -1396,7 +1401,7 @@
|
|||
SPACE.setSkyColor(controller.dark ? 0 : 0xffffff);
|
||||
SPACE.init(container, function (delta) {
|
||||
if (API.var.layer_max === 0 || !delta) return;
|
||||
if (settings().controller.reverseZoom) delta = -delta;
|
||||
if (controller.reverseZoom) delta = -delta;
|
||||
let same = API.var.layer_hi === API.var.layer_lo;
|
||||
let track = API.var.layer_lo > 0;
|
||||
if (delta > 0) {
|
||||
|
|
@ -1415,7 +1420,7 @@
|
|||
}
|
||||
API.view.update_slider();
|
||||
API.show.slices();
|
||||
});
|
||||
}, controller.ortho);
|
||||
SPACE.platform.onMove(API.conf.save);
|
||||
SPACE.platform.setRound(true);
|
||||
SPACE.useDefaultKeys(API.feature.on_key === undefined || API.feature.on_key_defaults);
|
||||
|
|
@ -1585,6 +1590,7 @@
|
|||
|
||||
lprefs: UC.newGroup(LANG.op_menu, $('prefs-gen1'), {inline: true}),
|
||||
reverseZoom: UC.newBoolean(LANG.op_invr_s, booleanSave, {title:LANG.op_invr_l}),
|
||||
ortho: UC.newBoolean(LANG.op_orth_s, booleanSave, {title:LANG.op_orth_l}),
|
||||
dark: UC.newBoolean(LANG.op_dark_s, booleanSave, {title:LANG.op_dark_l}),
|
||||
decals: UC.newBoolean(LANG.op_decl_s, booleanSave, {title:LANG.op_decl_s}),
|
||||
danger: UC.newBoolean(LANG.op_dang_s, booleanSave, {title:LANG.op_dang_l}),
|
||||
|
|
@ -2356,6 +2362,7 @@
|
|||
UI.autoSave.checked = control.autoSave;
|
||||
UI.decimate.checked = control.decimate;
|
||||
UI.healMesh.checked = control.healMesh;
|
||||
UI.ortho.checked = control.ortho;
|
||||
lineTypeSave();
|
||||
detailSave();
|
||||
updateFPS();
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@
|
|||
camera,
|
||||
renderer,
|
||||
container,
|
||||
raycaster,
|
||||
freezeTo,
|
||||
freeze,
|
||||
isRound = false,
|
||||
|
|
@ -699,9 +700,7 @@
|
|||
}
|
||||
|
||||
function intersect(objects, recurse) {
|
||||
let lookAt = new THREE.Vector3(mouse.x, mouse.y, 0.0).unproject(camera);
|
||||
let ray = new THREE.Raycaster(camera.position, lookAt.sub(camera.position).normalize());
|
||||
return ray.intersectObjects(objects, recurse);
|
||||
return raycaster.intersectObjects(objects, recurse);
|
||||
}
|
||||
|
||||
/** ******************************************************************
|
||||
|
|
@ -809,6 +808,11 @@
|
|||
updateLastAction();
|
||||
let int, vis;
|
||||
|
||||
const mv = new THREE.Vector2();
|
||||
mv.x = ( event.clientX / window.innerWidth ) * 2 - 1;
|
||||
mv.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
|
||||
raycaster.setFromCamera( mv, camera );
|
||||
|
||||
if (viewControl.enabled) {
|
||||
event.preventDefault();
|
||||
let selection = mouseHover ? mouseHover() : null;
|
||||
|
|
@ -854,6 +858,7 @@
|
|||
onEnterKey: onEnterKey,
|
||||
onResize: onResize,
|
||||
update: requestRefresh,
|
||||
raycast: intersect,
|
||||
refresh: refresh,
|
||||
|
||||
showSkyGrid: function(b) {
|
||||
|
|
@ -1025,7 +1030,7 @@
|
|||
return { renderer, camera, platform };
|
||||
},
|
||||
|
||||
init: function(domelement, slider) {
|
||||
init: function(domelement, slider, ortho) {
|
||||
container = domelement;
|
||||
|
||||
WORLD.rotation.x = -PI2;
|
||||
|
|
@ -1038,14 +1043,16 @@
|
|||
antialias: true,
|
||||
preserveDrawingBuffer: true
|
||||
});
|
||||
camera = perspective ?
|
||||
new THREE.PerspectiveCamera(perspective, aspect(), 5, 100000) :
|
||||
new THREE.OrthographicCamera(-100 * aspect(), 100 * aspect(), 100, -100, 0.1, 100000);
|
||||
camera = ortho ?
|
||||
new THREE.OrthographicCamera(-100 * aspect(), 100 * aspect(), 100, -100, 0.1, 100000) :
|
||||
new THREE.PerspectiveCamera(perspective, aspect(), 5, 100000);
|
||||
|
||||
camera.position.set(0, 200, 340);
|
||||
renderer.setSize(width(), height());
|
||||
domelement.appendChild(renderer.domElement);
|
||||
|
||||
raycaster = new THREE.Raycaster();
|
||||
|
||||
viewControl = new MOTO.CTRL(camera, domelement, function (position, moved) {
|
||||
if (platform) {
|
||||
platform.visible = hidePlatformBelow ?
|
||||
|
|
|
|||
|
|
@ -213,6 +213,8 @@ kiri.lang['en-us'] = {
|
|||
op_free_l: ["permit dragable layout","no effect in laser mode"],
|
||||
op_spcr_s: "spacing",
|
||||
op_spcr_l: ["spacing between objects","during auto layout","in workspace units"],
|
||||
op_orth_s: "orthographic",
|
||||
op_orth_l: ["orthographic display","requires page refresh"],
|
||||
op_invr_s: "invert zoom",
|
||||
op_invr_l: ["invert mouse wheel","scroll zoom"],
|
||||
op_save_s: "auto save",
|
||||
|
|
|
|||
Loading…
Reference in a new issue