# pcd-format

> Encode & Decode PCD file

Latest version **0.0.7** (published 2018-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install pcd-format
pnpm add pcd-format
yarn add pcd-format
bun add pcd-format
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2018-12-14 |
| First published | 2018-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 57 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Bingwen Shi, Zhen Wang, Di Cai |
| Maintainers | bingwen |
| Keywords | pcl, pcd, format, parse, stringify |

## Links

- npm: https://www.npmjs.com/package/pcd-format
- Repository: https://github.com/bingwen/pcd-format
- Homepage: https://github.com/bingwen/pcd-format#readme
- Issues: https://github.com/bingwen/pcd-format/issues
- npm.io page: https://npm.io/package/pcd-format

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2018-12-14
- 0.0.6 — 2018-11-20
- 0.0.5 — 2018-11-13

## README

```
 _______  _______  ______          _______  _______  _______  _______  _______ _________
(  ____ )(  ____ \(  __  \        (  ____ \(  ___  )(  ____ )(       )(  ___  )\__   __/
| (    )|| (    \/| (  \  )       | (    \/| (   ) || (    )|| () () || (   ) |   ) (   
| (____)|| |      | |   ) | _____ | (__    | |   | || (____)|| || || || (___) |   | |   
|  _____)| |      | |   | |(_____)|  __)   | |   | ||     __)| |(_)| ||  ___  |   | |   
| (      | |      | |   ) |       | (      | |   | || (\ (   | |   | || (   ) |   | |   
| )      | (____/\| (__/  )       | )      | (___) || ) \ \__| )   ( || )   ( |   | |   
|/       (_______/(______/        |/       (_______)|/   \__/|/     \||/     \|   )_(   
                                                                                        
```

> pcd-format is a js lib to encode 3D Point Cloud to ArrayBuffer or decode from ArrayBuffer.
> [PCD File Format](http://pointclouds.org/documentation/tutorials/pcd_file_format.php)
> [C++ PCD IO](https://github.com/PointCloudLibrary/pcl/blob/master/io/src/pcd_io.cpp)

## Install

    npm install pcd-format --save

or

    yarn add pcd-format

## Usage

    const fs = require('fs');
    const PCDFormat = require('pcd-format');

    // Read & Parse
    let dataBuffer = fs.readFileSync(path);
    let pcd = PCDFormat.parse(dataBuffer.buffer, false)

    console.log("Header:")
    console.log(pcd.header)

    console.log("Points Size:")
    console.log(pcd.points.length)
    console.log("First Point:")
    console.log(pcd.points[0])
    console.log("Last Point:")
    console.log(pcd.points[pcd.points.length - 1])

    // Stringify & Save
    let arrayBuffer = PCDFormat.stringify(pcd.header, pcd.points, false)
    fs.writeFileSync(path, Buffer.from(arrayBuffer));

---
_Source: https://npm.io/package/pcd-format · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
