# 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 [](https://www.npmjs.com/package/geom-export-obj) [](https://www.npmjs.com/package/geom-export-obj) [](https://bundlephobia.com/package/geom-export-obj) [](https://github.com/dmnsgn/geom-export-obj/blob/main/package.json) [](https://github.com/microsoft/TypeScript) [](https://conventionalcommits.org) [](https://github.com/prettier/prettier) [](https://github.com/eslint/eslint) [](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. [](https://paypal.me/dmnsgn) [](https://commerce.coinbase.com/checkout/56cbdf28-e323-48d8-9c98-7019e72c97f3) [](https://twitter.com/dmnsgn)  ## 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
objectGeometry definition. All optional.
objectOffsets to for cells. Useful if appending to another obj string. Used internally.
objectOptions for exporter.
objectGeomExportObjReturnValue](#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).