Skip to content

polygon-city/polygons-to-obj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polygons to OBJ

Takes polygon and face arrays and returns an OBJ string

Usage

var polygons2obj = require("polygons-to-obj");

var polygons = [[[x,y,z], [...]], [[x,y,z], [...]]];
var faces = [[[v1,v2,v3], [...]], [[v1,v2,v3], [...]]];

// Point to use as [0, 0, 0] origin for conversion
var origin = [0, 0, 0];

// Vertical offset to apply to points
var verticalOffset = 0;

// Z-axis is the vertical axis
var zUP = false;

var objStr = polygons2obj(polygons, faces, origin, verticalOffset, zUP);

About

Takes polygon and face arrays and returns an OBJ string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published