hexagon logo

Creating offline a feature with defects

I often try to create autofeatures with defects offline...
I found this method, not really fast, but which gives defects between +/- 0.007mm on each hit (depends on the length of the loop in sec !)
It uses the perfect hits of an autofeature, then add a defect : ((it's a sphere again !)

ASSIGN/V1=SPH2.NUMHITS
V2         =LOOP/START,ID=YES,NUMBER=V1,START=1,SKIP=,
              OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/V3=(SQRT(SYSTEMTIME("ss"))*COS(SYSTEMTIME("ss")/10))/1000
ASSIGN/V4=SPH2.HIT[V2].XYZ+V3*SPH2.HIT[V2].IJK
F1             =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<SPH2.HIT[V2].TX,SPH2.HIT[V2].TY,SPH2.HIT[V2].TZ>,$
                MEAS/XYZ,<V4.X,V4.Y,V4.Z>,$
                NOM/IJK,<SPH2.HIT[V2].TI,SPH2.HIT[V2].TJ,SPH2.HIT[V2].TK>,$
                MEAS/IJK,<SPH2.HIT[V2].I,SPH2.HIT[V2].J,SPH2.HIT[V2].K>
              END_IF/
            LOOP/END
SPH3       =FEAT/SPHERE,CARTESIAN,OUT,LEAST_SQR,NO
            THEO/<0,0,0>,<0,0,1>,0
            ACTL/<-0.018452,0.000041,0.000159>,<0,0,1>,60.046132
            CONSTR/SPHERE,BF,F1[1..V1],,