hexagon logo

Area Calculation from points

I am measuring a feature that is somewhat round but has lot of jagged edges. I want to use all of the areas to calculate the area. I am measuring this using hundreds of points. Anyone have any ideas ? I have searched for answers but can't seem to come up with any.
Parents
  • The CAD Value is 563.4mm I was getting 720mm in offline PCDMIS after troubleshooting the variables.

    Then scoured the internet and found this: https://www.mathopenref.com/coordpolygonarea.html


    Which led me to this code: (sorry for the lazy variables)
    ASSIGN/V9=(PRF1.HIT[2..PRF1.NUMHITS].X*PRF1.HIT[1..(PRF1.NUMHITS-1)].Y)
                ASSIGN/V10=(PRF1.HIT[1..(PRF1.NUMHITS-1)].X*PRF1.HIT[2..PRF1.NUMHITS].Y)
                ASSIGN/V11=ABS(SUM(V10-V9)/2)
    
                ASSIGN/V19=(PRF2.HIT[2..PRF2.NUMHITS].X*PRF2.HIT[1..(PRF2.NUMHITS-1)].Y)
                ASSIGN/V110=(PRF2.HIT[1..(PRF2.NUMHITS-1)].X*PRF2.HIT[2..PRF2.NUMHITS].Y)
                ASSIGN/V111=ABS(SUM(-V110+V19)/2)
    
                ASSIGN/V119=(PRF3.HIT[2..PRF3.NUMHITS].X*PRF3.HIT[1..(PRF3.NUMHITS-1)].Y)
                ASSIGN/V1110=(PRF3.HIT[1..(PRF3.NUMHITS-1)].X*PRF3.HIT[2..PRF3.NUMHITS].Y)
                ASSIGN/V1111=ABS(SUM(-V1110+V119)/2)
    
                ASSIGN/AREA=V11-V111-V1111


    It also did not work in the offline mode and returned an area of 620mm but the two symmetrical internal features were different by 200mm to each other. Ran real samples online and got 557 and 553.

    Consensus: I will have to retest Jefman's code and will update if it works for the shape.

    & thanks for the troubleshooting and mathematical explanation.

    Attached Files
Reply
  • The CAD Value is 563.4mm I was getting 720mm in offline PCDMIS after troubleshooting the variables.

    Then scoured the internet and found this: https://www.mathopenref.com/coordpolygonarea.html


    Which led me to this code: (sorry for the lazy variables)
    ASSIGN/V9=(PRF1.HIT[2..PRF1.NUMHITS].X*PRF1.HIT[1..(PRF1.NUMHITS-1)].Y)
                ASSIGN/V10=(PRF1.HIT[1..(PRF1.NUMHITS-1)].X*PRF1.HIT[2..PRF1.NUMHITS].Y)
                ASSIGN/V11=ABS(SUM(V10-V9)/2)
    
                ASSIGN/V19=(PRF2.HIT[2..PRF2.NUMHITS].X*PRF2.HIT[1..(PRF2.NUMHITS-1)].Y)
                ASSIGN/V110=(PRF2.HIT[1..(PRF2.NUMHITS-1)].X*PRF2.HIT[2..PRF2.NUMHITS].Y)
                ASSIGN/V111=ABS(SUM(-V110+V19)/2)
    
                ASSIGN/V119=(PRF3.HIT[2..PRF3.NUMHITS].X*PRF3.HIT[1..(PRF3.NUMHITS-1)].Y)
                ASSIGN/V1110=(PRF3.HIT[1..(PRF3.NUMHITS-1)].X*PRF3.HIT[2..PRF3.NUMHITS].Y)
                ASSIGN/V1111=ABS(SUM(-V1110+V119)/2)
    
                ASSIGN/AREA=V11-V111-V1111


    It also did not work in the offline mode and returned an area of 620mm but the two symmetrical internal features were different by 200mm to each other. Ran real samples online and got 557 and 553.

    Consensus: I will have to retest Jefman's code and will update if it works for the shape.

    & thanks for the troubleshooting and mathematical explanation.

    Attached Files
Children
No Data