1.1.1 • Published 4 years ago

react-3d-model-viewer v1.1.1

Weekly downloads
11
License
MIT
Repository
github
Last release
4 years ago

react-3d-model-viewer npm.io

A React component to view 3D models in either stl or 3mf formats using three.js. Demo

Features

  • React component
  • Three.js WebGL renderer
  • Three.js STL Loader
  • Three.js 3MF Loader

    Note - Remains dependent on my fork of Three.js which has a branch to expose some orbit controls methods to provide a means of initial positioning (Three.js r104 incorporated a pull request to modularize STL Loader in Three's examples/jsm (which this fork also previously added).

Usage

Install react-3d-model-viewer through npm

npm i react-3d-model-viewer

Use ModelViewer component

import ModelViewer from 'react-3d-model-viewer'

Properties

PropertyTypeDefaultDescription
urlstring'./test_model.stl'The url of the STL file
widthstring'100%'The width of the canvas
aspectgRatiostring'56.125%'The aspect ratio of the canvas
colorstring'#fdd017'The model display color
backgroundColorstring'#eaeaea'The canvas color
rotatebooleantrueAnimate the rotation of the model
rotationSpeedsnumber list0.01, 0.01, 0A vector of rotation speeds
initControlPositionnumber list0, 0, 1.0radians up, radians left, dolly out
1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago