Description Usage Arguments Details Value Author(s) References See Also Examples
These functions read and write STL files. This is a simple file format that
is commonly used in 3D printing. It does not represent text,
only triangles. The writeSTL
function converts some RGL object
types to triangles.
1 2 3 4 5 6 7 |
con |
A connection or filename. |
ascii |
Whether to use the ASCII format or the binary format. |
plot |
On reading, should the object be plotted? |
... |
If plotting, other parameters to pass to |
pointRadius, lineRadius |
The radius of points and lines relative to the overall scale of the figure. |
pointShape |
A mesh shape to use for points. It is scaled by the |
lineSides |
Lines are rendered as cylinders with this many sides. |
ids |
The identifiers (from |
The current implementation is limited. For reading, it ignores normals and color information. For writing, it only outputs triangles, quads, planes, spheres, points, line segments, line strips and surfaces, and does not write color information. Lines and points are rendered in an isometric scale: if your data scales vary, they will look strange.
Since the STL format only allows one object per file, all RGL objects are combined into a single object when output.
The output file is readable by Blender and Meshlab; the latter can write in a number of other formats, including U3D, suitable for import into a PDF document.
readSTL
invisibly returns the object id if plot = TRUE
, or (visibly)
a matrix of vertices of the triangles if not.
writeSTL
invisibly returns the name of the connection to which the
data was written.
Duncan Murdoch
The file format was found on Wikipedia on October 25, 2012. I learned
about the STL file format from David Smith's blog reporting on
Ian Walker's r2stl
function.
scene3d
saves a copy of a scene to an R variable;
rglwidget
, writeASY
, writePLY
, writeOBJ
and writeSTL
write the scene to a file in various other formats.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.