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

madeleinejs

v0.9.0

Published

Pure javaScript 3D Model Viewer

Downloads

75

Readme

Madeleine.js

Madeleine.js is a 3D Model parser & renderer for STL files (ASCII and binary both).

Madeleine.js uses Three.js (r68) as its 3D Engine, and was inspired by the demo code of tonylukasavage.

Madeleine.js is smart enough to distinguish whether stl files are ASCII or binary, and is able to create and handle multiple 3D model viewers (WARNING: Multiple rendering may slow down the speed). Also, Madeleine.js helps you to immediately render any stl file as you upload!

Features

  • Parse, render and visualize STL format files.
  • Automatically distinguish binary and ASCII, and parse it properly.
  • Accept STL file from external url or user file upload.
  • Support rendering multiple models (also multi upload).
  • Provide various themes for model viewer.
  • Allow user to interact with the model via mouse actions.
  • Support capturing the rendered 3D model (Implementing)
  • Support downloading the original stl file (Implementing)
  • Support different viewpoint (Implementing)
  • Support fullscreen mode (Implementing)
  • And more features will be added later!

DEMO

Visit DEMO Website to see the demo!

For developers, download or clone this repository and locate it on your web server root. You can check working demo by visiting repo/examples/index.html from your browser. Download any stl file and see how well it works!

Getting Started

First, include resources into element of your code.

<link href="src/css/Madeleine.css" rel="stylesheet">
<script src="src/lib/stats.js"></script>
<script src="src/lib/detector.js"></script>
<script src="src/lib/three.min.js"></script>
<script src="src/Madeleine.js"></script>

1. Immediate File Upload

All you need to do is simply asking Lily (is Madeleine's sister) to get ready for file upload. She will take care of taking files, parsing, rendering and visualizing them.

<form id="myForm" name="myForm">
    <input type="file" id="myForm" name="myForm" multiple>
</form>
<div id="target"></div>

<script>
window.onload = function(){
    Lily.ready({
        target: 'target',  // target div id
        file: 'files',  // file input id
        path: '../src' // path to source directory from current html file
    });
}; 
</script>

2. Render from file path

If you know the url or path to the stl file, call Madeleine directly with target div id and the file path.

<div id="target" class="madeleine"></div>

<script>
window.onload = function(){
    var madeleine = new Madeleine({
      target: 'target', // target div id
      data: 'path/to/file.stl', // data path
      path: '../src' // path to source directory from current html file
    });
}; 
</script>

License

This code is under MIT License. You can do anything you want with my code, as long as you leave the attribution. It will be grateful if you contact me for interesting ideas to do with Madeleine.js. I'm willing to co-work with you!

Who am I?

I'm Junho Jin :)