[R-sig-Geo] alphashape3d and shapefile export

paallen at attglobal.net paallen at attglobal.net
Wed Oct 24 17:54:33 CEST 2012


Hi all,

I am working with mineral exploration data consisting of surface & 
subsurface data (3d points, 3d polylines, & 3d polygons).  I mainly work up 
all my statistics in R and then export things out to ArcGIS.  

I have discovered the package alphashape3d and it looks like a great tool 
to create 3D wireframes.  But it is a bit unstable and tends to crash.  Has 
anyone else experiemented with this packages and have any suggestions?

Also does anyone know how best to export the 3d-triangles produced 
from this program to something ArcGIS can read.  I would like to open 
them in ArcGIS as a 3d-polygon (triangle ) file and then convert them to a 
multi-patch for viewing in the 3D-Analyst with all the rest of the data.

The output of my first sucessuful test of this program is included below.

thanks,
Phil

> d
     x   y   z
1  100 100 100
2  200 100 100
3  200 200 200
4  100 200 200
5   50  50 150
6  100 100 200
7  200 100 200
8  100 200 100
9  200 200 100
10  50 150 150
> d.ashape.obj <- ashape3d(as.matrix(d), alpha=200, pert=TRUE)
Warning: The general position assumption is not satisfied
Perturbation of the data set was required
> d.ashape.obj
$tetra
   v1 v2 v3 v4         rhoT fc:200
9   2  3  7  9 1.042910e+03      0
9   2  3  8  9 8.660254e+01      1
9   3  4  8  9 9.904612e+01      1
10  4  6  8 10 7.500000e+01      1
10  1  6  8 10 7.500000e+01      1
8   3  4  6  8 8.660254e+01      1
10  4  5  6 10 1.057594e+11      0
10  1  5  6 10 5.590170e+01      1
7   3  4  6  7 7.507452e+01      1
8   2  3  6  8 8.660254e+01      1
8   1  2  6  8 8.660254e+01      1
7   2  5  6  7 1.030776e+02      1
6   1  2  5  6 1.030776e+02      1
7   2  3  6  7 8.660254e+01      1

$triang
   tr1 tr2 tr3 on.ch attached      rhoT          muT          MuT fc:200
     1   2   6     0        0  70.71068 8.660254e+01 1.030776e+02      1
     1   5   6     0        0  53.03301 5.590170e+01 1.030776e+02      1
     1   6   8     0        1  70.71068 7.500000e+01 8.660254e+01      1
     1   6  10     0        0  53.03301 5.590170e+01 7.500000e+01      1
     2   3   6     0        1  81.64966 8.660254e+01 8.660254e+01      1
     2   3   7     0        0  70.71068 8.660254e+01 1.042910e+03      2
     2   3   8     0        1  81.64966 8.660254e+01 8.660254e+01      1
     2   3   9     0        0  70.71068 8.660254e+01 1.042910e+03      2
     2   5   6     0        1  82.91562 1.030776e+02 1.030776e+02      1
     2   6   7     0        0  70.71068 8.660254e+01 1.030776e+02      1
     2   6   8     0        1  81.64966 8.660254e+01 8.660254e+01      1
     3   4   6     0        0  70.71068 7.507452e+01 8.660254e+01      1
     3   4   8     0        0  70.71068 8.660254e+01 9.904612e+01      1
     3   6   7     0        0  70.71068 7.507452e+01 8.660254e+01      1
     3   6   8     0        1  81.64966 8.660254e+01 8.660254e+01      1
     3   8   9     0        0  70.71068 8.660254e+01 9.904612e+01      1
     4   6   8     0        1  70.71068 7.500000e+01 8.660254e+01      1
     4   6  10     0        0  53.03301 7.500000e+01 1.057594e+11      2
     5   6  10     0        0  53.03301 5.590170e+01 1.057594e+11      2
     6   8  10     0        1  75.00000 7.500000e+01 7.500000e+01      1
10   4   5   6     1        1 101.55048 1.057594e+11 1.057594e+11      0
6    1   2   5     1        1 101.55048 1.030776e+02 1.030776e+02      2
9    3   4   9     1        1  70.71068 9.904612e+01 9.904612e+01      2
10   4   5  10     1        1 101.55048 1.057594e+11 1.057594e+11      0
10   1   5  10     1        0  53.03301 5.590170e+01 5.590170e+01      2
7    3   4   7     1        1  70.71068 7.507452e+01 7.507452e+01      2
8    1   2   8     1        0  70.71068 8.660254e+01 8.660254e+01      2
7    2   5   7     1        1  86.96264 1.030776e+02 1.030776e+02      2
9    2   7   9     1        1  70.71068 1.042910e+03 1.042910e+03      0
9    2   8   9     1        0  70.71068 8.660254e+01 8.660254e+01      2
10   4   8  10     1        0  53.03301 7.500000e+01 7.500000e+01      2
10   1   8  10     1        0  53.03301 7.500000e+01 7.500000e+01      2
9    3   7   9     1        1  70.71068 1.042910e+03 1.042910e+03      0
9    4   8   9     1        1  70.71068 9.904612e+01 9.904612e+01      2
7    4   6   7     1        1  70.71068 7.507452e+01 7.507452e+01      2
7    5   6   7     1        1 101.55048 1.030776e+02 1.030776e+02      2

