# HG changeset patch # User mdd # Date 1491491904 -7200 # Node ID 32de35694e5667c9f9a8543ac3ecbd28cb5880e5 # Parent ff1941c85fd3fcac93fce75227e2fcdd92d51bf4 finishing first release diff -r ff1941c85fd3 -r 32de35694e56 cylindertransport-web.py --- 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 }) diff -r ff1941c85fd3 -r 32de35694e56 index.html --- /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 @@ + + + + + ScubaTools Package + + + +
+

+ ScubaTools 4 fun project +

+ + +

Dive cylinder transport spacer calculation

+
+

+ 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.
+ 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. +

+
+ + \ No newline at end of file diff -r ff1941c85fd3 -r 32de35694e56 stl.py --- 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 diff -r ff1941c85fd3 -r 32de35694e56 stlviewer.js --- 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 += "" }