Learn R Programming

AFM (version 1.2.0)

exportToSTL: Export an AFM Image as a STL format file.

Description

Export an AFMImage as a STL format file thanks to the rgl package. The STL file can be used as an input for a 3D printing software tool. exportToSTL is compatible with slicr (http://slic3r.org) version 1.2.9 (GPL v3 licence). In order to 3D print the AFM Image with slic3r, do as following:
  • Use "File> Repair STL file..." menu option to create a file with the obj extension.
  • Use "Add" button below the menu to display your AFM Image on the print board
  • Right click on your AFM image. Use "Scale> uniformely" option, Set "15%" for your AFM image to fit your printing board

Usage

exportToSTL(AFMImage3DModelAnalysis, AFMImage, stlfullfilename)

Arguments

AFMImage3DModelAnalysis
AFMImage
an AFMImage from Atomic Force Microscopy
stlfullfilename
directory and filename to save as a stl file

Examples

Run this code
library(AFM)

data(AFMImageOfAluminiumInterface)
newAFMImage<-extractAFMImage(AFMImageOfAluminiumInterface, cornerX=50, cornerY=50, size=64)
exportToSTL(newAFMImage, paste(tempdir(), "myFile.stl", sep="/"))

Run the code above in your browser using DataLab