diff --git a/web/app/sketcher/actions/constraintActions.js b/web/app/sketcher/actions/constraintActions.js index 30f43c75..a6b867e8 100644 --- a/web/app/sketcher/actions/constraintActions.js +++ b/web/app/sketcher/actions/constraintActions.js @@ -12,7 +12,8 @@ export default [ { id: 'Coincident', - shortName: 'Coincident Constraint', + shortName: 'Coincident', + kind: 'Constraint', description: 'Point Coincident', selectionMatcher: { selector: 'matchAll', @@ -35,7 +36,8 @@ export default [ { id: 'Tangent', - shortName: 'Tangent Constraint', + shortName: 'Tangent', + kind: 'Constraint', description: 'Tangent Between Line And Circle', selectionMatcher: { selector: 'matchSequence', @@ -66,7 +68,8 @@ export default [ { id: 'EqualRadius', - shortName: 'Equal Radius Constraint', + shortName: 'Equal Radius', + kind: 'Constraint', description: 'Equal Radius Between Two Circle', selectionMatcher: { selector: 'matchAll', @@ -89,7 +92,8 @@ export default [ { id: 'EqualLength', - shortName: 'Equal Length Constraint', + shortName: 'Equal Length', + kind: 'Constraint', description: 'Equal Length Between Two Segments', selectionMatcher: { selector: 'matchAll', @@ -109,7 +113,8 @@ export default [ { id: 'PointOnLine', - shortName: 'Point On Line Constraint', + shortName: 'Point On Line', + kind: 'Constraint', description: 'Point On Line', selectionMatcher: { selector: 'matchSequence', @@ -135,7 +140,8 @@ export default [ { id: 'Angle', - shortName: 'Angle Constraint', + shortName: 'Angle', + kind: 'Constraint', description: 'Angle', selectionMatcher: { selector: 'matchAll', @@ -163,7 +169,8 @@ export default [ { id: 'Vertical', - shortName: 'Vertical Constraint', + shortName: 'Vertical', + kind: 'Constraint', description: 'Vertical', selectionMatcher: { @@ -187,7 +194,8 @@ export default [ { id: 'Horizontal', - shortName: 'Horizontal Constraint', + shortName: 'Horizontal', + kind: 'Constraint', description: 'Horizontal', selectionMatcher: { @@ -211,7 +219,8 @@ export default [ { id: 'AngleBetween', - shortName: 'Angle Between Constraint', + shortName: 'Angle Between', + kind: 'Constraint', description: 'Angle Between Lines', selectionMatcher: { @@ -242,7 +251,8 @@ export default [ { id: 'Perpendicular', - shortName: 'Perpendicular Constraint', + shortName: 'Perpendicular', + kind: 'Constraint', description: 'Perpendicularity between two or more lines', selectionMatcher: { @@ -267,7 +277,8 @@ export default [ { id: 'Parallel', - shortName: 'Parallel Constraint', + shortName: 'Parallel', + kind: 'Constraint', description: 'Parallelism between two or more lines', selectionMatcher: { @@ -292,7 +303,8 @@ export default [ { id: 'Length', - shortName: 'Length Constraint', + shortName: 'Length', + kind: 'Constraint', description: 'Segment Length', selectionMatcher: { @@ -322,7 +334,8 @@ export default [ { id: 'RadiusLength', - shortName: 'Radius Length Constraint', + shortName: 'Radius Length', + kind: 'Constraint', description: 'Radius Length', selectionMatcher: { @@ -352,7 +365,8 @@ export default [ { id: 'DistancePL', - shortName: 'Point to Line Distance Constraint', + shortName: 'Point to Line Distance', + kind: 'Constraint', description: 'Distance between Point and Line', selectionMatcher: { @@ -387,7 +401,8 @@ export default [ { id: 'DistancePP', - shortName: 'Two Point Distance Constraint', + shortName: 'Two Point Distance', + kind: 'Constraint', description: 'Distance between two Points', selectionMatcher: { @@ -417,7 +432,8 @@ export default [ { id: 'Lock', - shortName: 'Lock Point Constraint', + shortName: 'Lock Point', + kind: 'Constraint', description: 'Lock Point', selectionMatcher: { selector: 'matchSequence', @@ -442,7 +458,8 @@ export default [ { id: 'Fillet', - shortName: 'Fillet Tool', + shortName: 'Fillet', + kind: 'Tool', description: 'Add a Fillet', selectionMatcher: { selector: 'function', diff --git a/web/app/sketcher/actions/index.js b/web/app/sketcher/actions/index.js index 0bdb33bb..3b4b1bd2 100644 --- a/web/app/sketcher/actions/index.js +++ b/web/app/sketcher/actions/index.js @@ -36,7 +36,7 @@ export function runActionOrToastWhyNot(actionId, selection, ctx) { if (matched) { action.invoke(ctx, matched) } else { - toast('The action "' + action.shortName + '" requires selection of ' + getDescription(action.selectionMatcher)); + toast('The action "' + action.shortName + ' ' + action.kind + '" requires selection of ' + getDescription(action.selectionMatcher)); } } matchAvailableActions(selection).forEach(a => { diff --git a/web/app/sketcher/constr/polynomial.js b/web/app/sketcher/constr/polynomial.js index 5adc2333..6bf86286 100644 --- a/web/app/sketcher/constr/polynomial.js +++ b/web/app/sketcher/constr/polynomial.js @@ -189,7 +189,7 @@ export class Polynomial { } out += m.terms.map(t => { - let out = 'X' + t.param.id; + let out = t.param.debugSymbol + t.param.id; if (t.fn.degree === 1) { } else if (t.fn.degree !== Infinity) { diff --git a/web/app/sketcher/shapes/arc.js b/web/app/sketcher/shapes/arc.js index dcb59024..79a55da4 100644 --- a/web/app/sketcher/shapes/arc.js +++ b/web/app/sketcher/shapes/arc.js @@ -19,12 +19,12 @@ export class Arc extends SketchObject { c.parent = this; this.children.push(a, b, c); - this.r = new Param(MIN_RADIUS + 0.001); + this.r = new Param(MIN_RADIUS + 0.001, 'R'); this.r.constraints = [greaterThanConstraint(MIN_RADIUS)]; this.r.min = MIN_RADIUS; - this.ang1 = new Param(0); - this.ang2 = new Param(0); + this.ang1 = new Param(0, 'A'); + this.ang2 = new Param(0, 'A'); this.syncGeometry(); } diff --git a/web/app/sketcher/shapes/circle.js b/web/app/sketcher/shapes/circle.js index db20aa46..e4b23a4d 100644 --- a/web/app/sketcher/shapes/circle.js +++ b/web/app/sketcher/shapes/circle.js @@ -12,7 +12,7 @@ export class Circle extends SketchObject { this.c = c; c.parent = this; this.children.push(c); - this.r = new Param(MIN_RADIUS + 0.001); + this.r = new Param(MIN_RADIUS + 0.001, 'R'); this.r.constraints = [greaterThanConstraint(MIN_RADIUS)]; this.r.min = MIN_RADIUS; } diff --git a/web/app/sketcher/shapes/param.js b/web/app/sketcher/shapes/param.js index 5727cb50..befe913d 100644 --- a/web/app/sketcher/shapes/param.js +++ b/web/app/sketcher/shapes/param.js @@ -3,10 +3,11 @@ import {Param as SolverParam} from '../constr/solver'; export class Param { - constructor(value) { + constructor(value, debugSymbol) { this.id = Generator.genID(); this.value = value; this.solverParam = new SolverParam(value, this); + this.debugSymbol = debugSymbol || 'X'; } set(value) { diff --git a/web/app/sketcher/shapes/point.js b/web/app/sketcher/shapes/point.js index f6c331e7..ba840292 100644 --- a/web/app/sketcher/shapes/point.js +++ b/web/app/sketcher/shapes/point.js @@ -12,8 +12,8 @@ export class EndPoint extends SketchObject { super(); this.parent = null; this.params = { - x: new Param(x), - y: new Param(y) + x: new Param(x, 'X'), + y: new Param(y, 'Y') }; } diff --git a/web/app/sketcher/shapes/segment.js b/web/app/sketcher/shapes/segment.js index 6d0f6f3b..c9551dfd 100644 --- a/web/app/sketcher/shapes/segment.js +++ b/web/app/sketcher/shapes/segment.js @@ -17,8 +17,8 @@ export class Segment extends SketchObject { b.parent = this; this.children.push(a, b); this.params = { - ang: new Param(undefined), - t: new Param(undefined) + ang: new Param(undefined, 'A'), + t: new Param(undefined, 'T') }; this.params.ang.normalizer = makeAngle0_360; this.params.t.min = 100;