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

jsartoolkit-nft

v0.6.1

Published

Emscripten port of ARToolKit5 to JavaScript. It is a lighter version of Jsartoolkit5 with only NFT markerless support

Downloads

35

Readme

Built with Grunt Build Status Build Status

JSARToolKitNFT

Emscripten port of ARToolKit to JavaScript. Modified and lighter version of JSARToolKit5.

Try the example !! kalwalt.github.io/jsartoolkitNFT/examples/arNFT_example.html

Markers Types

JSARToolKitNFT support only this types of markers:

  • NFT (natural feature tracking) markers

NOTE:

When writing JavaScript and making changes be aware that the emscripten uglifier does not support the ES6 syntax.


Project Structure

  • build/ (compiled debug and minified versions of JSARToolKitNFT)
  • doc/ (documentation, coming...)
  • emscripten/ (source code for ARToolKit)
  • examples/ (demos and examples using JSARToolKitNFT)
  • js/ (compiled versions of ARToolKit.js with Three.js helper api)
  • tools/ (build scripts for building JSARToolKitNFT)

WebAssembly

JSARToolKitNFT supports WebAssembly. The libary builds two WebAssembly artifacts during the build process. These are build/artoolkitNFT_wasm.js and build/artoolkitNFT_wasm.wasm. To use those, include the artoolkit_wasm.js into your html page and define var artoolkitNFT_wasm_url = '<<PATH TO>>/artoolkitNFT_wasm.wasm'; before loading the artoolkit_wasm.js file, like this:

<script type='text/javascript'>
      var artoolkitNFT_wasm_url = '../build/artoolkitNFT_wasm.wasm';
</script>
<script src="../build/artoolkitNFT_wasm.js"></script>

As loading the WebAssembly artifact is done asynchronously, there is a callback that is called when everything is ready.

window.addEventListener('artoolkitNFT-loaded', () => {
    //do artoolkit stuff here
});

See examples/simple_image_wasm.html for details.

Clone the repository

  1. Clone this repository
  2. Clone ARToolKit5 project to get the latest source files. From within JSARToolKitNFT directory do git submodule update --init. If you already cloned ARToolKit5 to a different directory you can:
  • create a link in the jsartoolkitNFT/emscripten/ directory that points to ARToolKit5 (jsartoolkitNFT/emscripten/artoolkit5) (Linux and macOS only)
  • or, set the ARTOOLKIT5_ROOT environment variable to point to your ARToolKit5 clone
  • or, change the tools/makem.js file to point to your artoolkit5 clone (line 20)

Build the project

Recommended: Build using Docker

  1. Install Docker (if you havn't already): get Docker
  2. Clone artoolkit5 repository on your machine: git submodule update --init
  3. npm install
  4. From inside jsartoolkitNFT directory run docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten-slim:latest bash to download and start the container, in preparation for the build
  5. docker exec emscripten npm run build-local to build JS version of artoolkit5
  6. docker exec emscripten npm run build-local-no-libar to build JS version of artoolkit5 without rebuilding libar.bc
  7. docker stop emscripten to stop the container after the build, if needed
  8. docker rm emscripten to remove the container
  9. docker rmi trzeci/emscripten-slim:latest to remove the Docker image, if you don't need it anymore
  10. The build artifacts will appear in /build. There's a build with debug symbols in artoolkitNFT.debug.js file and the optimized build with bundled JS API in artoolkitNFT.min.js; also, a WebAssembly build artoolkitNFT_wasm.js and artoolkitNFT_wasm.wasm

⚠️ Not recommended ⚠️ : Build local with manual emscripten setup

To prevent issues with Emscripten setup and to not have to maintain several build environments (macOS, Windows, Linux) we only maintain the Build using Docker. Following are the instructions of the last know build on Linux which we verified are working. Use at own risk. Not working on macOS!

  1. Install build tools

  2. Install node.js (https://nodejs.org/en/)

  3. Install python2 (https://www.python.org/downloads/)

  4. Install emscripten (https://emscripten.org/docs/getting_started/downloads.html#download-and-install) We used emscripten version 1.39.5-fastcomp ~~1.38.44-fastcomp~~

JSARToolKitNFT aim is to create a Javascript version of artoolkit5. First, you need the artoolkit5 repository on your machine:

  1. Clone ARToolKit5 project to get the latest source files. From within jsartoolkit5 directory do git submodule update --init. If you already cloned ARToolKit5 to a different directory you can:
  • create a link in the jsartoolkitNFT/emscripten/ directory that points to ARToolKit5 (jsartoolkitNFT/emscripten/artoolkit5)
  • or, set the ARTOOLKIT5_ROOT environment variable to point to your ARToolKit5 clone
  • or, change the tools/makem.js file to point to your artoolkit5 clone (line 20)
  1. Building

  2. Make sure EMSCRIPTEN env variable is set (e.g. EMSCRIPTEN=/usr/lib/emsdk_portable/emscripten/master/ node tools/makem.js

  3. Run npm install

  4. Run npm run build-local

During development, you can run npm run watch, it will rebuild the library everytime you change ./js/ directory. You can also run the script with the option npm run build-local-no-libar if you have already build libar.bc and you don't want to rebuild.

  1. The built ASM.js files are in /build. There's a build with debug symbols in artoolkitNFT.debug.js and the optimized build with bundled JS API in artoolkitNFT.min.js.