Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Latest commit

 

History

History
55 lines (34 loc) · 1.34 KB

README.md

File metadata and controls

55 lines (34 loc) · 1.34 KB

Note: This repository has been archived

This project was developed under a previous phase of the Yale Digital Humanities Lab. Now a part of Yale Library’s Computational Methods and Data department, the Lab no longer includes this project in its scope of work. As such, it will receive no further updates.

Vertices

Extract fixed-size vertex data from .obj and .jpg files

visualization of bunnies

Installation

pip install vertices

3D Usage

To extract 3D vertices from an .obj file:

from vertices import ObjParser

# parse an object file
obj = ObjParser('bunny.obj')

# get the default vertices in the loaded obj file
verts = obj.vertices

# get a specified number of vertices from the obj file
verts = obj.get_n_vertices(10000)

This process will recursively subdivide faces until the desired number of vertices are accumulated.

The returned object will be a numpy array with shape (10000, 3).

2D Usage

To extract 2D vertices from a .jpg file:

from vertices import ImgParser

# parse an input image file
img = ImgParser('dylan.jpg')

# get the default number of vertices identified in the image file
verts = img.vertices

# get a specified number of vertices from the jpg file
verts = img.get_n_vertices(10000)

The returned object will be a numpy array with shape (10000, 2).