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
  • 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.
  • I'm going to go on a little rant here:

    Every time I see a post on this topic (and there are TONS of them) it just infuriates me. I've had an enhancement request in for at LEAST 7 years to make this a simple point construction in pc-dmis.

    I requested that they mimic the DMIS standard "CONSTR/POINT/EXTREM" command which covers it very thoroughly.

    Promises have been made, "we're working on it", but it never gets done

    As evidenced by the sheet number of posts on this topic it can be stated that:

    1) It is a very common need when creating cmm programs.
    2) pc-dmis implementation to accomplish the task is overly complicated.
    3) pc-dmis customers are wasting incredible amounts of time to accomplish what should be a very simple construction.
    4) It is very much prone to user error. (Me included).

    I'm of the opinion that a cmm programmer shouldn't have to to understand higher level programming concepts like array indexing to be able to create a cmm program.

    End of rant. Hopefully the OP can muddle his way through this and find his high point.
  • Agreed DJAMS. I have actually also brought this up at HxGn Live to have it as a constructed point.
  • I need a 2D distance between the 2 most extreme points in X and Y.

    I have been able to find my max point in Y+ but I have not yet succeeded in X.
    I assume that once I find the 2 max points in Y+ and Y-, I would be able to just dimension distance from the 2 generic points correct?
  • Thanks, I have succeeded in 1 of 4 scans so far!
  • X max :
    ASSIGN/V1= MAXINDEX(TOPSCN.HIT[1..TOPSCN.NUMHITS].X)
    ASSIGN/V2=TOPSCN.HIT[V1].XYZ
    Construc a generic point with V2.X,V2.Y,V2.Z.

    X min :
    ASSIGN/V3= MININDEX(TOPSCN.HIT[1..TOPSCN.NUMHITS].X)
    ASSIGN/V4=TOPSCN.HIT[V3].XYZ
    Construc a generic point with V4.X,V4.Y,V4.Z.

    Do the same for Y...
    Hope this helps...
  • Wait... you want the distance between the extreme max value and the extreme min value of a scan? Wouldn't that just be profile? Or if you want to make sure you get the distance if they're on the same side pull the MIN and MAX from the profile?

    DIM DIM_9= PROFILE OF SURFACE OF SET PROFILE_HITS    FORMANDLOCATION  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  ARROWDENSITY=100  OUTPUT=BOTH
    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
    M       0.0000     0.0010     0.0010     0.0041     0.0041     0.0021 <---|--->
                ASSIGN/V1=DIM_9.M.MAX
                ASSIGN/V2=DIM_9.M.MIN
    F1         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<0,0,0>,$
                MEAS/XYZ,<V1-V2,0,0>,$
                NOM/IJK,<0,0,1>,$
                MEAS/IJK,<0,0,1>
    DIM DIM_A5= 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
    X       0.0000     0.0020     0.0020     0.0041     0.0041     0.0021 -------->
    END OF DIMENSION DIM_A5
  • 4 scans total and not the min/max deviations but the distance between the max points.
  • Just so you have a better understanding of what I am doing. I am looking the distance between the 2 max points in Y and there is also 2 more scans for X.

    Here is my code so far. I got one max point in Y to work but I must be doing something wrong for my -X max point.

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

    ASSIGN/V2=(LEFTSCN.HIT[1..LEFTSCN.NUMHITS].X)
    ASSIGN/V2=(MAXINDEX(LEFTSCN.HIT[1..LEFTSCN.NUMHITS].X))
    F2 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<-LEFTSCN.HIT[V2].TX,LEFTSCN.HIT[V2].TY,LEFTSCN.HIT[V2].TZ>,$
    MEAS/XYZ,<-LEFTSCN.HIT[V2].X,LEFTSCN.HIT[V2].Y,LEFTSCN.HIT[V2].Z>,$
    NOM/IJK,<-LEFTSCN.HIT[V2].TI,LEFTSCN.HIT[V2].TJ,LEFTSCN.HIT[V2].TK>,$
    MEAS/IJK,<LEFTSCN.HIT[V2].I,LEFTSCN.HIT[V2].J,LEFTSCN.HIT[V2].K>

  • If you look at the left, you have to use minindex... Because of the minus Slight smile