Skip to content
Snippets Groups Projects
Commit 9d0c21ad authored by mehtank's avatar mehtank
Browse files

Display SVG

parent 23375465
Branches
No related merge requests found
......@@ -89,13 +89,13 @@ def catchall(path):
ss = make(f, component, request.form)
return "Good"
elif ext == "svg":
make(f, component, request.args, mkstl=True, mkdxf=False, mksvg=False)
#make(f, component, request.args, mkstl=False, mkdxf=False, mksvg=True)
return send_from_directory(join(app.static_folder, component), "graph-print.svg", as_attachment=True, cache_timeout=-1)
elif ext == "stl":
make(f, component, request.args, mkstl=True, mkdxf=False, mksvg=False)
#make(f, component, request.args, mkstl=True, mkdxf=False, mksvg=False)
return send_from_directory(join(app.static_folder, component), "graph-model.stl", as_attachment=True, cache_timeout=-1)
elif ext == "dxf":
make(f, component, request.args, mkstl=False, mkdxf=True, mksvg=False)
#make(f, component, request.args, mkstl=False, mkdxf=True, mksvg=False)
return send_from_directory(join(app.static_folder, component), "graph-silhouette.dxf", as_attachment=True, cache_timeout=-1)
elif ext:
abort(400)
......
......@@ -121,6 +121,7 @@ function remake() {
console.log('success: ');
console.log(event.target.responseText);
stlreload();
svgreload();
});
// Define what happens in case of error
......@@ -133,7 +134,7 @@ function remake() {
}
window.onload = function(e){
stlreload();
remake();
}
......
......@@ -79,10 +79,15 @@
<div id="stl"></div>
<div id="dxf">
<img src="{{ component }}.svg">
<img id="svg" src="{{ component }}.svg">
</div>
<script>stlmodel = 'static/{{ component }}/graph-model.stl'</script>
<script>
function svgreload() {
document.getElementById('svg').src = "{{ component }}.svg?random="+new Date().getTime();
}
</script>
<script src="static/my.js"></script>
</body>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment