Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. calculate polygon area and its centre in 3d

calculate polygon area and its centre in 3d

Scheduled Pinned Locked Moved Algorithms
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    beko
    wrote on last edited by
    #1

    Hello, I have some 3d points (not self intersecting). the shape of the points is looking like / (forward slash) from profile, It is actually a slice of a 3d object, cut with a rotated plane. I want to calculate the area of 3d points and its centre. For 2d case, i use the following http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/[^] but, how can i extend the 2d case to 3d for area and its centre? Thanks in advance. Bekir.

    A C 2 Replies Last reply
    0
    • B beko

      Hello, I have some 3d points (not self intersecting). the shape of the points is looking like / (forward slash) from profile, It is actually a slice of a 3d object, cut with a rotated plane. I want to calculate the area of 3d points and its centre. For 2d case, i use the following http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/[^] but, how can i extend the 2d case to 3d for area and its centre? Thanks in advance. Bekir.

      A Offline
      A Offline
      Alan Balkany
      wrote on last edited by
      #2

      If you could rotate the points so they all have the same Z coordinate, you could then ignore the Z coordinate and apply the 2D formulas for the area and centroid. Rotation will not change the area. Apply the reverse rotation to the calculated centroid to get the centroid of the original 3D points.

      B 1 Reply Last reply
      0
      • A Alan Balkany

        If you could rotate the points so they all have the same Z coordinate, you could then ignore the Z coordinate and apply the 2D formulas for the area and centroid. Rotation will not change the area. Apply the reverse rotation to the calculated centroid to get the centroid of the original 3D points.

        B Offline
        B Offline
        beko
        wrote on last edited by
        #3

        Thank you, i will try that and i think it will solve the problem but it will create a bit of overhead. Bekir.

        1 Reply Last reply
        0
        • B beko

          Hello, I have some 3d points (not self intersecting). the shape of the points is looking like / (forward slash) from profile, It is actually a slice of a 3d object, cut with a rotated plane. I want to calculate the area of 3d points and its centre. For 2d case, i use the following http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/[^] but, how can i extend the 2d case to 3d for area and its centre? Thanks in advance. Bekir.

          C Offline
          C Offline
          cp9876
          wrote on last edited by
          #4

          What you want is a 2D coordinate system in the plane of intersection, then you can use your equation for area. Assume that your original points are represented as vectors {Vk} from some origin O (this is your original 3D coordinate system). As you have the equation of the plane, choose one point on it as the new origin Op, and choose two orthogonal unit vectors (U1, U2) that lie in the plane as the new axes. (i.e. choose two orthogonal vectors orthogonal to the normal of the plane) Then in your new coordinate system, the 2D coordinates of the point Vk are: ( (Vk-Op).U1, (Vk-Op).U2 ) i.e. you simply project the 3D vector from your new origin onto your new axes. Note - this includes Alan's solution, the vectors U1 and U2 would be rows of his rotation matrix. It's just a different way of looking at things.

          Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups