stlviewer.js

changeset 19
32de35694e56
parent 18
ff1941c85fd3
equal deleted inserted replaced
18:ff1941c85fd3 19:32de35694e56
30 $("#clearselected").click(function(){ 30 $("#clearselected").click(function(){
31 $( "#sortable2 li" ).remove(); 31 $( "#sortable2 li" ).remove();
32 for (i =0; i<10; i++) clear_scene(); 32 for (i =0; i<10; i++) clear_scene();
33 }); 33 });
34 update_scene(); 34 update_scene();
35
36 $(".listcontainer")
37 .mouseout(function() {controls.enabled = true})
38 .mouseover(function() {controls.enabled = false});
35 39
36 $("#image2d").click(function() { 40 $("#image2d").click(function() {
37 var img = $("#image2d").clone(); 41 var img = $("#image2d").clone();
38 //img.css('width', '100%'); 42 //img.css('width', '100%');
39 img.css('margin', '0 auto'); 43 img.css('margin', '0 auto');
106 content += "Cylinder: " + obj[4][4] + " (" + obj[4][0] + "mm)" 110 content += "Cylinder: " + obj[4][4] + " (" + obj[4][0] + "mm)"
107 weight += obj[4][3]; 111 weight += obj[4][3];
108 volume += obj[4][2]; 112 volume += obj[4][2];
109 if (obj[4][1] > length) length = obj[4][1]; 113 if (obj[4][1] > length) length = obj[4][1];
110 } 114 }
111 position = [data.scale3d * 0.01 * obj[0], 0, 0]; 115 position = [data.scale3d * 0.01 * (obj[0] - data.offset), 0, 0];
112 loadSTL(filename, material + "", position); 116 loadSTL(filename, material + "", position);
113 content += "</li>" 117 content += "</li>"
114 } 118 }
115 119
116 content += "</ul><br/>Total cylinder weight: " + Math.ceil(weight) + " kg<br/>"; 120 content += "</ul><br/>Total cylinder weight: " + Math.ceil(weight) + " kg<br/>";

mercurial