
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
@justinribeiro/stl-part-viewer
Advanced tools
A web component that displays an STL model with three.js and Lit.
A web component that displays an STL model with three.js and Lit.
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>
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 |
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>
FAQs
A web component that displays an STL model with three.js and Lit.
The npm package @justinribeiro/stl-part-viewer receives a total of 8 weekly downloads. As such, @justinribeiro/stl-part-viewer popularity was classified as not popular.
We found that @justinribeiro/stl-part-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.