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

cnc-gen

v1.3.5

Published

Gcode generator for basic CNC operations.

Downloads

22

Readme

cnc-gen

USE AT YOUR OWN RISK

Currently, this is (barely) capable of generating a few CNC tool paths for my Snapmaker A350 that fit my workflow.

It is a work in progress, you can play with it if you like, but at your own risk. My goal is for these tools to grow useful enough that I no longer have to boot some big program like Fusion 360 for utility operations like surfacing or finishing edges.

I have no other machines to test the generated code against, so use this at your own risk.

Install for command-line tools

npm install -g cnc-gen

Defaults

The default milling bit size for operations is 3.175mm or 1/8".

By default, the programs will output the CNC code to the console. If you want to write it to a file, be sure to use the -o filename.cnc option.

Create Facing Program

Set your work origin to the center-point of the area you want to surface.

The following command will create a facing program that will mill a 100mm x 200mm area to a depth of 1mm. Because it runs the tool around the edge of the area you specify, it actually clear an additional 0.5 times your mill size around the 100mm x 200mm area, making the actual area cleared 106.35mm x 206.35mm when using a 6.35mm end mill bit, 3.175mm extra on all 4 sides.

If you need the bit to stay entirely inside your bounds, you need to manually subtract your mill diameter from your dimensions, although it will still go outside by 0.2*6.35mm or 1.27mm when descending in the helical pattern to your target depth.

cnc-gen-face -w 100 -l 200

If you want to write the program to a file, you can use this command.

cnc-gen-face -w 100 -l 200 -o face-100x200x1mm-3.175mm-fem.cnc

Always run a boundary check on the machine before starting any CNC program, to ensure your tool head stays clear of your clamps and is your stock is correctly sized and placed.

Create Drilling Program

If you don't have a chuck to hold a regular drill-bit, you can use this program to bore holes in your stock.

End-mills are designed to cut laterally. This program creates a CNC file that wll create the hole with a helical movement pattern, compatible with an end-mill bit.

Set your work origin to the center point for the hole you want to drill.

This command will generate CNC code to create a 5mm hole 10mm deep using a 3.175mm (1/8") end-mill.

cnc-gen-drill -t 3.175 -d 5 -z 10

Create M4 Bolt Program

This will bore a countersunk hole for an M4 bolt where you set your CNC's origin. You must use a 3.175mm flat-end mill bit for this operation.

This command will generate CNC code to bore a total depth of 10mm. The shaft will be 6mm long, and the remaining 4mm will be bored at the top as a countersink.

cnc-gen-m4 -d 10 -s 6

Contributing

Feel free to fork the repo and issue pull-requests back. Please make sure tests pass first (npm test).

From a design standpoint, I'm continuing to make some fairly large structural changes. I'd like things to be more functional / stateless, and I'd like it to be easier to add new patterns (operations) and ultimately to compose patterns.

Please file any issues you find here.

You can look any the ongoing work here.

Change Log

You can read the change log here.