3

I've got data representing 3D surfaces (i.e. earthquake fault planes) in xyz point format. I'd like to create a 3D representation of these surfaces. I've had some success using rgl and akima, however it can't really handle geometry that may fold back on itself or have multiple z values at the same x,y point. Alternatively, using geometry (the convhulln function from qhull) I can create convex hulls that show up nicely in rgl but these are closed surfaces where in reality, the objects are open (don't completely enclose the point set). Is there a way to create these surfaces and render them, preferably in rgl?

EDIT

To clarify, the points are in a point cloud that defines the surface. They have varying density of coverage across the surface. However, the main issue is that the surface is one-sided, not closed, and I don't know how to generate a mesh/surface that isn't closed for more complex geometry.

As an example...

require(rgl)
require(akima)
faultdata<-cbind(c(1,1,1,2,2,2),c(1,1,1,2,2,2),c(10,20,-10,10,20,-10))
x <- faultdata[,1]
y <- faultdata[,2]
z <- faultdata[,3]
s <- interp(x,z,y,duplicate="strip")
surface3d(s$x,s$y,s$z,col=a,add=T)

This creates generally what I want. However, for planes that are more complex this doesn't necessarily work. e.g. where the data are:

faultdata<-cbind(c(2,2,2,2,2,2),c(1,1,1,2,2,2),c(10,20,-10,10,20,-10))

I can't use this approach because the points are all vertically co-planar. I also can't use convhulln because of the same issue and in general I don't want a closed hull, I want a surface. I looked at alphashape3d and it looks promising, but I'm not sure how to go about using it for this problem.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
DWAHL
  • 156
  • 6
  • You could be interested in WebGL based lib, like [PhiloGL](http://philogb.github.com/). This [demo](http://www.senchalabs.org/philogl/PhiloGL/examples/temperatureAnomalies/) it's compelling – CapelliC Jun 06 '12 at 02:31
  • You can certainly do this in rgl (which provides all the graphics primitives you would need), it's just harder (because not as pre-packaged) than either of the examples you've given above (single surface, convex hulls). If you post example data someone may give it a shot ... – Ben Bolker Jun 06 '12 at 05:15
  • Is the input a point cloud? Can you provide an example picture to have an idea of the density? – sloriot Jun 06 '12 at 11:45
  • The input is a point cloud (x,y,z) and for some faults is relatively dense, for others, not as much. Basically some faults are both well characterized (i.e. the geology is well known) and well parameterized (lots of defined points). Other faults are not well characterized or parameterized, and some are in between. My problem is trying to create a surface that I can render in 3D that looks approximately "right". This isn't something that needs to be scientifically "right" necessarily but shouldn't look obviously wrong (i.e. the fault surface closes back in on itself, etc.). – DWAHL Jun 07 '12 at 01:43

1 Answers1

2

How do you determine how the points are connected together as a surface? By distance? That can be one way, and the alphashape3d package might be of use. Otherwise, if you know exactly how they are to be connected, then you can visualize it directly with rgl structures.

mdsumner
  • 29,099
  • 6
  • 83
  • 91
  • I have a series of points that define points on the respective fault surface. They have been defined by geologists/seismologists who basically create a point cloud in space that defines the surface. They have varying density of coverage across the surface. Some are simply sparse coverage of the edges of a plane, others have very detailed coverage of the edges and an undulating 3D face defined at many points. But my main problem is that I don't know how to create a one-sided surface that can be rendered from the point cloud that doesn't close back in on itself. – DWAHL Jun 07 '12 at 01:48
  • I would expand this detail in your question and illustrate it, it will help someone answer it. – mdsumner Jun 07 '12 at 04:09
  • Well, I think for the most part using alphashape3d and playing with other bits and pieces gets me close to what I want. It's a bit of a headache, since I have to change the alpha factor manually until I get something that makes sense for the geometry I have, but I can probably optimize that somewhat by analyzing the point cloud some. Still a few problems with specific weird errors, but I think it's mostly formatting. Thanks. – DWAHL Jun 08 '12 at 18:02
  • As a quick follow up, if I take the 1st quartile of matrix distances between the points for alpha, I get a reasonable representation. – DWAHL Jun 08 '12 at 18:27