Thu, 06 Apr 2017 17:18:24 +0200
finishing first release
cylindertransport-web.py | file | annotate | diff | comparison | revisions | |
index.html | file | annotate | diff | comparison | revisions | |
stl.py | file | annotate | diff | comparison | revisions | |
stlviewer.js | file | annotate | diff | comparison | revisions |
--- a/cylindertransport-web.py Thu Apr 06 16:21:21 2017 +0200 +++ b/cylindertransport-web.py Thu Apr 06 17:18:24 2017 +0200 @@ -29,6 +29,7 @@ img_str = base64.b64encode(buffer.getvalue()) print json.dumps({ "objects": calc.circles, + "offset": (calc.width - (2 * calc.margin)) / 2, "scale3d": config.SCALE3D, "image": img_str })
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/index.html Thu Apr 06 17:18:24 2017 +0200 @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"> + <title>ScubaTools Package</title> + <meta charset="utf-8"> + </head> + <body> + <div style="width: 900px; margin: 0 auto"> + <h1> + ScubaTools 4 fun project + </h1> + + <a href="cylindertransport-web.py"> + <h2>Dive cylinder transport spacer calculation</h2> + </a> + <p> + Horrible complex python script to calculate optimal "PVC Baumarkt[tm] Abflussrohr" spacers between your scuba dive cylinders while transporting them horizontally in the car trunk.<br/> + The idea is to connect all the spacers with two ropes together (drill a hole on each spacer end) so the scuba tanks wont roll while driving. + </p> + </div> + </body> +</html> \ No newline at end of file
--- a/stl.py Thu Apr 06 16:21:21 2017 +0200 +++ b/stl.py Thu Apr 06 17:18:24 2017 +0200 @@ -2,7 +2,7 @@ STL related helpers """ -import os, subprocess, vtk +import os, subprocess import config, data OPENSCAD_MODULES = """ @@ -36,6 +36,7 @@ """ Run openSCAD process, then convert the ascii stl to binary by using vtk """ + import vtk if os.path.isfile(output): print "skipping existing file %s" % output return
--- a/stlviewer.js Thu Apr 06 16:21:21 2017 +0200 +++ b/stlviewer.js Thu Apr 06 17:18:24 2017 +0200 @@ -33,6 +33,10 @@ }); update_scene(); + $(".listcontainer") + .mouseout(function() {controls.enabled = true}) + .mouseover(function() {controls.enabled = false}); + $("#image2d").click(function() { var img = $("#image2d").clone(); //img.css('width', '100%'); @@ -108,7 +112,7 @@ volume += obj[4][2]; if (obj[4][1] > length) length = obj[4][1]; } - position = [data.scale3d * 0.01 * obj[0], 0, 0]; + position = [data.scale3d * 0.01 * (obj[0] - data.offset), 0, 0]; loadSTL(filename, material + "", position); content += "</li>" }