$edge
      ed1 ed2 on.ch attached     rhoT          muT          MuT fc:200
 [1,]   1   2     1        0 50.00000 7.071068e+01 1.030776e+02      2
 [2,]   1   5     1        0 43.30127 5.303301e+01 1.030776e+02      2
 [3,]   1   6     0        0 50.00000 5.303301e+01 1.030776e+02      1
 [4,]   1   8     1        0 50.00000 5.303301e+01 8.660254e+01      2
 [5,]   1  10     1        0 43.30127 5.303301e+01 7.500000e+01      2
 [6,]   2   3     0        0 70.71068 7.071068e+01 1.042910e+03      2
 [7,]   2   5     1        1 82.91562 1.030776e+02 1.030776e+02      2
 [8,]   2   6     0        0 70.71068 7.071068e+01 1.030776e+02      1
 [9,]   2   7     1        0 50.00000 7.071068e+01 1.042910e+03      2
[10,]   2   8     1        0 70.71068 7.071068e+01 8.660254e+01      2
[11,]   2   9     1        0 50.00000 7.071068e+01 1.042910e+03      2
[12,]   3   4     1        0 50.00000 7.071068e+01 9.904612e+01      2
[13,]   3   6     0        1 70.71068 7.071068e+01 8.660254e+01      1
[14,]   3   7     1        0 50.00000 7.071068e+01 1.042910e+03      2
[15,]   3   8     0        0 70.71068 7.071068e+01 9.904612e+01      1
[16,]   3   9     1        0 50.00000 7.071068e+01 1.042910e+03      2
[17,]   4   5     1        1 82.91562 1.057594e+11 1.057594e+11      0
[18,]   4   6     1        0 50.00000 5.303301e+01 1.057594e+11      2
[19,]   4   7     1        1 70.71068 7.507452e+01 7.507452e+01      2
[20,]   4   8     1        0 50.00000 5.303301e+01 9.904612e+01      2
[21,]   4   9     1        1 70.71068 9.904612e+01 9.904612e+01      2
[22,]   4  10     1        0 43.30127 5.303301e+01 1.057594e+11      2
[23,]   5   6     1        0 43.30127 5.303301e+01 1.057594e+11      2
[24,]   5   7     1        1 82.91562 1.030776e+02 1.030776e+02      2
[25,]   5  10     1        0 50.00000 5.303301e+01 1.057594e+11      2
[26,]   6   7     1        0 50.00000 7.071068e+01 1.030776e+02      2
[27,]   6   8     0        1 70.71068 7.500000e+01 8.660254e+01      1
[28,]   6  10     0        0 43.30127 5.303301e+01 1.057594e+11      2
[29,]   7   9     1        1 70.71068 1.042910e+03 1.042910e+03      0
[30,]   8   9     1        0 50.00000 7.071068e+01 9.904612e+01      2
[31,]   8  10     1        0 43.30127 5.303301e+01 7.500000e+01      2

$vertex
      v1 on.ch      muT          MuT fc:200
 [1,]  1     1 43.30127 1.030776e+02      2
 [2,]  2     1 50.00000 1.042910e+03      2
 [3,]  3     1 50.00000 1.042910e+03      2
 [4,]  4     1 43.30127 1.057594e+11      2
 [5,]  5     1 43.30127 1.057594e+11      2
 [6,]  6     1 43.30127 1.057594e+11      2
 [7,]  7     1 50.00000 1.042910e+03      2
 [8,]  8     1 43.30127 9.904612e+01      2
 [9,]  9     1 50.00000 1.042910e+03      2
[10,] 10     1 43.30127 1.057594e+11      2

$x
     x   y   z
1  100 100 100
2  200 100 100
3  200 200 200
4  100 200 200
5   50  50 150
6  100 100 200
7  200 100 200
8  100 200 100
9  200 200 100
10  50 150 150

$alpha
[1] 200

$xpert
     x   y   z
1  100 100 100
2  200 100 100
3  200 200 200
4  100 200 200
5   50  50 150
6  100 100 200
7  200 100 200
8  100 200 100
9  200 200 100
10  50 150 150

attr(,"class")
[1] "ashape3d"
>



More information about the R-sig-Geo mailing list