Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-stl-model-viewer

Package Overview
Dependencies
Maintainers
0
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

  • 13.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
271
increased by9.72%
Maintainers
0
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>
  • alternatively use [stlModelFiles]="['stlFileContent']"

Example

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

Configuration

Input Properties

AttrTypeDefaultDetails
stlModelsstring[]empty arrayList of stl model paths
stlModelFilesstring[]empty arrayList of stl model files/content
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
centeredbooleantrueFlag if models should be centered

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 npm run lint and npm run test.

Keywords

FAQs

Package last updated on 20 Nov 2024

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