Polygon area

Home Forums General discussions Polygon area

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Péter Baksa 1 month ago.

  • 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
    Participant

    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
    Software Engineer, Library Team
    GRAPHISOFT SE

You must be logged in to reply to this topic.