简体   繁体   中英

Tracking the libraries and scripts that a website uses

I upload STL files to a website called Thingiverse.com then it automatically creates a preview of 3D design files. I am interested in learning which libraries does website use. For instance for this page: https://www.thingiverse.com/thing:2405615 When I click on Thingview and then take a look at the source code of the page I see that it uses:

<script src="/thingiview/js/three.min.js?v=2"></script>
<script src="/thingiview/js/Thingiview.js?v=2"></script>
<script src="/thingiview/js/NormalControls.js?v=2"></script>
<script src="/thingiview/js/Detector.js?v=2"></script>
<script>
        var target_dom_element = $('.thingiview').get(0);

        // parse opts
        var argv = {};
        var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
            argv[key] = value;
        });

        var thingiview = new Thingiview( target_dom_element, 628, 472 );
        if ( parseInt(argv['width']) && parseInt(argv['height']) )
            thingiview.resize( parseInt(argv['width']), parseInt(argv['height']) );

        var animate = function() {
            requestAnimationFrame( animate );
            thingiview.render();
        }
        animate();

        // handle resizes
        window.addEventListener('resize', function() {
            if ( thingiview.fullscreen )
                thingiview.resize(window.innerWidth, 608);
        });

    </script>

However, when I click on the Thingview button, the visual angle of the image changes and also shadows and lightings on image disappear. I am particularly interested in finding the script that creates these shadows and lightings in the STL file. Is there a way of finding how Thingiverse creates previews of design files? I need to take the snapshot of design files from the same angles and with same effects

three.js allows for 3d objects to be displayed in browsers. It looks like STL files can be directly loaded into it. They have an example in their github repo. I would image when you upload a file it gets passed to three.js and then it is displayed. All of the shadows and visuals should be handled by the library.

I think it uploads STL files to cloud and only there it creates the previews. I am not sure whether you can see what is going on there. What do you think @pailhead ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM