0

Although this post may be related previous ones (e.g., here), it also involves a larger dataset (i.e., numbers of points ~1e5), which describes the surface of a 3D object (think of a single particle in high definition), defined by regularly-spaced (x,y,z) value forming a closed volume. These points only describe the surface; the interior space is empty. I want to plot this surface using R. My first attempt used plot3d in rgl:

library(rgl)
d=read.table("./sample_particle.txt", col.names=c("x","y","z")) 
x=d$x
y=d$y
z=d$z
p <- plot3d(x,y,z,colrvar=z,col=gray(seq(0.1,1,length=5)))

With this result plot3d result

I now want to plot the surface of this object (and not simply the discrete points), but need some guidance as to how to accomplish this. The particle shape varies between a rough cube and sphere, and thus a given x, y coordinate will occur twice: does this make construction of Delaunay triangles impossible? If not, can anyone suggest a routine that can deal with larger datasets?

Community
  • 1
  • 1
Rolf
  • 139
  • 1
  • 9
  • It will probably help potential answerers if you post or link to an excerpt of the data – arvi1000 Jan 17 '15 at 18:34
  • That's a **lot** of points to generate a mesh/surface for! You may want to consider subsampling; the resultant plot will not suffer significantly. Now, there are tools in (I believe) the `plot3d` or `misc3d` packages which will convert your x,y,z location data to matrices compatible with functions such as `surface3d` or `lattice:wiregrid` . That may be a better way to go. – Carl Witthoft Jan 17 '15 at 19:07
  • @Carl, thanks very much for this response and pointer -- I will look in these packages ... Cheers //rolf – Rolf Jan 19 '15 at 10:20

0 Answers0