npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-jsc3d

v0.1.7

Published

React port of JSC3D software 3D mesh renderer

Downloads

23

Readme

React JSC3D

Travis npm package Coveralls

React.js component that wraps JSC3D, a CPU ray tracer for STL and OBJ files.

Originally built for OmniConverter - a stateless microservice framework that creates on-the-fly thumbs and previews of a zillion different filetypes.

Example screenshot

Usage

Install:

npm install --save react-jsc3d

Use as you would any other React component:

import React, { Component } from 'react';
import Jsc3dViewer from 'react-jsc3d';
class Example extends Component {
    render() {
        return (
            <Jsc3dViewer sceneUrl={'/some/path/to/mesh.stl'} />
        );
    }
}

Properties

With the exception of height, width, and mouse, all the props relate directly to original JSC3D options. Available parameters are, with their original description from the JSC3D source code:

  • sceneUrl: (REQUIRED) URL string that describes where to load the scene
  • initRotationX: initial rotation angle around x-axis for the whole scene, default to 45
  • initRotationY: initial rotation angle around y-axis for the whole scene, default to -45
  • initRotationZ: initial rotation angle around z-axis for the whole scene, default to -135
  • creaseAngle: an angle to control the shading smoothness between faces. Two adjacent faces will be shaded with discontinuity at the edge if the angle between their normals exceeds this value. Not used by default
  • modelColor: fallback color for all meshes, default to #ffffff
  • backgroundColor1: color at the top of the background, default to '#ffffff'
  • backgroundColor2: color at the bottom of the background, default to '#ffffff'
  • backgroundImageUrl: URL string that describes where to load the image used for background, default to ''
  • background: turn on/off rendering of background. If this is set to false, the background area will be transparent. Default to false
  • renderMode: render mode, default to 'flat'. Available options: 'point', 'wireframe', 'flat', 'smooth', 'texture', 'textureflat', 'texturesmooth'
  • faceCulling: turn on/off back-face culling for all meshes, default to true
  • definition: quality level of rendering, default to "high"
  • mipMapping: turn on/off mip-mapping, default to false
  • sphereMapUrl: URL string that describes where to load the image used for sphere mapping, default to ''
  • progressBar: turn on/off the progress bar when loading, default to false.
  • renderer: set to 'webgl' to enable WebGL for rendering, default to 'webgl'.

  • mouse: mouse behavior. Set to false to be non-interactive. Available: false, 'rotate', 'zoom', 'pan' (defaults to 'rotate')

  • height: canvas height. Set to 'auto' to attempt to fill container (default).

  • width: canvas width. Set to 'auto' to attempt to fill container (default).

Contribution