Polygon area

Home Forums General discussions Polygon area

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #18494
      Jože Marinko
      Participant

      I need to calculate area from polygon, which is defined with matrix points:
      x[i],y[i]…
      I found macro PolygonOperation, but result is wrong. In some cases smaller, in some cases even negative.

      My syntax is:

      for i=1 to segments
      put x[i],y[i]
      next i
      put x[1],y[1]
      call “PolygonOperations”,
      parameters opcode=6,
      srcPolygon1=2,
      result=1,
      returned_parameters _area

    • #18496
      Péter Baksa
      Keymaster

      Hi,

      Does it help if your polygon is regularized? Counterclockwise order of points, no self-intersection, no points on other edges.

      Currently we don’t have an universal solution for area calculation in the ARCHICAD Library.
      You can write your own code using the Shoelace formula.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #18591
      Harry Alex
      Blocked

      For any two basic polygons of equivalent territory, the Bolyai–Gerwien hypothesis declares that the first can be cut into polygonal pieces which can be reassembled to shape the subsequent polygon.

    • #18836
      Nader Belal
      Participant

      @Harry Alex,

      The Shoelace formula is easier to implement.

      @Jože Marinko

      Note: For calculating area of close non-self intersection polygon, the vertices must go anti-clock wise, and for negative areas (holes) you must go clock wise.

      @Harru Alex,

      Can you implement Bolyai–Gerwien hypothesis in GDL ?

Viewing 3 reply threads
  • The forum ‘General discussions’ is closed to new topics and replies.