icons for SHELL operation

This commit is contained in:
Val Erastov 2016-10-14 01:15:27 -07:00
parent 49de51bf73
commit 6b348214d9
6 changed files with 58 additions and 2 deletions

View file

@ -20,6 +20,10 @@ export const OperationActions = {
info: 'extrudes 2D sketch'
}),
'SHELL': mergeInfo('SHELL', {
info: 'makes shell using borders'
}),
'BOX': mergeInfo('BOX', {
info: 'creates new object box'
}),

View file

@ -8,7 +8,7 @@ export const craft = {
label: 'craft',
cssIcons: ['magic'],
info: 'set of available craft operations on a solid',
actions: ['PAD', 'CUT']
actions: ['PAD', 'CUT', 'SHELL']
};
export const primitives = {
@ -29,7 +29,7 @@ export const main = {
label: 'start',
cssIcons: ['rocket'],
info: 'common set of actions',
actions: ['PAD', 'CUT', '-', 'INTERSECTION', 'DIFFERENCE', 'UNION', '-', 'PLANE', 'BOX', 'SPHERE', '-',
actions: ['PAD', 'CUT', 'SHELL', '-', 'INTERSECTION', 'DIFFERENCE', 'UNION', '-', 'PLANE', 'BOX', 'SPHERE', '-',
'EditFace', '-', 'DeselectAll', 'RefreshSketches' ]
};

View file

@ -11,6 +11,12 @@ export const PAD = {
info: (p) => 'PAD (' + p + ')'
};
export const SHELL = {
icon: 'img/3d/shell',
label: 'Shell',
info: (p) => 'SHELL (' + p + ')'
};
export const BOX = {
icon: 'img/3d/cube',
label: 'Box',

View file

@ -0,0 +1,46 @@
import {ExtrudeWizard} from './extrude'
import * as workbench from '../workbench'
import * as tk from '../../ui/toolkit.js'
export function ShellWizard(app, face, initParams) {
ExtrudeWizard.call(this, app, face, true, [ShellWizard.DEFAULT_PARAMS, 1, 0, 0]);
}
ShellWizard.prototype = Object.create( ExtrudeWizard.prototype );
ShellWizard.DEFAULT_PARAMS = [50];
ShellWizard.prototype.update = function(d) {
ExtrudeWizard.prototype.update.call(this, d, 1, 0, 0);
};
ExtrudeWizard.prototype.updatePolygons = function() {
this.polygons = workbench.reconstructOutline(this.face.solid.csg, this.face);
};
ShellWizard.prototype.createUI = function(d) {
var ui = this.ui;
ui.box = new tk.Box();
var folder = new tk.Folder("Shell Options");
tk.add(ui.box, folder);
ui.depth = tk.config(new tk.Number("Depth", d), {min : 0});
tk.add(folder, ui.depth);
var onChange = tk.methodRef(this, "synch");
ui.depth.input.on('t-change', onChange);
tk.add(folder, new tk.ButtonRow(["Cancel", "OK"], [tk.methodRef(this, "cancelClick"), tk.methodRef(this, "okClick")]));
};
ShellWizard.prototype.getParams = function() {
return [Number(this.ui.depth.input.val())];
};
ShellWizard.prototype.createRequest = function() {
var params = this.getParams();
return {
type: 'SHELL',
solids : [],
params : {d : params[0]},
protoParams : params
}
};

BIN
web/img/3d/shell32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
web/img/3d/shell96.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB