0

I am new to python.

I have 3d data points , say x ranges from (118 to 123), y ranges from (0 to 10), z ranges from (-4 to 4).

So using these data points , how to calculate the surface area (Axyz) using python.

Any help is thankful.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Ram
  • 11
  • 1
  • 5
  • 3
    Depending on what you are given, the answer might differs. Are you given coordinates ranges (which should define some sort of a cube), easy answer :) or is it a set of point defining an arbitrary surface? This would require some polygonization and might be complicated. – Samy Arous Jun 10 '13 at 10:22
  • @Icfseth. It makes an arbitrary surface. I have created the surface and meshed it. After this how to calculate the surface area from that mesh. – Ram Jun 11 '13 at 02:12
  • a mesh is a set of polygons, usually triangles (depends on the 3D engine). Calculating each triangle surface and then summing them up is the way to go. The most difficult part is to generate the polygons from the set of points. – Samy Arous Jun 11 '13 at 08:57

1 Answers1

1

If you know how to compute the surface mathematically, given height, width and depth, all you need to do is extract these parameters from the tuples - using tuple unpacking:

x_from, x_to = (118, 123)
y_from, y_to = (0, 10)
z_from, z_to = (-4, 4)

now

height = y_to - y_from

etc.

Elazar
  • 20,415
  • 4
  • 46
  • 67
  • If it's a cube, the formula to calculate its surface(not volume) is x*y*2 + x*z*2 + z*y*2 which is the sum of the 6 surfaces, each 2 being on a different plane of the 3D space. – Samy Arous Jun 10 '13 at 10:24
  • @Elazar can u help me in finding out an equation for the surface formed from these 3d data points! – Ram Jun 11 '13 at 02:57
  • @Elazar But its not a cube in my case. – Ram Jun 11 '13 at 04:51
  • so your question is not clear. do you have an arbitrary set of points (x,y,z)? if so, it is a difficult task. – Elazar Jun 11 '13 at 05:30