// Do not edit this file; automatically generated by build.py. 'use strict'; // Copyright 2012 Google Inc. Apache License 2.0 Blockly.Blocks.colour={};Blockly.Blocks.colour_picker={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_PICKER_HELPURL);this.setColour(Blockscad.Toolbox.HEX_TRANSFORM);this.appendDummyInput().appendField(new Blockly.FieldColour("#ff0000"),"COLOUR");this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_PICKER_TOOLTIP)}}; Blockly.Blocks.colour_random={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_RANDOM_HELPURL);this.setColour(Blockscad.Toolbox.HEX_TRANSFORM);this.appendDummyInput().appendField(Blockly.Msg.COLOUR_RANDOM_TITLE);this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_RANDOM_TOOLTIP)}}; Blockly.Blocks.colour_rgb={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_RGB_HELPURL);this.setColour(Blockscad.Toolbox.HEX_TRANSFORM);this.appendValueInput("RED").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_TITLE).appendField(Blockly.Msg.COLOUR_RGB_RED);this.appendValueInput("GREEN").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_GREEN);this.appendValueInput("BLUE").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_BLUE); this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_RGB_TOOLTIP)}}; Blockly.Blocks.colour_blend={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_BLEND_HELPURL);this.setColour(Blockscad.Toolbox.HEX_TRANSFORM);this.appendValueInput("COLOUR1").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_TITLE).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR1);this.appendValueInput("COLOUR2").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR2);this.appendValueInput("RATIO").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_RATIO); this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_BLEND_TOOLTIP)}};Blockly.Blocks.union={init:function(){this.category="SET_OP";this.setHelpUrl("http://www.example.com/");this.setColour(Blockscad.Toolbox.HEX_SETOP);this.appendDummyInput().appendField(Blockscad.Msg.UNION);this.appendStatementInput("A").setCheck(["CSG","CAG"]);this.appendStatementInput("PLUS0").appendField(Blockscad.Msg.PLUS).setCheck(["CSG","CAG"]);this.setInputsInline(!0);this.setPreviousStatement(!0,["CSG","CAG"]);this.setTooltip(Blockscad.Msg.UNION_TOOLTIP);this.setMutatorPlus(new Blockly.MutatorPlus(this)); this.plusCount_=0},mutationToDom:function(){if(!this.plusCount_)return null;var a=document.createElement("mutation");this.plusCount_&&a.setAttribute("plus",this.plusCount_);return a},domToMutation:function(a){this.plusCount_=parseInt(a.getAttribute("plus"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.plusCount_;b++)this.appendStatementInput("PLUS"+b).appendField(Blockscad.Msg.PLUS).setCheck(a);1<=this.plusCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},updateShape_:function(a){1== a?(this.plusCount_++,a=this.getInput("A").connection.check_,this.appendStatementInput("PLUS"+this.plusCount_).appendField(Blockscad.Msg.PLUS).setCheck(a)):-1==a&&(this.removeInput("PLUS"+this.plusCount_),this.plusCount_--);1<=this.plusCount_?1==this.plusCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())},setType:function(a){if(this.workspace){this.previousConnection.setCheck(a);this.getInput("A").connection.setCheck(a); this.getInput("PLUS0").connection.setCheck(a);for(var b=1;b<=this.plusCount_;b++)this.getInput("PLUS"+b).connection.setCheck(a)}}}; Blockly.Blocks.difference={init:function(){this.category="SET_OP";this.setHelpUrl("http://www.example.com/");this.setColour(Blockscad.Toolbox.HEX_SETOP);this.appendDummyInput().appendField(Blockscad.Msg.DIFFERENCE);this.appendStatementInput("A").setCheck(["CSG","CAG"]);this.appendStatementInput("MINUS0").appendField(Blockscad.Msg.MINUS).setCheck(["CSG","CAG"]);this.setInputsInline(!0);this.setPreviousStatement(!0,["CSG","CAG"]);this.setTooltip(Blockscad.Msg.DIFFERENCE_TOOLTIP);this.setMutatorPlus(new Blockly.MutatorPlus(this)); this.minusCount_=0},mutationToDom:function(){if(!this.minusCount_)return null;var a=document.createElement("mutation");this.minusCount_&&a.setAttribute("minus",this.minusCount_);return a},domToMutation:function(a){this.minusCount_=parseInt(a.getAttribute("minus"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.minusCount_;b++)this.appendStatementInput("MINUS"+b).appendField(Blockscad.Msg.MINUS).setCheck(a);1<=this.minusCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},updateShape_:function(a){1== a?(this.minusCount_++,a=this.getInput("A").connection.check_,this.appendStatementInput("MINUS"+this.minusCount_).appendField(Blockscad.Msg.MINUS).setCheck(a)):-1==a&&(this.removeInput("MINUS"+this.minusCount_),this.minusCount_--);1<=this.minusCount_?1==this.minusCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())},setType:function(a){if(this.workspace){this.previousConnection.setCheck(a);this.getInput("A").connection.setCheck(a); this.getInput("MINUS0").connection.setCheck(a);for(var b=1;b<=this.minusCount_;b++)this.getInput("MINUS"+b).connection.setCheck(a)}}}; Blockly.Blocks.intersection={init:function(){this.category="SET_OP";this.setHelpUrl("http://www.example.com/");this.setColour(Blockscad.Toolbox.HEX_SETOP);this.appendDummyInput().appendField(Blockscad.Msg.INTERSECTION);this.appendStatementInput("A").setCheck(["CSG","CAG"]);this.appendStatementInput("WITH0").appendField(Blockscad.Msg.WITH).setCheck(["CSG","CAG"]);this.setInputsInline(!0);this.setPreviousStatement(!0,["CSG","CAG"]);this.setTooltip(Blockscad.Msg.INTERSECTION_TOOLTIP);this.setMutatorPlus(new Blockly.MutatorPlus(this)); this.withCount_=0},mutationToDom:function(){if(!this.withCount_)return null;var a=document.createElement("mutation");this.withCount_&&a.setAttribute("with",this.withCount_);return a},domToMutation:function(a){this.withCount_=parseInt(a.getAttribute("with"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.withCount_;b++)this.appendStatementInput("WITH"+b).appendField(Blockscad.Msg.WITH).setCheck(a);1<=this.withCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},updateShape_:function(a){1== a?(this.withCount_++,a=this.getInput("A").connection.check_,this.appendStatementInput("WITH"+this.withCount_).appendField(Blockscad.Msg.WITH).setCheck(a)):-1==a&&(this.removeInput("WITH"+this.withCount_),this.withCount_--);1<=this.withCount_?1==this.withCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())},setType:function(a){if(this.workspace){this.previousConnection.setCheck(a);this.getInput("A").connection.setCheck(a); this.getInput("WITH0").connection.setCheck(a);for(var b=1;b<=this.withCount_;b++)this.getInput("WITH"+b).connection.setCheck(a)}}}; Blockly.Blocks.hull={init:function(){this.category="SET_OP";this.setHelpUrl("http://www.example.com/");this.setColour(Blockscad.Toolbox.HEX_SETOP);this.appendDummyInput().appendField(Blockscad.Msg.CONVEX_HULL);this.appendStatementInput("A").setCheck(["CSG","CAG"]);this.appendStatementInput("WITH0").appendField(Blockscad.Msg.WITH).setCheck(["CSG","CAG"]);this.setInputsInline(!0);this.setPreviousStatement(!0,["CSG","CAG"]);this.setTooltip(Blockscad.Msg.HULL_TOOLTIP);this.setMutatorPlus(new Blockly.MutatorPlus(this)); this.withCount_=0},mutationToDom:function(){if(!this.withCount_)return null;var a=document.createElement("mutation");this.withCount_&&a.setAttribute("with",this.withCount_);return a},domToMutation:function(a){this.withCount_=parseInt(a.getAttribute("with"),10);a=this.getInput("A").connection.check_;for(var b=1;b<=this.withCount_;b++)this.appendStatementInput("WITH"+b).appendField(Blockscad.Msg.WITH).setCheck(a);1<=this.withCount_&&this.setMutatorMinus(new Blockly.MutatorMinus(this))},updateShape_:function(a){1== a?(this.withCount_++,a=this.getInput("A").connection.check_,this.appendStatementInput("WITH"+this.withCount_).appendField(Blockscad.Msg.WITH).setCheck(a)):-1==a&&(this.removeInput("WITH"+this.withCount_),this.withCount_--);1<=this.withCount_?1==this.withCount_&&(this.setMutatorMinus(new Blockly.MutatorMinus(this)),this.render()):(this.mutatorMinus.dispose(),this.mutatorMinus=null,this.render())},setType:function(a){if(this.workspace){this.previousConnection.setCheck(a);this.getInput("A").connection.setCheck(a); this.getInput("WITH0").connection.setCheck(a);for(var b=1;b<=this.withCount_;b++)this.getInput("WITH"+b).connection.setCheck(a)}}};Blockly.Blocks.lists={};Blockscad.Toolbox=Blockscad.Toolbox||{};Blockly.Blocks.lists.HUE=Blockscad.Toolbox.HEX_LOGIC;Blockly.Blocks.lists_create_empty={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.setOutput(!0,"Array");this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);this.setTooltip(Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP)}}; Blockly.Blocks.lists_create_with={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setMutator(new Blockly.Mutator(["lists_create_with_item"]));this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"), 10);this.updateShape_()},decompose:function(a){var b=Blockly.Block.obtain(a,"lists_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,d=0;d","LT"],["\u2265","LTE"],["<","GT"],["\u2264","GTE"]]:[["=","EQ"],["\u2260","NEQ"],["<","LT"],["\u2264","LTE"],[">","GT"],["\u2265","GTE"]];this.setHelpUrl(Blockly.Msg.LOGIC_COMPARE_HELPURL);this.setColour(Blockscad.Toolbox.HEX_LOGIC);this.setOutput(!0,"Boolean");this.appendValueInput("A");this.appendValueInput("B").appendField(new Blockly.FieldDropdown(a),"OP");this.setInputsInline(!0);var b=this;this.setTooltip(function(){var a= b.getFieldValue("OP");return{EQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[a]});this.prevBlocks_=[null,null]},onchange:function(){var a=this.getInputTargetBlock("A"),b=this.getInputTargetBlock("B");if(a&&b&&!a.outputConnection.checkType_(b.outputConnection))for(var c=0;c