fix operation representation

This commit is contained in:
Val Erastov 2016-10-17 20:49:40 -07:00
parent b6560e193c
commit 8c05990e8d

View file

@ -3,13 +3,13 @@ import * as math from '../math/math'
export const CUT = { export const CUT = {
icon: 'img/3d/cut', icon: 'img/3d/cut',
label: 'Cut', label: 'Cut',
info: (p) => '(' + math.norm2(p.target) + ')' info: (p) => '(' + r(math.norm2(p.target)) + ')'
}; };
export const PAD = { export const PAD = {
icon: 'img/3d/extrude', icon: 'img/3d/extrude',
label: 'Extrude', label: 'Extrude',
info: (p) => '(' + math.norm2(p.target) + ')' info: (p) => '(' + r(math.norm2(p.target)) + ')'
}; };
export const SHELL = { export const SHELL = {
@ -53,3 +53,7 @@ export const UNION = {
label: 'Union', label: 'Union',
info: (p) => null info: (p) => null
}; };
function r(value) {
return value.toPrecision(4).replace(/\.0$/, '');
}