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.
  • surface area? is it cylidrical, kinda like a gear shape? Or more hemi-spherical? 2 approaches I can think of would be to construct datums and take measurements to get a "circumference" (assigning and then summing the assigned variables of the distance measurements), OR taking the surface area of a shape the part would fit into (like a hemisphere) and then adding to that area using the same idea of assigning variables with measured values from constructed datums (because the hemisphere is going to have the smallest possible surface area and any grooves, edges, etc. are going to give it more surface area). EXAMPLE: If I wanted to know the surface area of a gear I could take lines on all the teeth surfaces (at same height and on level) and cunstruct points where they intersect, take a measurement from each peak and valley, assign all those measurements to an array, sum the array, and multiply by the height. I don't often use code like that in my programs so I'm not going to try and write out that example for you but it isn't too hard and the help files are detailed.

    Is that any help?
  • Do you have access to a good CAD system? I could do that area calculation in about 6 mouse clicks in NX. Just export as a CSV from PC-DMIS, import the CSV data into the CAD system and create surface from the point cloud (this is combined into a single function in NX), and then analyze the surface. If this is a one time thing just to get a baseline value I would be happy to do the calculation if you can send me the CSV data.
  • Yes I use NX on my computer but I would like to output the area for each of these holes within the program. There are 16 holes on each part. I have attached a photo of what they look like. They are almost round but some of them have imperfections around the hole. Customer wants area at the exit and the hole is not perpendicular to the surface. I am measuring these using a vision system.
  • The only thing that I can think of that will scale up in accuracy in proportion to the number of points you are taking is to break the shape down into a set of radial triangles (like a pie):
    - Construct a best-fit circle to establish a center point.
    - Calculate the area of a triangle by three points. a= abs((Ax(By-Cy)+Bx(Cy-Ay)+Cx(Ay-By))/2)
    * Use the center point from the best fit circle as point and two consecutive perimeter points as the other two.
    - Add this area value to a variable.
    - Calculate the next triangle by keeping the centerpoint and one of the perimeter points the same and rotating around to the next consecutive point. This way each new triangle shares one side of the previous triangle.
    - After each area calculation add the value into your collection variable.

    After you get all the way around and your last triangle has a second point equal to the first point of your first triangle then you stop the loop.

    The short side of each triangle is a chord of the radius in that area so you will be chopping off a small part of the radius and not including (or including depending on internal or external radius) it in the calculation. The accuracy will scale linearly with the number of points taken.
  • Dasalo/All

    I've tried to implement this code, not sure if you can help. Currently in offline mode and has 17000pts but still returning zero as the resultant.

    DO/
    $$ NO,
                a= abs((Ax(By-Cy)+Bx(Cy-Ay)+Cx(Ay-By))/2) find area
                ASSIGN/COUNTER=COUNTER+1
                ASSIGN/V1=PRF1.NUMHITS
                ASSIGN/AX=PRF1.HIT[COUNTER].X
                ASSIGN/AY=PRF1.HIT[COUNTER].Y
                ASSIGN/BX=PRF1.HIT[COUNTER+1].X
                ASSIGN/BY=PRF1.HIT[COUNTER+1].Y
                ASSIGN/CY=MAINPT.Y
                ASSIGN/CX=MAINPT.X
                ASSIGN/AREA1CALC=ABS((AX(BY-CY)+BX(CY-AY)+CX(AY-BY))/2)
                ASSIGN/AREA1[COUNTER]=AREA1[COUNTER-1]+AREA1CALC[COUNTER]
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                AREA1CALC
                UNTIL/(COUNTER+1) == PRF1.NUMHITS
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                AREA1[COUNTER]
  • perhaps you can output the point cloud for each hit, bring it into CAD, connect the dots, query the area?
  • gave a brilliant solution !
    Maybe a little time consumming, but brilliant.
    I would calculate the area of the least square circle, the area of the min circunscribed circle and the area of the max inscribed circle.
    The I would give to the customer the first one, with an uncertainty = ± 1/2( 3rd - 2nd).
  • From idea :
    V3 / Loop from 1 to CIRC1.NUMHITS
    ASSIGN/V4=V3
    If V3=CIRC1.NUMHITS
    ASSIGN/V4=0
    END IF
    ASSIGN/V1=CIRC1.HIT[V3].XYZ-CIRC1.XYZ
    ASSIGN/V2=CIRC1.HIT[V4+1].XYZ-CIRC1.XYZ
    ASSIGN/P_VECT=CROSS(V1,V2)*SQRT(DOT(V1,V1))*SQRT(DOT(V2,V 2))*SIN(DEG2RAD(ANGLEBETWEEN(V1,V2)))
    ASSIGN/SURFACE[V3]=SQRT(DOT(P_VECT,P_VECT))/2
    Loop/end

    ASSIGN/AREA=SUM(SURFACE)


    From avery old post Slight smile :
    https://www.pcdmisforum.com/forum/pc-dmis-enterprise-metrology-software/pc-dmis-code-samples/19247-cross-product-some-examples-of-use
  • After a little reflexion,
    ASSIGN/SURFACE[V3]=SQRT(DOT(V1,V1))*SQRT(DOT(V2,V 2))*SIN(DEG2RAD(ANGLEBETWEEN(V1,V2))) is enough (the cross product gives a vector, but its length is enough)

    : You have 17000 points, so maybe the area of each little triangle is less than the decimal place, which gives you a zero.
  • I don't know if it works, but in the LOCATION dialog there is a checkbox named Area - if I select that on a non-vision system I get the error message "Axis allowed only for Blob-feature". So, what happens if you measure your hole (ellipse?) as a Blob, and try to dimension its Area?