read_obj: Read BIC .obj files

View source: R/minc_vis3D.R

read_objR Documentation

Read BIC .obj files

Description

Read the BIC .obj 3D file format. This parses simple obj files to be used with RMINC 3D plotting functions.

Usage

read_obj(bic_obj, use_civet_triangles = FALSE)

Arguments

bic_obj

character file name of the obj file to read in

use_civet_triangles

logical, whether or not to use the predefined triangle matrix common to obj files produced by CIVET 1.1.12, saves IO time when triangles are known in advance.

Details

This parser is not robust at all and relies on a strict structure for the .obj file at the present. It must be organized with a block of vertices, seperated by a space from a block of colour information (which is ignored), a space separated block of metadata and a space seperated block of multiples of 3, followed finally by a block of triangle membership. Only the vertex and triangle blocks are read in.

Value

A two element list of class bic_obj containing a 3xV vertex_matrix denoting the global coordinates of the each vertex and a 3xT triangle_matrix containing triples of indices to the vertex matrix representing individual triangles.


Mouse-Imaging-Centre/RMINC documentation built on Nov. 12, 2022, 1:50 p.m.