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

point-cloud-convert

v0.0.3

Published

A simple JavaScript tool converting point cloud file from one format to another.

Downloads

15

Readme

point-cloud-convert

point-cloud-convert is a simple JavaScript tool converting point cloud file from one format to another, which can use as both of JavaScript API in a browser or in Node.js and CLI.

At present, the following convertions are supported.

  • pcd <-> ply
  • asc <-> pcd
  • asc <-> ply

Installation

In a browser:

<script src="point-cloud-convert.js"></script>

In Node.js:

If you want point-cloud-convert as API for your JavaScript project, run the code:

$ npm install --save point-cloud-convert

If you want point-cloud-convert as CLI to convert your local files, run the code:

$ npm install --global point-cloud-convert

How to use

(1) use point-cloud-convert as API

There is only one function named pointCloudConvert,which takes two parameters, the first is input string, and the second is conversion type string, and return a output string. conversion type can be one of the following strings so far:

pcd2ply, pcd2asc, ply2pcd, ply2asc, asc2pcd, asc2ply .

in a browser:

<script src="point-cloud-convert.js"></script>
<script>
	// inputStr has been loaded
    var conversionType = 'ply2pcd';  // convert ply to pcd
    var outputStr = pointCloudConvert(inputStr, conversionType);
</script>

in Node.js:

const pointCloudConvert = require('node_module/point-cloud-convert/point-cloud-convert.js');
// [attention] it is not require('point-cloud-convert'), because index.js is used as CLI.

// inputStr has been loaded
let conversionType = 'ply2pcd';  // convert ply to pcd
let outputStr = pointCloudConvert(inputStr, conversionType);

(2) use point-cloud-convert as CLI

point-cloud-convert can be also used as CLI. it is really convenient and fase to convert point cloud file from one format to another, All you need to do is installing the Node.js and point-cloud-convert package in global. If you have already installed Node.js , then run the following code to install point-cloud-convert globally.

$ npm install --global point-cloud-convert

The help doc:

Usage: point-cloud-convert [options] <src> <dest>

Options:
  -v, --version      output the version number
  -t, --type <type>  set format conversion type, eg. pcd2ply, it will be inferred if not set
  -d, --directory    convert all files from one directory to another
  -h, --help         output usage information

Supported all conversion type among ply, pcd and asc, eg. pcd2ply, asc2pcd

Examples:
  $ point-cloud-convert demo.pcd demo.ply -t pcd2ply
  $ point-cloue-convert demo.pcd demo.ply
  $ point-cloud-convert ./input ./output -t ply2pcd -d

Examples:

  • Convert demo.pcd to demo.ply . Option -t pcd2ply specifies the conversion type.

    $ point-cloud-convert demo.pcd demo.ply -t pcd2ply

    This command will convert demo.pcd to demo.ply.

  • Indeed, if you forget type -t option, the conversion type will be inferred from the source filename demo.pcd and destination filename demo.ply. I think it is more convenient for converting a single file.

    $ point-cloud-convert demo.pcd demo.ply
  • Converting directory is also supported by using -d option. In the following example, ./input is source directory, ./output is destination directory. But in this case, -t option is necessary, because conversion type can not be inferred any more. Again, do not forget -d option when converting point cloud directory.

    $ point-cloud-convert ./input ./output -t ply2pcd -d

    This command will convert all ply files in ./input directory to pcd files in ./output directory.

TODO

  • [ ] Create a simple browser demo to show basic function of point-cloud-convert.
  • [ ] Add README-zh.md.
  • [ ] Support point cloud format wrl.
  • [ ] Support converting directory recursively (using -r option).

Bugs

Please use the Github issue tracker for all bugs and feature requests.