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?​
  • Try going into F5 and toggling the "Reset Global Settings while branching" to off.
    Then re-execute.
  • When constructing a plane from scan points, I noticed that if you select the "Specify Theos" in the construction dialog, and reverse the vector there, that will play nice with the "Width" construction even though the measured value still retains the true vector of the plane. I have only tested this offline. Can anyone see a problem with this strategy if the plane is BF? Would this be bad if the plane was BFRE?
  • Are there any downsides or considerations to turning this option off? Why is it defaulted on? Why would somebody desire it to be on?
  • after the constructions you have already made, you can construct a reversed plane from the one you need to to have the other vector direction for.
  • If you are talking about the construction of a plane by selecting another plane and creating a plane with a reversed vector of the first, this does not work with width. Width supposedly required measured point data, and a reverse plane construction only has a mathematically derived centroid and vector.

    If you are talking about constructing a reverse plane by specifying the theos in a BF plane construction and forcing the vector, this is the scenario I described in my question.
  • Nope, I was suggesting that method that (apparently) doesn't work....
  • 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.
  • neil.challinor How does one make a construction of features generated in a loop
  • Reposting this here to be up to date in the forums

    I know this is a super old thread but I have found a way that works pretty well actually two different ways,

    1.)Take your plane that you want to reverse the vector points and construct plane out of it use num.hits then manually change the vector and update actual, then construct the width from this and the lets say top plane.

    2.) same thing take the plane you want to reverse the vector on and point cloud this feature then construct plane out of that point cloud, then manually flip the vector and update actual this works also


    PLN1 =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,TRIANGLE,LEAST_SQR
    THEO/<-2.7325,-1.507,-0.03>,<0,0,1>
    ACTL/<-2.7325,-1.507,-0.03>,<0,0,1>
    TARG/<-2.7325,-1.507,-0.03>,<0,0,1>
    ANGLE VEC=<1,0,0>,SQUARE
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PLN2 =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,TRIANGLE,LEAST_SQR
    THEO/<-3.5873,-1.7536,-3.375>,<0,0,1>
    ACTL/<-3.5873,-1.7536,-3.375>,<0,0,1>
    TARG/<-3.5873,-1.7536,-3.375>,<0,0,1>
    ANGLE VEC=<1,0,0>,SQUARE
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PLN4 =FEAT/PLANE,CARTESIAN,TRIANGLE,YES,LEAST_SQR
    THEO/<-3.5873,-1.7536,-3.375>,<0,0,-1>
    ACTL/<-3.5873,-1.7536,-3.375>,<0,0,-1>
    CONSTR/PLANE,BF,PLN2.HIT[1..PLN2.NUMHITS],,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,WAVELENGTH=0

    COP1 =COP/DATA,TOTAL SIZE=9,REDUCED SIZE=9,
    FINDNOMS=NO,REF=PLN2,,

    PLN3 =FEAT/PLANE,CARTESIAN,TRIANGLE,YES,LEAST_SQR
    THEO/<-3.5873,-1.7536,-3.375>,<0,0,-1>
    ACTL/<-3.5873,-1.7536,-3.375>,<0,0,-1>
    CONSTR/PLANE,BF,COP1,,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,WAVELENGTH=0

    WIDTH1 =FEAT/WIDTH,CARTESIAN,OUT,LEAST_SQR,NO
    THEO/<-3.1599,-1.6303,-1.7025>,<0,0,-1>,3.345
    MEAS/<-3.1599,-1.6303,-1.7025>,<0,0,-1>,3.345
    CONSTR/WIDTH,BF,PLN1,PLN3

    WIDTH2 =FEAT/WIDTH,CARTESIAN,OUT,LEAST_SQR,NO
    THEO/<-3.1599,-1.6303,-1.7025>,<0,0,-1>,3.345
    MEAS/<-3.1599,-1.6303,-1.7025>,<0,0,-1>,3.345
    CONSTR/WIDTH,BF,PLN1,PLN4​​