hexagon logo

MAX Point MIN Point Of a scan

Morning All,

I am having some trouble finding the max values for different linear open scans. I looked at other posts and I tried Josh's code but I could not get it to work.

Does anyone see a problem with my code or something I am doing wrong?


F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<TOPSCN.HIT[MAXPTINDEX].TX,TOPSCN.HIT[MAXPTINDEX].TY,TOPSCN.HIT[MAXPTINDEX].TZ>,$
MEAS/XYZ,<TOPSCN.HIT[MAXPTINDEX].X,TOPSCN.HIT[MAXPTINDEX].Y,TOPSCN.HIT[MAXPTINDEX].Z>,$
NOM/IJK,<TOPSCN.HIT[MAXPTINDEX].TI,TOPSCN.HIT[MAXPTINDEX].TJ,TOPSCN.HIT[MAXPTINDEX].TK>,$
MEAS/IJK,<TOPSCN.HIT[MAXPTINDEX].I,TOPSCN.HIT[MAXPTINDEX].J,TOPSCN.HIT[MAXPTINDEX].K>

DIM LOC1= LOCATION OF POINT F1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL MAX MIN
X 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 0.0000 0.0000 ----#----
Y 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 0.0000 0.0000 ----#----
Z 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 0.0000 0.0000 ----#----
END OF DIMENSION LOC1
ASSIGN/MAXPTINDEX=0

TIA
Parents
  • The ASSIGN/MAXPTINDEX=0 is after the generic point.

    That is the code in the program.

    I need to find the distance between the 2 maximum points of a scan,

    What should the MAXPTINDEX = ?


    Do you need a 3D distance or a deviation along an axis or a vector ?
    If you need the distance between the points which have the max deviation, you need to calculate the T_val, then sort them from the max to the min, select the first and the second and dimension the distance (if I understand the post above)
    In this case :
    ASSIGN/V1=DOT(TOPSCN.HIT[1..TOPSCN.NUMHITS].XYZ-TOPSCN.HIT[1..TOPSCN.NUMHITS].TXYZ,TOPSCN.HIT[1..TOPSCN.NUMHITS].TIJK)
    It's an array with all T values.
    ASSIGN/V2=MAXINDICES(V1)
    It's an array with sorted index of max value to min value.
    ASSIGN/V3=V2[1] first value of V2
    ASSIGN/V4=V2[2] second value of V2
    ASSIGN/V5=TOPSCN.HIT[V3].XYZ it's the max dev point coordinates
    ASSIGN/V6=TOPSCN.HIT[V4].XYZ it's the second max dev point coordinates
    ASSIGN/DIST=SQRT(DOT(V5-V6,V5-V6)) it's the distance between those points.
Reply
  • The ASSIGN/MAXPTINDEX=0 is after the generic point.

    That is the code in the program.

    I need to find the distance between the 2 maximum points of a scan,

    What should the MAXPTINDEX = ?


    Do you need a 3D distance or a deviation along an axis or a vector ?
    If you need the distance between the points which have the max deviation, you need to calculate the T_val, then sort them from the max to the min, select the first and the second and dimension the distance (if I understand the post above)
    In this case :
    ASSIGN/V1=DOT(TOPSCN.HIT[1..TOPSCN.NUMHITS].XYZ-TOPSCN.HIT[1..TOPSCN.NUMHITS].TXYZ,TOPSCN.HIT[1..TOPSCN.NUMHITS].TIJK)
    It's an array with all T values.
    ASSIGN/V2=MAXINDICES(V1)
    It's an array with sorted index of max value to min value.
    ASSIGN/V3=V2[1] first value of V2
    ASSIGN/V4=V2[2] second value of V2
    ASSIGN/V5=TOPSCN.HIT[V3].XYZ it's the max dev point coordinates
    ASSIGN/V6=TOPSCN.HIT[V4].XYZ it's the second max dev point coordinates
    ASSIGN/DIST=SQRT(DOT(V5-V6,V5-V6)) it's the distance between those points.
Children