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
  • Side question: Lets assume I continued with the original strategy of the looped generics and the parametrized names. My brief example only has 6 generated generic points per loop, and even then it was quite tedious typing all the names into the feature list for the plane constructions. Lets pretend I attempted the same thing, but rather than 6 points, I had 600 I needed in the construction. Is there an easier way of constructing bestfit features from loop points that are only "Live" during execution?Astonished

  • loops establish & retain the data as array indices for each static feature, as I described in a comment above. You can call them as such[1]. such[2] such[3] etc, if you zap the parametric feature naming convention.
Reply Children
No Data