Skip to content
A Component for viewing STL objects in the browser, given a URL by utilizing Three.js
Branch: master
Clone or download
Latest commit 317141d May 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Build May 6, 2019
react added possibility to load a buffer and not only to load a file from url May 6, 2019
src added possibility to load a buffer and not only to load a file from url May 6, 2019
.babelrc Refactored for example repo Feb 2, 2016
.gitignore Initial Commit Jan 30, 2016
.prettierrc fixed GPU memory leak after changing props and when component unmounts. Jan 8, 2019
LICENSE.md Initial Commit Jan 30, 2016
README.md Update README.md Dec 31, 2018
index.html Build attempt two Feb 2, 2016
package-lock.json 0.12.0 May 6, 2019
package.json
server.js Refactored for example repo Feb 2, 2016
webpack.config.dev.js Refactored for example repo Feb 2, 2016
webpack.config.prod.js Refactored for example repo Feb 2, 2016
yarn.lock Upgrades to React v16.2 Mar 8, 2018

README.md

React STL Viewer

New maintainer needed.

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

Looking for contributors

See a live demo here.

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
	url='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
You can’t perform that action at this time.