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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jscad-scad-api

v3.0.2

Published

JSCAD bridge for OpenSCAD designs

Readme

jscad-scad-api

JSCAD bridge for OpenSCAD designs

Overview

This packages provides a OpenSCAD-like API. See OpenSCAD User Manual

This allows OpenSCAD designs to be ported to JSCAD, and gives OpenSCAD designers a slightly easier learning experience. However, OpenSCAD designs still need to be converted to JSCAD (and JavaScript).

Usage

Implementation Notes

OpenSCAD is based on some bazzare non-procedural language, while JSCAD is 100% JavaScript. A lot of language constructs are the same but there will be some pain, and learning required.

This package doesn't try to reproduce OpenSCAD, but does provide most of the functionality found in OpenSCAD. The main difference is that the 'named' parameters are required. This shouldn't be hard but OpenSCAD designs may need some changes. For example, OpenSCAD translate([1,2,3]) needs to be changed to translate(v=[1,2,3])

2D Objects

| Shape | Parameters | Notes | | ------- | ------------- | ----------- | | circle | r, d | | | polygon | points, paths | | | square | size, center | | | text | | UNSUPPORTED |

NOTE: JSCAD also supports arc, ellipse, line, roundedRectangle, star, and triangle.

3D Objects

| Shape | Parameters | Notes | | ---------- | ------------------------------- | ----------- | | cube | size, center | | | sphere | r, d | | | cylinder | h, r, r1, r2, d, d1, d2, center | | | polyhedron | points, faces | | | surface | | UNSUPPORTED |

NOTE: JSCAD also supports cylinderElliptic, ellipsoid, geodesicSphere, roundedCuboid, and torus.

Transforms

| Function | Parameters | Notes | | -------------- | ----------------- | ----------- | | color | c | | | rotate | a, v | | | translate | v | | | mirror | v | | | multmatrix | m | | | scale | v | | | resize | newsize, auto | | | offset | r, delta, chamfer | | | minkowski | | UNSUPPORTED | | hull | | |

NOTE: JSCAD also supports align and center.

NOTE: JSCAD also supports measurements of area, bounding box, bounding sphers, center, center of mass, demisions, and volume.

Dimension Changes 2D/3D

| Function | Parameters | Notes | | -------------- | --------------------------------------- | ----------- | | projection | | UNSUPPORTED | | linear_extrude | height, v, center, twist, slices, scale | | | rotate_extrude | angle | |

NOTE: JSCAD also supports extrudeHelical and extrudeRectangular.

Boolean Combinations

| Function | Parameters | Notes | | ------------ | ---------- | ----- | | union | | | | difference | | | | intersection | | |

NOTE: JSCAD also supports scission.

Mathematical Functions

  • cos
  • sin
  • tan
  • acos
  • asin
  • atan
  • atan2
  • abs
  • ceil
  • concat
  • cross
  • exp
  • floor
  • ln
  • len
  • log
  • lookup
  • max
  • min
  • norm
  • pow
  • rands
  • round
  • sign
  • sqrt

String Functions

| Function | Parameters | Notes | | -------- | ---------- | ----- | | str | ...values | | | chr | number | | | ord | string | |

Type Test Functions

| Function | Parameters | Notes | | --------- | ---------- | ----- | | is_undef | value | | | is_bool | value | | | is_num | value | | | is_string | value | | | is_list | value | |

Language Features

| Function | Parameters | Notes | | ----------- | ---------- | ----- | | assert | ...values | | | echo | ...values | | | search | | UNSUPPORTED | | version | | | | version_num | | |

If you don't see a function above then it's not supported, or the JavaScript language may have the same construct.

License

The MIT License (MIT) (unless specified otherwise)