Socket
Socket
Sign inDemoInstall

stlreader

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stlreader

Read and write stl files.


Version published
Weekly downloads
12
increased by500%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

stlreader

Install

npm install --save stlreader

Usage



import { stlreader, Facets } from 'stlreader';

 
fetch('http://localhost:3000/crane.stl')
.then(
    
(response) => {
    let reader = new FileReader();

    return response.blob().then(
        (blob:Blob) => {

         reader.readAsArrayBuffer(blob);
        
         return new Promise(
            resolve => { 
             reader.onload = () => {
                    
                let arraybufferStl : ArrayBuffer = reader.result; 

                let stlReader = new stlreader();

                let facets:Facets=stlReader.read(arraybufferStl);

                console.log(
                    facets.vertices, 
                    facets.normals, 
                    facets.colors
                ); 

                arraybufferStl = stlReader.write(facets);

                console.log(
                    arraybufferStl
                ); 
                
             }; 
            }  
         );

        }
    );
  }
);


License

MIT

Keywords

FAQs

Last updated on 30 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc