toolbox.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. // make a toolbox namespace? Do I have to do this?
  2. // To-do - see if I can load the xml into a variable (like in blockscadpagestart()), and break it up into "blocks", "imported blocks", and "end".
  3. // then I could support simple and advanced block sets that keep any imported blocks across them.
  4. var Blockscad = Blockscad || {};
  5. Blockscad.Toolbox = {};
  6. // Blockscad.Msg = Blockscad.Msg || {};
  7. Blockly = Blockly || {};
  8. // for switching toolboxes, I need to know the current html category ids.
  9. Blockscad.Toolbox.catIDs = [];
  10. // shall I set some hues?
  11. // Blockscad.Toolbox.allcats = ['HEX_3D_PRIMITIVE','HEX_2D_PRIMITIVE','HEX_TRANSFORM',
  12. // 'HEX_SETOP', 'HEX_MATH','HEX_LOGIC','HEX_LOOP','HEX_ADVANCED',
  13. // 'HEX_VARIABLE','HEX_PROCEDURE'];
  14. Blockscad.Toolbox.allcats = ['HEX_3D_PRIMITIVE','HEX_2D_PRIMITIVE','HEX_TRANSFORM',
  15. 'HEX_SETOP', 'HEX_MATH','HEX_LOGIC','HEX_LOOP','HEX_TEXT',
  16. 'HEX_VARIABLE','HEX_PROCEDURE'];
  17. Blockscad.Toolbox.whichCatsInSimple = [0,2,3,4,8,9];
  18. Blockscad.Toolbox.colorScheme = {};
  19. Blockscad.Toolbox.colorScheme['one'] = // classic
  20. [ '#006205', // 3D
  21. '#209303', // 2D
  22. '#26549E', // Transform
  23. '#7450E2', // Set Ops
  24. '#0185E1', // Math
  25. '#BF6920', // Logic
  26. '#612485', // Loops
  27. '#727272', // Advanced (or Text)
  28. '#8C7149', // Variables
  29. '#900355']; // Modules
  30. Blockscad.Toolbox.colorScheme['two'] = // pale
  31. [ '#885ee3', // 3D
  32. '#82af5a', // 2D
  33. '#23901c', // Transform
  34. '#377eb8', // Set Ops
  35. '#ba9969', // Math
  36. '#afaf13', // Logic
  37. '#a66658', // Loops
  38. '#d761bf', // Advanced (or Text)
  39. '#999999', // Variables
  40. '#b02375']; // Modules
  41. Blockscad.Toolbox.catHex = [];
  42. Blockscad.Toolbox.simpCatHex = [];
  43. // set default color scheme
  44. Blockscad.Toolbox.setColorScheme = function(color_scheme) {
  45. // console.log(color_scheme);
  46. for (var i = 0; i < Blockscad.Toolbox.allcats.length; i++) {
  47. Blockscad.Toolbox[Blockscad.Toolbox.allcats[i]] = color_scheme[i];
  48. Blockscad.Toolbox.catHex[i] = color_scheme[i];
  49. }
  50. // console.log(Blockscad.Toolbox);
  51. }
  52. Blockscad.Toolbox.setCatColors = function() {
  53. if (Blockscad.Toolbox.catIDs.length < Blockscad.Toolbox.allcats.length) {
  54. // using simple toolbox
  55. for (var i=0; i < Blockscad.Toolbox.catIDs.length; i++) {
  56. // console.log("trying to find element: ",Blockscad.Toolbox.catIDs[i]);
  57. var element = document.getElementById(Blockscad.Toolbox.catIDs[i]);
  58. // console.log("toolbox element is:",element);
  59. element.style.background = Blockscad.Toolbox.catHex[Blockscad.Toolbox.whichCatsInSimple[i]];
  60. }
  61. } else {
  62. for (var i=0; i < Blockscad.Toolbox.catIDs.length; i++) {
  63. // console.log("trying to find element: ",Blockscad.Toolbox.catIDs[i]);
  64. var element = document.getElementById(Blockscad.Toolbox.catIDs[i]);
  65. element.style.background = Blockscad.Toolbox.catHex[i];
  66. // console.log("toolbox element is:",element);
  67. }
  68. }
  69. }
  70. Blockscad.Toolbox.createToolbox = function() {
  71. Blockscad.Toolbox.cat_3D = '<category name="' + Blockscad.Msg.CATEGORY_3D_SHAPES + '">' +
  72. '<block type="sphere">' +
  73. '<value name="RAD">' +
  74. '<shadow type="math_number">' +
  75. '<field name="NUM">10</field>' +
  76. '</shadow>' +
  77. '</value>' +
  78. '</block>' +
  79. '<block type="cube">' +
  80. '<value name="XVAL">' +
  81. '<shadow type="math_number">' +
  82. '<field name="NUM">10</field>' +
  83. '</shadow>' +
  84. '</value>' +
  85. '<value name="YVAL">' +
  86. '<shadow type="math_number">' +
  87. '<field name="NUM">10</field>' +
  88. '</shadow>' +
  89. '</value>' +
  90. '<value name="ZVAL">' +
  91. '<shadow type="math_number">' +
  92. '<field name="NUM">10</field>' +
  93. '</shadow>' +
  94. '</value>' +
  95. '</block>' +
  96. '<block type="cylinder">' +
  97. '<value name="RAD1">' +
  98. '<shadow type="math_number">' +
  99. '<field name="NUM">10</field>' +
  100. '</shadow>' +
  101. '</value>' +
  102. '<value name="RAD2">' +
  103. '<shadow type="math_number">' +
  104. '<field name="NUM">10</field>' +
  105. '</shadow>' +
  106. '</value>' +
  107. '<value name="HEIGHT">' +
  108. '<shadow type="math_number">' +
  109. '<field name="NUM">10</field>' +
  110. '</shadow>' +
  111. '</value>' +
  112. '</block>' +
  113. '<block type="torus">' +
  114. '<value name="RAD1">' +
  115. '<shadow type="math_number">' +
  116. '<field name="NUM">4</field>' +
  117. '</shadow>' +
  118. '</value>' +
  119. '<value name="RAD2">' +
  120. '<shadow type="math_number">' +
  121. '<field name="NUM">1</field>' +
  122. '</shadow>' +
  123. '</value>' +
  124. '<value name="SIDES">' +
  125. '<shadow type="math_number">' +
  126. '<field name="NUM">8</field>' +
  127. '</shadow>' +
  128. '</value>' +
  129. '<value name="FACES">' +
  130. '<shadow type="math_number">' +
  131. '<field name="NUM">16</field>' +
  132. '</shadow>' +
  133. '</value>' +
  134. '</block>' +
  135. '</category>';
  136. Blockscad.Toolbox.cat_3D_sim = '<category name="' + Blockscad.Msg.CATEGORY_3D_SHAPES + '">' +
  137. '<block type="sphere">' +
  138. '<value name="RAD">' +
  139. '<shadow type="math_number">' +
  140. '<field name="NUM">10</field>' +
  141. '</shadow>' +
  142. '</value>' +
  143. '</block>' +
  144. '<block type="cube">' +
  145. '<value name="XVAL">' +
  146. '<shadow type="math_number">' +
  147. '<field name="NUM">10</field>' +
  148. '</shadow>' +
  149. '</value>' +
  150. '<value name="YVAL">' +
  151. '<shadow type="math_number">' +
  152. '<field name="NUM">10</field>' +
  153. '</shadow>' +
  154. '</value>' +
  155. '<value name="ZVAL">' +
  156. '<shadow type="math_number">' +
  157. '<field name="NUM">10</field>' +
  158. '</shadow>' +
  159. '</value>' +
  160. '</block>' +
  161. '<block type="cylinder">' +
  162. '<value name="RAD1">' +
  163. '<shadow type="math_number">' +
  164. '<field name="NUM">10</field>' +
  165. '</shadow>' +
  166. '</value>' +
  167. '<value name="RAD2">' +
  168. '<shadow type="math_number">' +
  169. '<field name="NUM">10</field>' +
  170. '</shadow>' +
  171. '</value>' +
  172. '<value name="HEIGHT">' +
  173. '<shadow type="math_number">' +
  174. '<field name="NUM">10</field>' +
  175. '</shadow>' +
  176. '</value>' +
  177. '</block>' +
  178. '</category>';
  179. Blockscad.Toolbox.cat2D = '<category name="' + Blockscad.Msg.CATEGORY_2D_SHAPES + '">' +
  180. '<block type="circle">' +
  181. '<value name="RAD">' +
  182. '<shadow type="math_number">' +
  183. '<field name="NUM">10</field>' +
  184. '</shadow>' +
  185. '</value>' +
  186. '</block>' +
  187. '<block type="square">' +
  188. '<value name="XVAL">' +
  189. '<shadow type="math_number">' +
  190. '<field name="NUM">10</field>' +
  191. '</shadow>' +
  192. '</value>' +
  193. '<value name="YVAL">' +
  194. '<shadow type="math_number">' +
  195. '<field name="NUM">10</field>' +
  196. '</shadow>' +
  197. '</value>' +
  198. '</block>' +
  199. '</category>';
  200. Blockscad.Toolbox.catTransform = '<category name="' + Blockscad.Msg.CATEGORY_TRANSFORMATIONS + '">' +
  201. '<block type="translate">' +
  202. '<value name="XVAL">' +
  203. '<shadow type="math_number">' +
  204. '<field name="NUM">0</field>' +
  205. '</shadow>' +
  206. '</value>' +
  207. '<value name="YVAL">' +
  208. '<shadow type="math_number">' +
  209. '<field name="NUM">0</field>' +
  210. '</shadow>' +
  211. '</value>' +
  212. '<value name="ZVAL">' +
  213. '<shadow type="math_number">' +
  214. '<field name="NUM">0</field>' +
  215. '</shadow>' +
  216. '</value>' +
  217. '</block>' +
  218. // '<block type="assign">' +
  219. // '<value name="VALUE">' +
  220. // '<shadow type="math_number">' +
  221. // '<field name="NUM">8</field>' +
  222. // '</shadow>' +
  223. // '</value>' +
  224. // '</block>' +
  225. '<block type="simplerotate">' +
  226. '<value name="XVAL">' +
  227. '<shadow type="math_angle">' +
  228. '<field name="NUM">0</field>' +
  229. '</shadow>' +
  230. '</value>' +
  231. '<value name="YVAL">' +
  232. '<shadow type="math_angle">' +
  233. '<field name="NUM">0</field>' +
  234. '</shadow>' +
  235. '</value>' +
  236. '<value name="ZVAL">' +
  237. '<shadow type="math_angle">' +
  238. '<field name="NUM">0</field>' +
  239. '</shadow>' +
  240. '</value>' +
  241. '</block>' +
  242. '<block type="simplemirror_new"></block>' +
  243. '<block type="scale">' +
  244. '<value name="XVAL">' +
  245. '<shadow type="math_number">' +
  246. '<field name="NUM">1</field>' +
  247. '</shadow>' +
  248. '</value>' +
  249. '<value name="YVAL">' +
  250. '<shadow type="math_number">' +
  251. '<field name="NUM">1</field>' +
  252. '</shadow>' +
  253. '</value>' +
  254. '<value name="ZVAL">' +
  255. '<shadow type="math_number">' +
  256. '<field name="NUM">1</field>' +
  257. '</shadow>' +
  258. '</value>' +
  259. '</block>' +
  260. '<block type="color">' +
  261. '<value name="COLOR">' +
  262. '<shadow type="colour_picker">' +
  263. '<field name="COLOUR">#ffcc00</field>' +
  264. '</shadow>' +
  265. '</value>' +
  266. '</block>' +
  267. '<block type="color_rgb">' +
  268. '<value name="RED">' +
  269. '<shadow type="math_number">' +
  270. '<field name="NUM">100</field>' +
  271. '</shadow>' +
  272. '</value>' +
  273. '<value name="GREEN">' +
  274. '<shadow type="math_number">' +
  275. '<field name="NUM">100</field>' +
  276. '</shadow>' +
  277. '</value>' +
  278. '<value name="BLUE">' +
  279. '<shadow type="math_number">' +
  280. '<field name="NUM">100</field>' +
  281. '</shadow>' +
  282. '</value>' +
  283. '</block>' +
  284. '<block type="$fn">' +
  285. '<value name="SIDES">' +
  286. '<shadow type="math_number">' +
  287. '<field name="NUM">8</field>' +
  288. '</shadow>' +
  289. '</value>' +
  290. '</block>' +
  291. '<block type="taper">' +
  292. '<value name="FACTOR">' +
  293. '<shadow type="math_number">' +
  294. '<field name="NUM">1</field>' +
  295. '</shadow>' +
  296. '</value>' +
  297. '</block>' +
  298. '<block type="linearextrude">' +
  299. '<value name="HEIGHT">' +
  300. '<shadow type="math_number">' +
  301. '<field name="NUM">10</field>' +
  302. '</shadow>' +
  303. '</value>' +
  304. '<value name="TWIST">' +
  305. '<shadow type="math_angle">' +
  306. '<field name="NUM">0</field>' +
  307. '</shadow>' +
  308. '</value>' +
  309. '<value name="XSCALE">' +
  310. '<shadow type="math_number">' +
  311. '<field name="NUM">1</field>' +
  312. '</shadow>' +
  313. '</value>' +
  314. '<value name="YSCALE">' +
  315. '<shadow type="math_number">' +
  316. '<field name="NUM">1</field>' +
  317. '</shadow>' +
  318. '</value>' +
  319. '</block>' +
  320. '<block type="rotateextrude">' +
  321. '<value name="FACES">' +
  322. '<shadow type="math_number">' +
  323. '<field name="NUM">5</field>' +
  324. '</shadow>' +
  325. '</value>' +
  326. '</block>' +
  327. '<block type="fancyrotate">' +
  328. '<value name="AVAL">' +
  329. '<shadow type="math_angle">' +
  330. '<field name="NUM">0</field>' +
  331. '</shadow>' +
  332. '</value>' +
  333. '<value name="XVAL">' +
  334. '<shadow type="math_number">' +
  335. '<field name="NUM">0</field>' +
  336. '</shadow>' +
  337. '</value>' +
  338. '<value name="YVAL">' +
  339. '<shadow type="math_number">' +
  340. '<field name="NUM">0</field>' +
  341. '</shadow>' +
  342. '</value>' +
  343. '<value name="ZVAL">' +
  344. '<shadow type="math_number">' +
  345. '<field name="NUM">0</field>' +
  346. '</shadow>' +
  347. '</value>' +
  348. '</block>' +
  349. '<block type="fancymirror">' +
  350. '<value name="XVAL">' +
  351. '<shadow type="math_number">' +
  352. '<field name="NUM">1</field>' +
  353. '</shadow>' +
  354. '</value>' +
  355. '<value name="YVAL">' +
  356. '<shadow type="math_number">' +
  357. '<field name="NUM">1</field>' +
  358. '</shadow>' +
  359. '</value>' +
  360. '<value name="ZVAL">' +
  361. '<shadow type="math_number">' +
  362. '<field name="NUM">1</field>' +
  363. '</shadow>' +
  364. '</value>' +
  365. '</block>' +
  366. '</category>';
  367. Blockscad.Toolbox.catTransform_sim = '<category name="' + Blockscad.Msg.CATEGORY_TRANSFORMATIONS + '">' +
  368. '<block type="translate">' +
  369. '<value name="XVAL">' +
  370. '<shadow type="math_number">' +
  371. '<field name="NUM">0</field>' +
  372. '</shadow>' +
  373. '</value>' +
  374. '<value name="YVAL">' +
  375. '<shadow type="math_number">' +
  376. '<field name="NUM">0</field>' +
  377. '</shadow>' +
  378. '</value>' +
  379. '<value name="ZVAL">' +
  380. '<shadow type="math_number">' +
  381. '<field name="NUM">0</field>' +
  382. '</shadow>' +
  383. '</value>' +
  384. '</block>' +
  385. '<block type="simplerotate">' +
  386. '<value name="XVAL">' +
  387. '<shadow type="math_angle">' +
  388. '<field name="NUM">0</field>' +
  389. '</shadow>' +
  390. '</value>' +
  391. '<value name="YVAL">' +
  392. '<shadow type="math_angle">' +
  393. '<field name="NUM">0</field>' +
  394. '</shadow>' +
  395. '</value>' +
  396. '<value name="ZVAL">' +
  397. '<shadow type="math_angle">' +
  398. '<field name="NUM">0</field>' +
  399. '</shadow>' +
  400. '</value>' +
  401. '</block>' +
  402. '<block type="scale">' +
  403. '<value name="XVAL">' +
  404. '<shadow type="math_number">' +
  405. '<field name="NUM">1</field>' +
  406. '</shadow>' +
  407. '</value>' +
  408. '<value name="YVAL">' +
  409. '<shadow type="math_number">' +
  410. '<field name="NUM">1</field>' +
  411. '</shadow>' +
  412. '</value>' +
  413. '<value name="ZVAL">' +
  414. '<shadow type="math_number">' +
  415. '<field name="NUM">1</field>' +
  416. '</shadow>' +
  417. '</value>' +
  418. '</block>' +
  419. '<block type="color">' +
  420. '<value name="COLOR">' +
  421. '<shadow type="colour_picker">' +
  422. '<field name="COLOUR">#ffcc00</field>' +
  423. '</shadow>' +
  424. '</value>' +
  425. '</block>' +
  426. '<block type="$fn">' +
  427. '<value name="SIDES">' +
  428. '<shadow type="math_number">' +
  429. '<field name="NUM">8</field>' +
  430. '</shadow>' +
  431. '</value>' +
  432. '</block>' +
  433. '</category>';
  434. Blockscad.Toolbox.catSetOps= '<category name="' + Blockscad.Msg.CATEGORY_SET_OPERATIONS + '">' +
  435. '<block type="union"></block>' +
  436. '<block type="difference"></block>' +
  437. '<block type="intersection"></block>' +
  438. '<block type="hull"></block>' +
  439. '</category>';
  440. Blockscad.Toolbox.catSetOps_sim = '<category name="' + Blockscad.Msg.CATEGORY_SET_OPERATIONS + '">' +
  441. '<block type="union"></block>' +
  442. '<block type="difference"></block>' +
  443. '<block type="intersection"></block>' +
  444. '</category>';
  445. Blockscad.Toolbox.catMathLogic= '<category name="' + Blockscad.Msg.CATEGORY_MATH + '">' +
  446. '<block type="math_number"></block>' +
  447. '<block type="math_angle"></block>' +
  448. '<block type="math_arithmetic">' +
  449. '<value name="A">' +
  450. '<shadow type="math_number">' +
  451. '<field name="NUM">1</field>' +
  452. '</shadow>' +
  453. '</value>' +
  454. '<value name="B">' +
  455. '<shadow type="math_number">' +
  456. '<field name="NUM">1</field>' +
  457. '</shadow>' +
  458. '</value>' +
  459. '</block>' +
  460. '<block type="math_single">' +
  461. '<value name="NUM">' +
  462. '<shadow type="math_number">' +
  463. '<field name="NUM">9</field>' +
  464. '</shadow>' +
  465. '</value>' +
  466. '</block>' +
  467. '<block type="math_trig">' +
  468. '<value name="NUM">' +
  469. '<shadow type="math_number">' +
  470. '<field name="NUM">45</field>' +
  471. '</shadow>' +
  472. '</value>' +
  473. '</block>' +
  474. '<block type="math_constant_bs"></block>' +
  475. '<block type="math_number_property">' +
  476. '<value name="NUMBER_TO_CHECK">' +
  477. '<shadow type="math_number">' +
  478. '<field name="NUM">0</field>' +
  479. '</shadow>' +
  480. '</value>' +
  481. '</block>' +
  482. '<block type="math_round">' +
  483. '<value name="NUM">' +
  484. '<shadow type="math_number">' +
  485. '<field name="NUM">3.1</field>' +
  486. '</shadow>' +
  487. '</value>' +
  488. '</block>' +
  489. '<block type="math_modulo">' +
  490. '<value name="DIVIDEND">' +
  491. '<shadow type="math_number">' +
  492. '<field name="NUM">64</field>' +
  493. '</shadow>' +
  494. '</value>' +
  495. '<value name="DIVISOR">' +
  496. '<shadow type="math_number">' +
  497. '<field name="NUM">10</field>' +
  498. '</shadow>' +
  499. '</value>' +
  500. '</block>' +
  501. '<block type="math_constrain">' +
  502. '<value name="VALUE">' +
  503. '<shadow type="math_number">' +
  504. '<field name="NUM">50</field>' +
  505. '</shadow>' +
  506. '</value>' +
  507. '<value name="LOW">' +
  508. '<shadow type="math_number">' +
  509. '<field name="NUM">1</field>' +
  510. '</shadow>' +
  511. '</value>' +
  512. '<value name="HIGH">' +
  513. '<shadow type="math_number">' +
  514. '<field name="NUM">100</field>' +
  515. '</shadow>' +
  516. '</value>' +
  517. '</block>' +
  518. '<block type="math_random_int">' +
  519. '<value name="FROM">' +
  520. '<shadow type="math_number">' +
  521. '<field name="NUM">1</field>' +
  522. '</shadow>' +
  523. '</value>' +
  524. '<value name="TO">' +
  525. '<shadow type="math_number">' +
  526. '<field name="NUM">100</field>' +
  527. '</shadow>' +
  528. '</value>' +
  529. '</block>' +
  530. '<block type="math_random_float"></block>' +
  531. '</category>' +
  532. '<category name="' + Blockscad.Msg.CATEGORY_LOGIC + '">' +
  533. '<block type="controls_if"></block>' +
  534. '<block type="logic_compare"></block>' +
  535. '<block type="logic_operation"></block>' +
  536. '<block type="logic_negate"></block>' +
  537. '<block type="logic_boolean"></block>' +
  538. '<block type="logic_ternary"></block>' +
  539. '</category>';
  540. Blockscad.Toolbox.catMathLogic_sim= '<category name="' + Blockscad.Msg.CATEGORY_MATH + '">' +
  541. '<block type="math_number"></block>' +
  542. '<block type="math_angle"></block>' +
  543. '<block type="math_arithmetic"></block>' +
  544. '<block type="math_single"></block>' +
  545. '<block type="math_random_int">' +
  546. '<value name="FROM">' +
  547. '<shadow type="math_number">' +
  548. '<field name="NUM">1</field>' +
  549. '</shadow>' +
  550. '</value>' +
  551. '<value name="TO">' +
  552. '<shadow type="math_number">' +
  553. '<field name="NUM">100</field>' +
  554. '</shadow>' +
  555. '</value>' +
  556. '</block>' +
  557. '</category>';
  558. Blockscad.Toolbox.catLoops = '<category name="' + Blockscad.Msg.CATEGORY_LOOPS + '">' +
  559. '<block type="controls_for">' +
  560. '<value name="FROM">' +
  561. '<shadow type="math_number">' +
  562. '<field name="NUM">1</field>' +
  563. '</shadow> ' +
  564. '</value>' +
  565. '<value name="TO">' +
  566. '<shadow type="math_number">' +
  567. '<field name="NUM">10</field>' +
  568. '</shadow>' +
  569. '</value>' +
  570. '<value name="BY">' +
  571. '<shadow type="math_number">' +
  572. '<field name="NUM">1</field>' +
  573. '</shadow>' +
  574. '</value>' +
  575. '</block>' +
  576. // '<block type="controls_for_chainhull">' +
  577. // '<value name="FROM">' +
  578. // '<block type="math_number">' +
  579. // '<field name="NUM">1</field>' +
  580. // '</block> ' +
  581. // '</value>' +
  582. // '<value name="TO">' +
  583. // '<block type="math_number">' +
  584. // '<field name="NUM">10</field>' +
  585. // '</block>' +
  586. // '</value>' +
  587. // '<value name="BY">' +
  588. // '<block type="math_number">' +
  589. // '<field name="NUM">1</field>' +
  590. // '</block>' +
  591. // '</value>' +
  592. // '</block>' +
  593. '</category>';
  594. Blockscad.Toolbox.catOther = '<category name="' + Blockscad.Msg.CATEGORY_TEXT + '">' +
  595. '<block type="bs_text">' +
  596. '<value name="TEXT">' +
  597. '<shadow type="text">' +
  598. '</shadow>' +
  599. '</value>' +
  600. '<value name="SIZE">' +
  601. '<shadow type="math_number">' +
  602. '<field name="NUM">10</field>' +
  603. '</shadow>' +
  604. '</value>' +
  605. '</block>' +
  606. '<block type="bs_3dtext">' +
  607. '<value name="TEXT">' +
  608. '<shadow type="text">' +
  609. '</shadow>' +
  610. '</value>' +
  611. '<value name="SIZE">' +
  612. '<shadow type="math_number">' +
  613. '<field name="NUM">10</field>' +
  614. '</shadow>' +
  615. '</value>' +
  616. '<value name="THICKNESS">' +
  617. '<shadow type="math_number">' +
  618. '<field name="NUM">2</field>' +
  619. '</shadow>' +
  620. '</value>' +
  621. '</block>' +
  622. '<block type="text"></block>' +
  623. '<block type="bs_text_length">' +
  624. '<value name="VALUE">' +
  625. '<shadow type="text">' +
  626. '<field name="TEXT">abc</field>' +
  627. '</shadow>' +
  628. '</value>' +
  629. '</block>' +
  630. // '<block type="rotateextrudetwist">' +
  631. // '<value name="RAD">' +
  632. // '<block type="math_number">' +
  633. // '<field name="NUM">10</field>' +
  634. // '</block>' +
  635. // '</value>' +
  636. // '<value name="FACES">' +
  637. // '<block type="math_number">' +
  638. // '<field name="NUM">5</field>' +
  639. // '</block>' +
  640. // '</value>' +
  641. // '<value name="TWIST">' +
  642. // '<block type="math_number">' +
  643. // '<field name="NUM">360</field>' +
  644. // '</block>' +
  645. // '</value>' +
  646. // '<value name="TSTEPS">' +
  647. // '<block type="math_number">' +
  648. // '<field name="NUM">180</field>' +
  649. // '</block>' +
  650. // '</value>' +
  651. // '</block>' +
  652. // '<block type="twistytorus">' +
  653. // '<value name="RAD1">' +
  654. // '<block type="math_number">' +
  655. // '<field name="NUM">4</field>' +
  656. // '</block>' +
  657. // '</value>' +
  658. // '<value name="RAD2">' +
  659. // '<block type="math_number">' +
  660. // '<field name="NUM">1</field>' +
  661. // '</block>' +
  662. // '</value>' +
  663. // '<value name="SIDES">' +
  664. // '<block type="math_number">' +
  665. // '<field name="NUM">8</field>' +
  666. // '</block>' +
  667. // '</value>' +
  668. // '<value name="FACES">' +
  669. // '<block type="math_number">' +
  670. // '<field name="NUM">3</field>' +
  671. // '</block>' +
  672. // '</value>' +
  673. // '<value name="TWIST">' +
  674. // '<block type="math_number">' +
  675. // '<field name="NUM">360</field>' +
  676. // '</block>' +
  677. // '</value>' +
  678. // '</block>' +
  679. // '<block type="stl_import"></block>' +
  680. '</category>' +
  681. '<category name="' + Blockscad.Msg.CATEGORY_VARIBLES + '" custom="VARIABLE"></category>' +
  682. '<category name="' + Blockscad.Msg.CATEGORY_PROCEDURES + '" custom="PROCEDURE"></category>' +
  683. '</xml>';
  684. Blockscad.Toolbox.catOther_sim =
  685. '<category name="' + Blockscad.Msg.CATEGORY_VARIBLES + '" custom="VARIABLE"></category>' +
  686. '<category name="' + Blockscad.Msg.CATEGORY_PROCEDURES + '" custom="PROCEDURE"></category>' +
  687. '</xml>';
  688. Blockscad.Toolbox.adv = '<xml id="toolbox" style="display: none">';
  689. Blockscad.Toolbox.adv += Blockscad.Toolbox.cat_3D;
  690. Blockscad.Toolbox.adv += Blockscad.Toolbox.cat2D;
  691. Blockscad.Toolbox.adv += Blockscad.Toolbox.catTransform;
  692. Blockscad.Toolbox.adv += Blockscad.Toolbox.catSetOps;
  693. Blockscad.Toolbox.adv += Blockscad.Toolbox.catMathLogic;
  694. Blockscad.Toolbox.adv += Blockscad.Toolbox.catLoops;
  695. Blockscad.Toolbox.adv += Blockscad.Toolbox.catOther;
  696. Blockscad.Toolbox.sim = '<xml id="toolbox" style="display: none">';
  697. Blockscad.Toolbox.sim += Blockscad.Toolbox.cat_3D_sim;
  698. // Blockscad.Toolbox.sim += Blockscad.Toolbox.cat2D;
  699. Blockscad.Toolbox.sim += Blockscad.Toolbox.catTransform_sim;
  700. Blockscad.Toolbox.sim += Blockscad.Toolbox.catSetOps_sim;
  701. Blockscad.Toolbox.sim += Blockscad.Toolbox.catMathLogic_sim;
  702. //Blockscad.Toolbox.sim += Blockscad.Toolbox.catLoops_sim;
  703. Blockscad.Toolbox.sim += Blockscad.Toolbox.catOther_sim;
  704. }