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

open3d

v0.2.4

Published

Open3d is a 3d geometry library for javascript.

Readme

Open3d

banner

Open3d is a 3d geometry library for JavaScript/Typescript inspired by RhinoCommon API.

This library is created because so far there has not been a proper typed 3d geometry library for node environment. It is often necessary to calculate vector math or basic intersections of lines or planes but it is very cumbersome or error-prone to invent the wheel. And Open3d tries to save you from the distress. It is written in Typescript which supports native types for your project without the hassle of installing "@types/xxx". Also, it is a pure package that has zero dependencies.

It currently has Point3d, Vector3d, Line, Polyline, Transform (or Matrix4x4), BoundingBox, Plane and Intersection definitions.

Install

via Yarn

yarn add open3d

or via NPM

npm i open3d

or if you prefer to drive without safe belt via CDN:

<script src="https://unpkg.com/open3d"></script>

Usage

If you are familiar with RhinoCommon, then Open3d should be very intuitive to use. Even if not, the functionalities are self-explanatory.

Example 1: Find the closest point on a line for a test point

import { Line, Point3d } from 'open3d';
// if you use CDN, you can use the global parameter "Open3d" without import, such as "Open3d.Vector"

const p = new Point3d(1, 2, 3);

const from = new Point3d(6, 7, 8);
const to = new Point3d(-2, 0, 3);
const line = new Line(from, to);

const closestPt = line.ClosestPoint(p);

Example 2: Intersection of two lines

import { Line, Point3d, Intersection } from 'open3d';

const line1 = new Line(new Point3d(-4, -1, 0), new Point3d(5, 0, 0));

const line2 = new Line(new Point3d(0, -2, 0), new Point3d(3, 7, 0));

const intersection = Intersection.LineLine(line1, line2);

Example 3: Transform a plane and find the normal of the transformed plane

import { Line, Vector3d, Point3d, Transform, Plane } from 'open3d';

// translation
const translate = Transform.Translation(new Vector3d(1, 2, 3));

// rotation
const rotation = Transform.Rotation(Math.PI / 3, new Vector3d(5, 2, 0), new Point3d(-2, 2, 9));

// scale
const scale = Transform.Scale(new Point3d(1, 2, 3), 3);

// mirror
const mirror = Transform.Mirror(new Plane(Point3d.Origin, new Vector3d(8, 2, -4), new Vector3d(0, 8, 5)));

// combine transform
const transformation = Transform.CombineTransforms([translate, rotation, scale, mirror]);

// transform plane
const plane = new Plane(Point3d.Origin, Vector3d.XAxis, Vector3d.YAxis);
const transformedPlane = plane.Transform(transformation);
const normal = transformedPlane.Normal;

API Reference

The full API reference can be found at https://open3d.chen.works/.

Contribute

Contributors

Any form of contributions to fix/optimize or extend the library are welcome! Please take advantage of Github's issues or pull requests. :)

If you realy find it useful and like to contribute straightforwardly, feel free to buy me a coffee :)

License

MIT