🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

geom-export-obj

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geom-export-obj

Convert one (or more) simplicial complex geometry (positions/cells/normals/uvs/vertexColors) into an OBJ string (optionally optimized with number precision to reduce its size).

2.1.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

geom-export-obj

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Convert one (or more) simplicial complex geometry (positions/cells/normals/uvs/vertexColors) into an OBJ string (optionally optimized with number precision to reduce its size).

paypal coinbase twitter

Installation

npm install geom-export-obj

Usage

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(geometries, [options]) ⇒ GeomExportObjReturnValue

Parse one or more simplicial complex geometry and return an obj string and vertices offsets.

Kind: Exported function

ParamTypeDefault
geometriesSimplicialComplex | Array.<SimplicialComplex>
[options]GeomExportObjOptions{}

geomExportObj.parse(geometry, [offsets], [defaultName], [precision]) ⇒ string

Parse a simplicial complex and return an obj string

Kind: static method of geomExportObj See

ParamTypeDefaultDescription
geometrySimplicialComplex
[offsets]GeomExportObjOffsets{ positions: 0, normals: 0, uvs: 0 }}
[defaultName]stringA name for the object if geometry.name is not specified.
[precision]numberDecimal digit precision for positions/normals/uvs/vertexColors.

SimplicialComplex : object

Geometry definition. All optional.

Kind: global typedef Properties

NameTypeDescription
positionsArray.<number>
normalsArray.<number>
uvsArray.<number>
cellsArray.<number>
namestringThe object name.
[materialName]stringThe object material name.

GeomExportObjOffsets : object

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

Kind: global typedef Properties

NameType
positionsnumber
normalsnumber
uvsnumber

GeomExportObjOptions : object

Options for exporter.

Kind: global typedef Properties

NameTypeDefaultDescription
[header]string"# geom-export-obj\n"Header to be prepended to the file.
[prefix]string"Mesh_"Prefix for object names.
[offsets]GeomExportObjOffsets{ positions: 0, normals: 0, uvs: 0 }The initial offsets for cells.
[precision]numberDecimal digit precision for positions/normals/uvs/vertexColors.

GeomExportObjReturnValue : object

Kind: global typedef Properties

NameTypeDescription
outputstringThe obj as a string.
offsetsGeomExportObjOffsets

License

MIT. See license file.

Keywords

geom

FAQs

Package last updated on 13 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts