Skip to content

Commit a09a3b4

Browse files
committed
updated readme.md
1 parent a0e8901 commit a09a3b4

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

.idea/workspace.xml

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
React components to view STL and OBJ models.
44
Based on THREE.js and [react-stl-viewer](https://github.com/chiedolabs/react-stl-viewer)
55

6+
### [Live Demo](https://bohdanbirdie.github.io/stl-obj-demo/).
67

78
## How to use
8-
1. Use OBJ or STL loader
9+
1. Install the app
10+
- via npm ```npm install react-stl-obj-viewer --save```
11+
- via yarn ```yarn add react-stl-obj-viewer```
12+
13+
2. Use OBJ or STL loader
914

1015
```import {OBJViewer, STLViewer} from 'npm-react-component-starter';```
11-
2. Pass props to viewers:
16+
3. Pass props to viewers:
1217

1318
```
1419
static propTypes = {
@@ -20,6 +25,8 @@ static propTypes = {
2025
height: PropTypes.number, // Height of rendered area
2126
backgroundColor: PropTypes.string, // Scene background color
2227
modelColor: PropTypes.string,// Model color(textures unsupported)
28+
sceneClassName: PropTypes.string, // Class name for rendered canvas scene
29+
onSceneRendered: PropTypes.func, // Callback for rendered scene ready
2330
};
2431
```
2532
Default props
@@ -29,12 +36,11 @@ static defaultProps = {
2936
modelColor: '#B92C2C',
3037
height: 400,
3138
width: 400,
39+
sceneClassName: '',
3240
};
3341
```
3442

3543
## Convert scene to screenshot
3644

3745
Simply get your element _(canvas scene)_ by any selector and call `.toDataURL("image/png")` on it.
3846
___
39-
40-
## [Live Demo](https://bohdanbirdie.github.io/stl-obj-demo/).

0 commit comments

Comments
 (0)