fix line width override in preview. add more lighting debug
This commit is contained in:
parent
bcea87dbe6
commit
1a7e97462b
6 changed files with 19 additions and 13 deletions
|
|
@ -770,6 +770,7 @@ FDM.prepare = function(widgets, settings, update) {
|
|||
print.render = render.path(output, (progress, layer) => {
|
||||
update(0.5 + progress * 0.5, "render", layer);
|
||||
}, {
|
||||
lineWidth: settings.process.sliceLineWidth,
|
||||
toolMode: settings.pmode === 2,
|
||||
tools: device.extruders,
|
||||
thin: isThin,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ const COLOR = {
|
|||
slicing_opacity: 0.5,
|
||||
sliced_opacity: 0.0,
|
||||
cam_preview: 0x888888,
|
||||
cam_preview_opacity: 0.2,
|
||||
cam_preview_opacity_dark: 0.2,
|
||||
cam_preview_opacity: 0.1,
|
||||
cam_sliced_opacity: 0.2
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@ function preparePreview(callback, scale = 1, offset = 0) {
|
|||
hide.slider(true);
|
||||
|
||||
const isCam = mode.is_cam(), pMode = settings.mode;
|
||||
const isDark = api.space.is_dark();
|
||||
const isBelt = device.bedBelt || false;
|
||||
|
||||
view.set_preview();
|
||||
|
|
@ -272,7 +273,7 @@ function preparePreview(callback, scale = 1, offset = 0) {
|
|||
event.emit('preview.begin', pMode);
|
||||
|
||||
if (isCam) {
|
||||
api.widgets.opacity(COLOR.cam_preview_opacity);
|
||||
api.widgets.opacity(isDark ? COLOR.cam_preview_opacity_dark : COLOR.cam_preview_opacity);
|
||||
api.widgets.each(widget => {
|
||||
widget.setColor(COLOR.cam_preview);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ function path(levels, update, opts = {}) {
|
|||
const arrowSize = arrowAll ? 0.2 : 0.4;
|
||||
const layers = [];
|
||||
const toolMode = opts.toolMode;
|
||||
const lineWidth = opts.lineWidth;
|
||||
|
||||
const moveOpt = {
|
||||
face: moveColor,
|
||||
|
|
@ -125,7 +126,7 @@ function path(levels, update, opts = {}) {
|
|||
toolid = toolid || 0;
|
||||
const array = prints[toolid] = prints[toolid] || [];
|
||||
const tool = tools[toolid] || {};
|
||||
array.width = (tool.extNozzle || 1) / 2;
|
||||
array.width = (lineWidth || tool.extNozzle || 1) / 2;
|
||||
array.push(poly);
|
||||
emits++;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ class Widget {
|
|||
side: THREE.DoubleSide,
|
||||
color: 0xffff00,
|
||||
specular: 0x202020,
|
||||
shininess: 125,
|
||||
shininess: 120,
|
||||
transparent: true,
|
||||
opacity: solid_opacity,
|
||||
clipIntersection: false
|
||||
|
|
|
|||
|
|
@ -280,24 +280,28 @@ gapp.register("moto.space", [], (root, exports) => {
|
|||
switch (mode) {
|
||||
case 0: array = [
|
||||
addLight( x1, y0, z1, intensity * 1.5),
|
||||
addLight( x0, y1, -z1, intensity * 0.7)]; break;
|
||||
addLight( x0, y1, -z1, intensity * 0.7)];
|
||||
break;
|
||||
case 1: array = [
|
||||
addLight( x1, y1, z1, intensity * 2.5),
|
||||
addLight( x0, y1, -z1, intensity * 0.5),
|
||||
addLight( x0, y0, z1, intensity * 2.5, 0xeeeeee),
|
||||
addLight( x1, y0, -z1, intensity * 0.5, 0xeeeeee)]; break;
|
||||
addLight( x1, y0, -z1, intensity * 0.5, 0xeeeeee)];
|
||||
break;
|
||||
case 2: array = [
|
||||
addLight( x1, y1, z1, intensity * 2.5),
|
||||
addLight( x0, y1, -z1, intensity * 0.5),
|
||||
addLight( x0, y0, z1, intensity * 2.5, 0xeeeeee),
|
||||
addLight( x1, y0, -z1, intensity * 0.5, 0xeeeeee),
|
||||
addLight( 0, 0, z2, intensity * 1.2),
|
||||
addLight( 0, 0, -z2, intensity * 0.8)]; break;
|
||||
addLight( 0, 0, -z2, intensity * 0.8)];
|
||||
break;
|
||||
}
|
||||
|
||||
// update tracking cam intensity
|
||||
cameraLight.intensity = intensity;
|
||||
lightInfo.array = array;
|
||||
lightInfo.camera = cameraLight;
|
||||
lightInfo.ambient = skyAmbient;
|
||||
requestRefresh();
|
||||
}
|
||||
|
||||
function updatePlatformPosition() {
|
||||
|
|
@ -1120,10 +1124,8 @@ gapp.register("moto.space", [], (root, exports) => {
|
|||
// camera.updateProjectionMatrix();
|
||||
},
|
||||
|
||||
lightMode: (mode, intensity) => {
|
||||
lightInfo.mode = mode;
|
||||
if (intensity) lightInfo.intensity = intensity;
|
||||
updateLights();
|
||||
lightInfo: () => {
|
||||
setTimeout(updateLights, 0);
|
||||
return lightInfo;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue