hexagon logo

The shortest way to the center(scan)

When scanned in the shape shown in the figure

I want to know how to find the shortest distance between each point relative to the center.

There will be more than 140 such bends, so the we should be able to find them automatically.




For reference, the program version : PCDMIS 2019 R2 CAD++





Parents
  • Whatever the method, the problem is the scan density.
    Maybe there's no hit on the highest / lowest points.
    Without using a script, I believe you can do the same with an array :
    (Assuming CIRC1 is the max inscr circle for an ID or the min circ for an OD)

    C1=COMMENT/INPUT, enter the number of tooth
    ASSIGN/V1=SQRT(DOT(SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ,SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ))
    ASSIGN/V2=MININDEX(V1)..........................................or maxindex for an OD, it's used to align on the hihest / lowest hit)
    ASSIGN/V3=SCAN1.HIT[V2].XYZ
    F1=GENERIC/POINT,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<V3.X,V3.Y,V3.Z>,$
    MEAS/XYZ,<V3.X,V3.Y,V3.Z>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    A2=ALIGNMENT/START,RECALL:A1,LIST=YES
    ALIGNMENT/LEVEL,ZPLUS,PLN1
    ALIGNMENT/ROTATE_CIRCLE,CIRC1,F1
    ALIGNMENT/TRANS,XAXIS,CIRC1
    ALIGNMENT/TRANS,YAXIS,CIRC1
    ALIGNMENT/TRANS,ZAXIS,PLN1
    ALIGNMENT/END
    ASSIGN/ANG_HIT=RAD2DEG(ATAN(SCAN1.HIT[1..SCAN1.NUMHITS].Y/(SCAN1.HIT[1..SCAN1.NUMHITS].X+0.0000000001)
    ASSIGN/COR_TAN=(((SCAN1.HIT[1..SCAN1.NUMHITS].X-ABS(SCAN1.HIT[1..SCAN1.NUMHITS].X))/((SCAN1.HIT[1..SCAN1.NUMHITS].X-ABS(SCAN1.HIT[1..SCAN1.NUMHITS].X)))*90.....(array of 0 or 180)
    ASSIGN/ANG_COR=ANG_HIT+COR_ANG
    ASSIGN/ANGL_TH=360/C1.INPUT
    V4 =LOOP/START,ID=YES,NUMBER=C1.INPUT,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/ANGL1=ANGL_TH*(V4-1)
    ASSIGN/V5=MININDEX(ABS(ANG_COR-ANGL1))................................................searching the closest hit of the actual tooth
    ASSIGN/V6=SCAN1.HIT[V2].XYZ
    F2=GENERIC/POINT,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<V6.X,V6.Y,V6.Z>,$
    MEAS/XYZ,<V6.X,V6.Y,V6.Z>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    LOOP/END
    CIR2 =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,YES
    THEO/<0,0,0>,<0,0,1>,50
    ACTL/<0,0,0>,<0,0,1>,50
    CONSTR/CIRCLE,BF,2D,F2[1..C1.INPUT],,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,UPR=0
    



Reply
  • Whatever the method, the problem is the scan density.
    Maybe there's no hit on the highest / lowest points.
    Without using a script, I believe you can do the same with an array :
    (Assuming CIRC1 is the max inscr circle for an ID or the min circ for an OD)

    C1=COMMENT/INPUT, enter the number of tooth
    ASSIGN/V1=SQRT(DOT(SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ,SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ))
    ASSIGN/V2=MININDEX(V1)..........................................or maxindex for an OD, it's used to align on the hihest / lowest hit)
    ASSIGN/V3=SCAN1.HIT[V2].XYZ
    F1=GENERIC/POINT,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<V3.X,V3.Y,V3.Z>,$
    MEAS/XYZ,<V3.X,V3.Y,V3.Z>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    A2=ALIGNMENT/START,RECALL:A1,LIST=YES
    ALIGNMENT/LEVEL,ZPLUS,PLN1
    ALIGNMENT/ROTATE_CIRCLE,CIRC1,F1
    ALIGNMENT/TRANS,XAXIS,CIRC1
    ALIGNMENT/TRANS,YAXIS,CIRC1
    ALIGNMENT/TRANS,ZAXIS,PLN1
    ALIGNMENT/END
    ASSIGN/ANG_HIT=RAD2DEG(ATAN(SCAN1.HIT[1..SCAN1.NUMHITS].Y/(SCAN1.HIT[1..SCAN1.NUMHITS].X+0.0000000001)
    ASSIGN/COR_TAN=(((SCAN1.HIT[1..SCAN1.NUMHITS].X-ABS(SCAN1.HIT[1..SCAN1.NUMHITS].X))/((SCAN1.HIT[1..SCAN1.NUMHITS].X-ABS(SCAN1.HIT[1..SCAN1.NUMHITS].X)))*90.....(array of 0 or 180)
    ASSIGN/ANG_COR=ANG_HIT+COR_ANG
    ASSIGN/ANGL_TH=360/C1.INPUT
    V4 =LOOP/START,ID=YES,NUMBER=C1.INPUT,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/ANGL1=ANGL_TH*(V4-1)
    ASSIGN/V5=MININDEX(ABS(ANG_COR-ANGL1))................................................searching the closest hit of the actual tooth
    ASSIGN/V6=SCAN1.HIT[V2].XYZ
    F2=GENERIC/POINT,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<V6.X,V6.Y,V6.Z>,$
    MEAS/XYZ,<V6.X,V6.Y,V6.Z>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    LOOP/END
    CIR2 =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,YES
    THEO/<0,0,0>,<0,0,1>,50
    ACTL/<0,0,0>,<0,0,1>,50
    CONSTR/CIRCLE,BF,2D,F2[1..C1.INPUT],,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,UPR=0
    



Children
  • If I program in the way you suggested

    Is it possible to get the PR value of each VANE in a single scan as shown in the figure?

    Honestly, I'm only programming with PC DMIS icons, so I don't know what you mean, but I want to study and understand.

    I've posted a picture of the actual measurement part below.