Skip to content

A Component for viewing STL objects in the browser, given a URL by utilizing Three.js

License

Notifications You must be signed in to change notification settings

HaraldMuehlhoffCC/react-stl-viewer

 
 

Repository files navigation

React STL Viewer

A React component for viewing an STL object from a given URL by utilizing Three.js

Note that you will still have to abide by the rules of CORS so you won't just be able to load a 3D file from someone else's site

Installation

npm install stl-viewer

Usage

import STLViewer from 'stl-viewer'

<STLViewer
	model='http://www.example.com/example-url.stl'
	width={400}
	height={400}
	modelColor='#B92C2C'
	backgroundColor='#EAEAEA'
	rotate={true}
	orbitControls={true}
/>

Contributing

  • If you test the building of the dist, please do not commit those files.

Testing

  • Build with yarn run build
  • Run this in the root of the project folder python -m SimpleHTTPServer 8000
  • Visit http://0.0.0.0:8000 in your browser

About

A Component for viewing STL objects in the browser, given a URL by utilizing Three.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.5%
  • HTML 1.5%