2

I have a Set of points in 3D with x y z coordinates. i would lik eto calculate the convex Hull of these points. I haf gone through algorithms available but i couldnt do it in Perl. Perl Math:ConvextHull module also i have checked but i didnt get how to give these 3D points as input. Please help me.

                 X        Y       Z

POINT   1     -15.037   7.344  14.621  
POINT   2     -15.467   6.281  15.522  
POINT   3     -15.147   6.738  16.954  
POINT   4     -13.998   7.141  17.197  
POINT   5     -14.697   4.973  15.165  
POINT   6     -15.115   4.480  13.780  
POINT   7     -14.965   3.895  16.188  
POINT   8     -16.607   4.347  13.471  
POINT   9     -16.087   6.731  17.929  
POINT  10     -15.826   6.999  19.343  
POINT  11     -15.144   5.847  20.038  
gthm
  • 1,878
  • 4
  • 26
  • 37

2 Answers2

1

Math::ConvexHull won't help because it only works with 2D data (X and Y).

Unfortunately it looks like Math::Geometry::Planar has the same limitation.

Zaid
  • 36,680
  • 16
  • 86
  • 155
  • ... and Math::ConvexHull::MonotoneChain (the successor to Math::ConvexHull) won't help really help for 3D either. For 3D, my limited understanding is that you'd probably want to implement Chan's algorithm. – tsee Jan 18 '12 at 22:25
1

Half an answer: perhaps you can solve your problem by driving the Qhull library/accompanying command-line programs from Perl.

I didn't test because I don't know the math.

daxim
  • 39,270
  • 4
  • 65
  • 132