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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jscad-object-api

v3.0.6

Published

Object wrappers of the JSCAD geometries

Downloads

59

Readme

Modules

geom2

geom2.Geom2

Class Geom2

Holds a JSCAD 2D geometry (geom2) that represents a 2D geometry consisting of outlines, where each outline is an ordered list of points.

Kind: static class of geom2

new exports.Geom2([geometry])

Create a new Geom2 from the given geometry

| Param | Type | Description | | --- | --- | --- | | [geometry] | geom2 | a JSCAD geom2 geometry |

Example

import { Geom2 } from "jscad-object-api"

const ashape = Geom2.square()
const bshape = Geom2.square({size: 10})
const cshape = ashape.translateY(5).extrudeLinear({height: 250})

geom2.toSides() ⇒ Array

Return the sides

Kind: instance method of Geom2
Returns: Array - list of sides

geom2.measureArea() ⇒ Float

Kind: instance method of Geom2

Geom2.fromPoints() ⇒ Geom2

Kind: static method of Geom2
Returns: Geom2 - new geometry

Geom2.circle() ⇒ Geom2

Create a circle using the given options.

Kind: static method of Geom2
Returns: Geom2 - new geometry

geom3

geom3.Geom3

Class Geom3

Holds a JSCAD 3D geometry consisting of a set of polygons.

Kind: static class of geom3

new exports.Geom3([geometry])

| Param | Type | Description | | --- | --- | --- | | [geometry] | geom3 | a provided geometry |

Example

import { Geom3 } from "jscad-object-api"

const ashape = Geom3.cylinder()
const bshape = Geom3.cylinder({height: 2, radius: 10})
const cshare = bshape.translate([3, 2, 1])

geom3.toPolygons() ⇒ Array

Kind: instance method of Geom3
Returns: Array - list of polygons

Geom3.fromVertices() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.cube() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.cuboid() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.cylinder() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.cylinderElliptic() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.ellipsoid() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.geodesicSphere() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.polyhedron() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.roundedCuboid() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.roundedCylinder() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.sphere() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

Geom3.torus() ⇒ Geom3

Kind: static method of Geom3
Returns: Geom3 - new geometry

path2

path2.Path2

Class Path2

Holds a JSCAD path2 geometry consisting of an ordered set of points. A path can be open or closed, i.e. the start and end are the same.

Kind: static class of path2

new exports.Path2([geometry])

| Param | Type | Description | | --- | --- | --- | | [geometry] | path2 | a provided geometry |

Example

import { Path2 } from "jscad-object-api"

let path1 = Path2.fromPoints([[10,10], [-10,10], [-10,-10], [10,-10]], true) // closed
let path2 = Part2.arc({
  center: [5, 5],
  radius: 10,
  startangle: 90,
  endangle: 180,
  resolution: 36,
})
let path3 = path1.concat(path2)

path2.toPoints() ⇒ Array

Kind: instance method of Path2
Returns: Array - list of points

Path2.fromPoints() ⇒ Path2

Kind: static method of Path2
Returns: Path2 - new geometry

Path2.arc() ⇒ Path2

Kind: static method of Path2
Returns: Path2 - new geometry

Path2.line() ⇒ Path2

Kind: static method of Path2
Returns: Path2 - new geometry