hexagon logo

Constructing a WIDTH using CONSTRUCTED planes with the SAME vectors?

Reference this thread by for reference because i am trying to do the same thing he was. pay close attention to the reply by Sora5 regarding the generic features.Slight smile

I'm guessing this thread will have more to do with looping, generic features, and constructions commands rather than the task itself.

I can confirm that I sorta got a width to work with a measured plane and plane constructed from generic points... once... momentarily... but as soon as it ran in simulation, my work evaporated. I suspect it has to do with features generated within a loop.

A better title for this question would be "Creating Constructions from Generic Features Generated from Loops?" Anyway, here's my code.

I measure the planes...
SCN6 =FEAT/SCAN,ROTARY,NUMBER OF HITS=6,SHOW HITS=NO,SHOWALLPARAMS=NO
MEAS/SCAN
BASICSCAN/ROTARY,NUMBER OF HITS=6,SHOW HITS=NO,SHOWALLPARAMS=NO
ENDSCAN
ENDMEAS/​
SCN13 =FEAT/SCAN,ROTARY,NUMBER OF HITS=6,SHOW HITS=NO,SHOWALLPARAMS=NO
MEAS/SCAN
BASICSCAN/ROTARY,NUMBER OF HITS=6,SHOW HITS=NO,SHOWALLPARAMS=NO
ENDSCAN
ENDMEAS/

I reverse the points of the first plane...
ASSIGN/DUMB=0
V1 =LOOP/START,ID=YES,NUMBER=SCN6.NUMHITS,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/SCN6_X=SCN6.HIT[V1].X
ASSIGN/SCN6_Y=SCN6.HIT[V1].Y
ASSIGN/SCN6_Z=SCN6.HIT[V1].Z
ASSIGN/SCN6_I=SCN6.HIT[V1].I*-1
ASSIGN/SCN6_J=SCN6.HIT[V1].J*-1
ASSIGN/SCN6_K=SCN6.HIT[V1].K*-1
ASSIGN/DUMB=DUMB+1
"SCN6_REVPNT_"+DUMB =GENERIC/POINT[B],[/B]DEPENDENT,CARTESIAN,$
NOM/XYZ,<SCN6_X,SCN6_Y,SCN6_Z>,$
MEAS/XYZ,<SCN6_X,SCN6_Y,SCN6_Z>,$
NOM/IJK,<SCN6_I,SCN6_J,SCN6_K>,$
MEAS/IJK,<SCN6_I,SCN6_J,SCN6_K>
LOOP/END

And then again with the second plane...
ASSIGN/DUMB=0
V2 =LOOP/START,ID=YES,NUMBER=SCN13.NUMHITS,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/SCN13_X=SCN13.HIT[V2].X
ASSIGN/SCN13_Y=SCN13.HIT[V2].Y
ASSIGN/SCN13_Z=SCN13.HIT[V2].Z
ASSIGN/SCN13_I=SCN13.HIT[V2].I*-1
ASSIGN/SCN13_J=SCN13.HIT[V2].J*-1
ASSIGN/SCN13_K=SCN13.HIT[V2].K*-1
ASSIGN/DUMB=DUMB+1
"SCN13_REVPNT_"+DUMB =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<SCN13_X,SCN13_Y,SCN13_Z>,$
MEAS/XYZ,<SCN13_X,SCN13_Y,SCN13_Z>,$
NOM/IJK,<SCN13_I,SCN13_J,SCN13_K>,$
MEAS/IJK,<SCN13_I,SCN13_J,SCN13_K>
LOOP/END

Then I construct the generated points into a concatenated plane with a reversed vector...
PLN4 =FEAT/PLANE,CARTESIAN,OUTLINE,NO,LEAST_SQR
THEO/<0.1134,-1.043,-0.0217>,<0,1,0>
ACTL/<0.1134,-1.043,-0.0217>,<0,1,0>
CONSTR/PLANE,BF,SCN13_REVPNT_1,SCN13_REVPNT_2,SCN13_REVPNT_3,SCN13_REVPNT_4,SCN13_REVPNT_5,SCN13_REVPNT_6,SCN6_REVPNT_1,SCN6_REVPNT_2,SCN6_REVPNT_3,SCN6_REVPNT_4,SCN6_REVPNT_5,SCN6_REVPNT_6,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0

Finally I use the reverse plane with the simulated measured points to create a width construction...
WIDTH2 =FEAT/WIDTH,CARTESIAN,OUT,LEAST_SQR,NO
THEO/<0,0,0>,<0,0,1>,0
MEAS/<0,0,0>,<0,0,1>,0
CONSTR/WIDTH,BF,13320_PLN,PLN4


I'm sure anybody that uses loops a lot probably already knows why every time I run this code, all the features populated my plane construction get erasedBlush and replaced with a single point from each scan the plane fails.​

What am I doing wrong, how do I fix this?​
Parents
  • Try going into F5 and toggling the "Reset Global Settings while branching" to off.
    Then re-execute.
  • It is nothing to do with this setting, it is because expressions within loops are only "live" during execution. Reset Global Settings When Branching" affects the way alignments and tip commands behave when looping, using goto commands or logical expressions. With it turned on, PC-DMIS will always read up through the routine looking for tip and alignment commands to determine which ones should be active at any one time. With it turned off, it only activates a tip or alignment command as they are executed. This means that you could have a routine which indexes to a particular tip angle, executes an alignment and then jumps to a different part of the routine, keeping that tip and alignment active - even if other tip and alignment commands exist in the section of code that was jumped over. Obviously, there are advantages and disadvantages to both modes (on / off) and it can have a significant effect on the way the program behaves.
Reply
  • It is nothing to do with this setting, it is because expressions within loops are only "live" during execution. Reset Global Settings When Branching" affects the way alignments and tip commands behave when looping, using goto commands or logical expressions. With it turned on, PC-DMIS will always read up through the routine looking for tip and alignment commands to determine which ones should be active at any one time. With it turned off, it only activates a tip or alignment command as they are executed. This means that you could have a routine which indexes to a particular tip angle, executes an alignment and then jumps to a different part of the routine, keeping that tip and alignment active - even if other tip and alignment commands exist in the section of code that was jumped over. Obviously, there are advantages and disadvantages to both modes (on / off) and it can have a significant effect on the way the program behaves.
Children
No Data