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.
  • Not sure if that could be done on a mass scale, automated, and executed through pcdmis with my skill level lol.
    anOops, here is my application for this:

    Non-circular. I thought about adding a calculation for compositing all the geometries by size but i think there would be too much error.

    I probably should have mentioned a bit more context, the solution desalo presented seemed elegant for the problem - i just can't get it to work. I tried reducing the point count for troubleshooting and still produced zeros. I may plug some dummy values and try again. I was going to equate the area of this shape minus it's internal shapes.

    The blob says it needs to fit within the field of view, but I'll try to force it to work and see if it'll work.
  • You search the purple surface ?
    Do you have one or three scans ?


  • Jefman,

    The area that I blacked out is the part, we are trying to correlate surface area to force. 3 Scans; I would scan the outside profile generate an area, then subtract the two inner profiles areas'.
  • I'm not at the cmm.
    I would try this for the external scan :
    ASSIGN/V1=SUM(SCN1.HIT[1..SCN1.NUMHITS].X)/SCN1.NUMHITS
    ASSIGN/V2=SUM(SCN1.HIT[1..SCN1.NUMHITS].Y)/SCN1.NUMHITS
    ASSIGN/V3=SUM(SCN1.HIT[1..SCN1.NUMHITS].Z)/SCN1.NUMHITS
    ASSIGN/V4=MPOINT(V1,V2,V3)

    ASSIGN/V5=SCN1.HIT[1..(SCN1.NUMHITS-1)].XYZ-V4
    ASSIGN/V6=SCN1.HIT[2..SCN1.NUMHITS].XYZ-V4

    ASSIGN/SURFACE=SUM(SQRT(DOT(V5,V5))*SQRT(DOT(V6,V6))*SIN(DEG2RAD(ANGLEBETWEEN(V5,V6))))/2

    If it works, you do the same for others scans, then calculate the area...
    (I can't check if it works now...)
  • I tested it offline this morning, it works !
    On a circle scan 4 hits/mm Ø50 mm, the error between the assignment and PI*R^2 is 0.032 mm2. (about 0.0015%)
    With a scan 8hits/mm, the error is 0.008 mm2.
  • Jefman

    Nice work, i wish i knew what you were doing mathematically/programatically. I tried it this morning with out success on my shape :/ The CAD surface area is -151mm from PCDMIS calculated.
  • I'm not at the cmm.
    I would try this for the external scan :
    ASSIGN/V1=SUM(SCN1.HIT[1..SCN1.NUMHITS].X)/SCN1.NUMHITS
    ASSIGN/V2=SUM(SCN1.HIT[1..SCN1.NUMHITS].Y)/SCN1.NUMHITS
    ASSIGN/V3=SUM(SCN1.HIT[1..SCN1.NUMHITS].Z)/SCN1.NUMHITS
    ASSIGN/V4=MPOINT(V1,V2,V3)

    ASSIGN/V5=SCN1.HIT[1..(SCN1.NUMHITS-1)].XYZ-V4
    ASSIGN/V6=SCN1.HIT[2..SCN1.NUMHITS].XYZ-V4

    ASSIGN/SURFACE=SUM(SQRT(DOT( V1,V1))*SQRT(DOT( V2,V2))*SIN(DEG2RAD(ANGLEBETWEEN( V1,V2))))/2

    If it works, you do the same for others scans, then calculate the area...
    (I can't check if it works now...)


    V1, V2, V3 and V4 are generating the centroid of the scan.

    V5 and V6 are setting up an overlapping of points, so that V5 uses HIT1 while V6 uses HIT2, and then V5 uses HIT2 while V6 uses HIT3, etc. But they don't seem to be in use. Shouldn't the red labels be some combo of V4, V5 and V6?

    SURFACE is supposed to be calculating the sums of the triangular areas? (I dunno, I got lost there. Square of the dot product's multiplied together multiplied by the sin of the angle between something ((V1,V2) doesn't make sense to me).
  • What is the CAD value ?
    Did you add the "/2" that I forgot yesterday ?
  • at the rescue !
    ASSIGN/SURFACE=SUM(SQRT(DOT(V5,V5))*SQRT(DOT(V6,V6))*SIN( DEG2RAD(ANGLEBETWEEN(V5,V6))))/2 !!!!!!!

    V4 is the centroid of the scan, V5 and V6 are 2 arrays of vectors between hits and the centroid.
    SQRT(DOT(V5,V5)) is an array of length of vectors, same for V6.

    The norm of a cross product is also the area of the parallelogram formed by both vectors, and its (length of V5)*(length of V6)*(sin of anglre between V5 and V6) (math definition)

    Thanks a lot Vinni !!!!!
    (CTRL + C ; CTRL + V is sometimes too easy Disappointed )