# geom-export-obj **Repository Path**: mirrors-gis/geom-export-obj ## Basic Information - **Project Name**: geom-export-obj - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-29 - **Last Updated**: 2024-12-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # geom-export-obj [![npm version](https://img.shields.io/npm/v/geom-export-obj)](https://www.npmjs.com/package/geom-export-obj) [![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)](https://www.npmjs.com/package/geom-export-obj) [![npm minzipped size](https://img.shields.io/bundlephobia/minzip/geom-export-obj)](https://bundlephobia.com/package/geom-export-obj) [![dependencies](https://img.shields.io/librariesio/release/npm/geom-export-obj)](https://github.com/dmnsgn/geom-export-obj/blob/main/package.json) [![types](https://img.shields.io/npm/types/geom-export-obj)](https://github.com/microsoft/TypeScript) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-fa6673.svg)](https://conventionalcommits.org) [![styled with prettier](https://img.shields.io/badge/styled_with-Prettier-f8bc45.svg?logo=prettier)](https://github.com/prettier/prettier) [![linted with eslint](https://img.shields.io/badge/linted_with-ES_Lint-4B32C3.svg?logo=eslint)](https://github.com/eslint/eslint) [![license](https://img.shields.io/github/license/dmnsgn/geom-export-obj)](https://github.com/dmnsgn/geom-export-obj/blob/main/LICENSE.md) Convert one (or more) simplicial complex geometry (positions/cells/normals/uvs) into an OBJ string. [![paypal](https://img.shields.io/badge/donate-paypal-informational?logo=paypal)](https://paypal.me/dmnsgn) [![coinbase](https://img.shields.io/badge/donate-coinbase-informational?logo=coinbase)](https://commerce.coinbase.com/checkout/56cbdf28-e323-48d8-9c98-7019e72c97f3) [![twitter](https://img.shields.io/twitter/follow/dmnsgn?style=social)](https://twitter.com/dmnsgn) ![](https://raw.githubusercontent.com/dmnsgn/geom-export-obj/main/screenshot.png) ## Installation ```bash npm install geom-export-obj ``` ## Usage ```js import geomExportObj from "geom-export-obj"; import { cube } from "primitive-geometry"; console.log(geomExportObj(cube()).output); ``` ## API ## Modules
geomExportObj
## Typedefs
SimplicialComplex : object

Geometry definition. All optional.

GeomExportObjOffsets : object

Offsets to for cells. Useful if appending to another obj string. Used internally.

GeomExportObjOptions : object

Options for exporter.

GeomExportObjReturnValue : object
## geomExportObj - [geomExportObj](#module_geomExportObj) - [geomExportObj(geometries, [options])](#exp_module_geomExportObj--geomExportObj) ⇒ [GeomExportObjReturnValue](#GeomExportObjReturnValue) ⏏ - [.parse(geometry, [offsets], [defaultName])](#module_geomExportObj--geomExportObj.parse) ⇒ string ### geomExportObj(geometries, [options]) ⇒ [GeomExportObjReturnValue](#GeomExportObjReturnValue) ⏏ Parse one or more simplicial complex geometry and return an obj string and vertices offsets. **Kind**: Exported function | Param | Type | Default | | ---------- | -------------------------------------------------------------------------------------------------------------------------- | --------------- | | geometries | [SimplicialComplex](#SimplicialComplex) \| [Array.<SimplicialComplex>](#SimplicialComplex) | | | [options] | [GeomExportObjOptions](#GeomExportObjOptions) | {} | #### geomExportObj.parse(geometry, [offsets], [defaultName]) ⇒ string Parse a simplicial complex and return an obj string **Kind**: static method of [geomExportObj](#exp_module_geomExportObj--geomExportObj) **See**: http://paulbourke.net/dataformats/obj/ | Param | Type | Default | Description | | ------------- | ---------------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------------- | | geometry | [SimplicialComplex](#SimplicialComplex) | | | | [offsets] | [GeomExportObjOffsets](#GeomExportObjOffsets) | { positions: 0, normals: 0, uvs: 0 }} | | | [defaultName] | string | | A name for the object if geometry.name is not specified. | ## SimplicialComplex : object Geometry definition. All optional. **Kind**: global typedef **Properties** | Name | Type | Description | | -------------- | --------------------------------- | ------------------------- | | positions | Array.<number> | | | normals | Array.<number> | | | uvs | Array.<number> | | | cells | Array.<number> | | | name | string | The object name. | | [materialName] | string | The object material name. | ## GeomExportObjOffsets : object Offsets to for cells. Useful if appending to another obj string. Used internally. **Kind**: global typedef **Properties** | Name | Type | | --------- | ------------------- | | positions | number | | normals | number | | uvs | number | ## GeomExportObjOptions : object Options for exporter. **Kind**: global typedef **Properties** | Name | Type | Default | Description | | --------- | ---------------------------------------------------------- | ------------------------------------------------- | ----------------------------------- | | [header] | string | "# geom-export-obj\\n" | Header to be prepended to the file. | | [prefix] | string | "Mesh\_" | Prefix for object names. | | [offsets] | [GeomExportObjOffsets](#GeomExportObjOffsets) | { positions: 0, normals: 0, uvs: 0 } | The initial offsets for cells. | ## GeomExportObjReturnValue : object **Kind**: global typedef **Properties** | Name | Type | Description | | ------- | ---------------------------------------------------------- | -------------------- | | output | string | The obj as a string. | | offsets | [GeomExportObjOffsets](#GeomExportObjOffsets) | | ## License MIT. See [license file](https://github.com/dmnsgn/geom-export-obj/blob/main/LICENSE.md).