stl_to_x3p: Convert an STL file to an x3p file

Description Usage Arguments Value Examples

View source: R/df_to_x3p.R

Description

STL files describe 3d objects as mesh objects. Here, we assume that the 3d object consists of a 3d surface on the top of a rectangular, equi-spaced 2d grid. We further assume, that each node of the STL file describes the x-y location of an actual measurement. These measurements are then converted into the surface matrix of an x3p object. The resolution is derived from the distance between consecutive x and y nodes.

Usage

1

Arguments

stl

STL file object or path to the file

Value

x3p object

Examples

1
2
3
4
5
6
7
## Not run: 
# the website https://touchterrain.geol.iastate.edu/ allows a download
# of a 3d printable terrain model. For an example we suggest to download a file from there.
gc <- rgl::readSTL("<PATH TO STL FILE>", plot=FALSE)
x3p <- stl_to_x3p(gc)

## End(Not run)

x3ptools documentation built on Nov. 27, 2021, 1:06 a.m.