Git Product home page Git Product logo

geom-export-obj's Introduction

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) into an OBJ string.

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

Param Type Default
geometries SimplicialComplex | Array.<SimplicialComplex>
[options] GeomExportObjOptions {}

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

Parse a simplicial complex and return an obj string

Kind: static method of geomExportObj See: http://paulbourke.net/dataformats/obj/

Param Type Default Description
geometry SimplicialComplex
[offsets] 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 { 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

License

MIT. See license file.

geom-export-obj's People

Contributors

dmnsgn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.