mirror of
https://github.com/omrips/viewstl
synced 2026-01-02 20:29:58 +03:00
6fbc2cc36a70aeac809a6e410a857fb5402f609f
//New in 1.12 => improve auto_zoom algorithm by Michal Jirku (https://wejn.org/2020/12/cracking-the-threejs-object-fitting-nut/) //New in 1.12 => "dispose" function //New in 1.12 => fixed memory leak on "clean" function (thanks to Anthony https://github.com/antho1404) //New in 1.12 => use 'fetch' instead for xhr when possible (thanks to Anthony https://github.com/antho1404) //New in 1.12 => added get_vsb_blob (returns vsb file as binary) //New in 1.12 => set viewstl to take all of the container (and not 5px margin) //New in 1.12 => fixed bug in json_without_nulls function
Viewstl
Javascript STL/OBJ 3D files Viewer
Reads binary/ASCII STL files; OBJ files
Uses THREE.js lib - Can load THREE.js lib files in the background (no need to deal with THREE JS at all)
Usage:
At the html page header / page body:
<script src="stl_viewer.min.js"></script>
At the page body, create an element to contain the Stl Viewer, and give it an ID:
<div id="stl_cont"></div>
Create a new instance of Stl Viewer (simplest initiation - read and view STL file called 'mystl.stl'):
var stl_viewer=new StlViewer(document.getElementById("stl_cont"), { models: [ {id:0, filename:"mystl.stl"} ] });
more at https://www.viewstl.com/plugin/
Description
Viewstl Javascript plugin - STL/OBJ 3D files Viewer
https://www.viewstl.com/plugin/
Languages
JavaScript
100%