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
  • 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​​
Reply
  • 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​​
Children
No Data