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

@mitchallen/maze2openscad

v0.2.3

Published

Code generate a maze as an OpenSCAD include file

Downloads

3

Readme

@mitchallen/maze2openscad

Code generate a maze as an OpenSCAD include file

Generate an include file to be used in OpenSCAD to display a randomly generated maze. The maze can then be exported for 3D printing.

OpenSCAD works on both Windows and Mac.


Installation

You must use npm 2.7.0 or higher because of the scoped package name.

$ npm init
$ npm install @mitchallen/maze2openscad --save

Usage

  • If you don't have a copy of OpenSCAD you can download it for free from here: http://www.openscad.org

  • Create a new test folder and change to it

  • Execute the following at the command line:

      $ npm init
      $ npm install @mitchallen/maze2openscad --save
        
  • Browse to: https://github.com/mitchallen/maze2openscad/

  • Find the file maze.scad in the root of the project and make a local copy of it.

  • Edit the include path at the top of the file and change it to:

      include <maze-data.scad>
  • Create a file called index.js

  • Add the following content to index.js and save it:

      var mazeFactory = require("@mitchallen/maze2openscad");
    
      var mazeGenerator = mazeFactory.Square({ x: 5, y: 6 });
    
      mazeGenerator.generate();
    
      mazeGenerator.printBoard();
    
      mazeGenerator.writeDataFile('maze-data.scad');
        
  • At the command line type:

      node index.js
        
  • Start OpenSCAD and open maze.scad

  • You should see a generated maze

  • Leave OpenSCAD running and run node index.js to see a new maze appear in OpenSCAD

Examples

You can find examples, such as the one above in the the examples folder on the repo.

Customization

You can customize the maze.scad file that you copied from github. Just remember that any customization to the code generated file will be overwritten unless you move it elsewhere.

Testing

To test, go to the root folder and type (sans $):

$ npm test

Repo(s)


Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.


Version History

Version 0.2.3

  • Circle method takes additional parameters

Version 0.2.2

  • added Circle method
  • updated examples to use Square

Version 0.2.1

  • The create method is deprecated in favor of Square
  • Bumped version number because breaking backward compatability

Version 0.1.3

  • updated to latest maze generator to allow square, circle, hexagon and triangle

Version 0.1.2

  • uses latest maze generator to allow masked mazes

Version 0.1.1

  • updated examples to use published module

Version 0.1.0

  • initial release