All Projects → justinribeiro → stl-part-viewer

justinribeiro / stl-part-viewer

Licence: MIT license
A lit-element web component that uses Three.js to display an STL model file.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to stl-part-viewer

obvi
A Polymer 3+ webcomponent / button for doing speech recognition
Stars: ✭ 54 (+184.21%)
Mutual labels:  polymer, webcomponent
abdonrd.com
My little personal website
Stars: ✭ 16 (-15.79%)
Mutual labels:  polymer
revodropdown
Minimalistic dropdown and auto-complete component with filtering and keyboard support
Stars: ✭ 20 (+5.26%)
Mutual labels:  webcomponent
eslint-plugin-lit
lit-html support for ESLint
Stars: ✭ 90 (+373.68%)
Mutual labels:  polymer
twc
TypeScript based, boilerplate-less, Polymer toolbox friendly Polymer Modules
Stars: ✭ 33 (+73.68%)
Mutual labels:  polymer
ProjectTabManager
Have too many tabs opened on Chrome? This extension helps you organize your tabs on windows per projects.
Stars: ✭ 98 (+415.79%)
Mutual labels:  polymer
go-poly-tenant
Go + Polymer MultiTenancy on AppEngine
Stars: ✭ 22 (+15.79%)
Mutual labels:  polymer
emoji-slider
A slider control with emojis
Stars: ✭ 40 (+110.53%)
Mutual labels:  webcomponent
multi-chart
lit-element building blocks for charts and visualization (based on d3.js v5)
Stars: ✭ 24 (+26.32%)
Mutual labels:  polymer
android-3d-model-viewer
Android app to load 3D models in obj, stl, dae & gltf format using pure OpenGL ES 2.0. Published on Play Store https://play.google.com/store/apps/details?id=org.andresoviedo.dddmodel2
Stars: ✭ 150 (+689.47%)
Mutual labels:  stl
ibm-toolbar
Horizontal toolbar containing items that can be used for label, navigation, search and actions
Stars: ✭ 18 (-5.26%)
Mutual labels:  polymer
cstl
STL style library with red-black tree implementation in C
Stars: ✭ 34 (+78.95%)
Mutual labels:  stl
gw2-ninja
A collection of Guild Wars 2 Tools.
Stars: ✭ 17 (-10.53%)
Mutual labels:  polymer
paper-chip
A chip web component made with Polymer 2 following Material Design guidelines
Stars: ✭ 30 (+57.89%)
Mutual labels:  polymer
MKS WIFI upgrade with BeePrint web interface
Firmware for MKS WiFi module from Makerbase with BeePrint Web Interface, tested with Flying Bear Ghost 5/Ghost 4/Reborn
Stars: ✭ 35 (+84.21%)
Mutual labels:  stl
elm-simple-gtd
Reimagination of SimpleGTD.com using Elm and Polymer.
Stars: ✭ 24 (+26.32%)
Mutual labels:  polymer
fullcalendar-calendar
Web Component wrapper for FullCalendar
Stars: ✭ 21 (+10.53%)
Mutual labels:  polymer
gif-player
Control your animated GIFs
Stars: ✭ 120 (+531.58%)
Mutual labels:  webcomponent
synthesis
🔥 Synthesis is Meteor + Polymer
Stars: ✭ 28 (+47.37%)
Mutual labels:  polymer
react-intersection-observer-hook
React hook to use IntersectionObserver declaratively
Stars: ✭ 58 (+205.26%)
Mutual labels:  intersectionobserver

npm version

<stl-part-viewer>

A web component that displays an STL model with three.js and Lit.

screenshot of stl-part-viewer

Features

  • Uses Intersection Observer to load STL files when only in the viewport.
  • Uses Intersection Observer to pause rendering of scene when viewer is not in viewport
  • Loads Binary and ASCII STL files
  • Built as a web component on Polymer 3 / LitElement

Install

This web component is built with Polymer 3 and ES modules in mind and is available on NPM:

Install stl-part-viewer:

npm i @justinribeiro/stl-part-viewer
# or
yarn add @justinribeiro/stl-part-viewer

After install, import into your project:

import 'stl-part-viewer';

Finally, use as required:

<stl-part-viewer src="part.stl"></stl-part-viewer>

Attributes

The web component allows certain attributes to be give a little additional flexibility.

Name Description Default
src Location of the STL file you want the viewer to load ``
fullscreen Text value of the full screen button Full Screen
backgroundcolor Set the background color of the scene; rgb(), hsl(), or X11 color string 0xf1f1f1
floorcolor Set the floor plane color; rgb(), hsl(), or X11 color string 0x666666
modelcolor Set the model color; rgb(), hsl(), or X11 color string 0xfffe57

Polyfills Required

stl-part-viewer utilizes Custom Elements and Shadow DOM (Web Components), and Intersection Observer. You may need the Lit polyfill-support depending on what you're trying to target.

Within your project, you can load them as such:

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../node_modules/lit/platform-support.js">
<script src="../node_modules/intersection-observer/intersection-observer.js"></script>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].