Koda: |
@app.route("/img/<path>") def image_as_html(path): with open(gvl.current_data_folder+path+'.png', 'rb') as fd: image_as_base64_html = f""" <img src="data:image/png;base64,{base64.encodebytes(fd.read()).decode()}">""" return image_as_base64_html |
Koda: |
<script> var stl_viewer=new StlViewer ( document.getElementById("stl_cont"), { models: [ {id:1, filename:"model.obj", display:"smooth", rotationx:0.5, rotationy:0.5, rotationz:0.5, animation:{delta:{rotationx:1,rotationy:1,rotationz:1, msec:10000, loop:false}}} ] } ); </script> |