New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-stl-model-viewer

Package Overview
Dependencies
Maintainers
5
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-stl-model-viewer

Angular component for rendering a STL model

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
357
decreased by-35.68%
Maintainers
5
Weekly downloads
 
Created
Source

angular-stl-model-viewer

This is an angular component to render stl-models with THREE.js.

Installation

  • yarn add angular-stl-model-viewer
  • npm install angular-stl-model-viewer

Usage

  • import StlModelViewerModule to your app module
  • use stl-model-viewer component in your html <stl-model-viewer [stlModels]="['example.stl']"></stl-model-viewer>

Example

The working basic example can be found in our live demo.

Configuration

Input Properties

AttrTypeDefaultDetails
stlModelsstring[]-List of stl model paths
hasControlsbooleantrueIf true, the user can interact with the stl-models
cameraTHREE.CameraTHREE.PerspectiveCamera( 35, WindowInnerWidth / WindowInnerHeight, 1, 15 )The projection mode used for rendering the scene
cameraTargetTHREE.Vector3THREE.Vector3( 0, 0, 0 )The orientation point for the camera
lightTHREE.LightTHREE.PointLight( 0xffffff )Illuminates the scene
materialTHREE.MeshMaterialTypeTHREE.MeshPhongMaterial({ color: 0xc4c4c4, shininess: 100, specular: 0x111111 })Casts more precisely the possible materials assignable to a [ [Mesh]] object
sceneTHREE.SceneTHREE.Scene()Scenes allow you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras
rendererTHREE.WebGLRendererTHREE.WebGLRenderer({ antialias: true })Displays your beautifully crafted scenes using WebGL
controlsTHREE.OrbitControlsTHREE.OrbitControlsAllow the camera to orbit around a target
meshOptionsMeshOptions[][]customize mesh options per stl-model

Output Events

AttrDetails
renderedEmitted when the stl-model is rendered.

MeshOptionsType

AttrTypeDefaultDetails
castShadowbooleantrueGets rendered into shadow map
positionTHREE.Vector3THREE.Vector3( 0, 0, 0 )Object's local position
receiveShadowbooleantrueMaterial gets baked in shadow receiving
scaleTHREE.Vector3THREE.Vector3( 0.03, 0.03, 0.03 )Object's local scale
upTHREE.Vector3-Up direction
userData{[key: string]: any}-An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned
visibleboolean-Object gets rendered if true

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using yarn lint and yarn test.

Keywords

FAQs

Package last updated on 30 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc