Feature set from scan data with certian parameters !

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Feature set from scan data with certian parameters !

    Just a quick one,

    Can anyone provide some coding with incorporating scan data into feature sets with certain parameters.

    For example, the last 10 points in a scan in the set. I do not want to just hard wire the feature numbers in the set as the open linear scan points can differ from the generated offline scan to the online depending on the controller. Offline scan might give me 1245 points but when run online this might be 1299 points.

    It would also be great if I could include points in a set between or above a certain coordinate. For example points between coordinates z - 10mm and z - 20mm of scan 1 go to into the feature set.


    Thanks for looking

  • #2
    This code example shows how to make a feature set striping out the first and last 10% of hits. It's easier to use a percentage than a fixed number (like the last 10 hits) as it is more robust / flexible. For example, if your original scan contained 10 or less hits, then trying to remove 10 hits would cause an error whereas removing 10% would not.

    Code:
    SCN1 =FEAT/SCAN,LINEAROPEN,NUMBER OF HITS=187,SHOW HITS=NO,SHOWALLPARAMS=NO
    MEAS/SCAN
    BASICSCAN/LINE,NUMBER OF HITS=187,SHOW HITS=NO,SHOWALLPARAMS=NO   [COLOR=#e74c3c]original scan has 187 hits[/COLOR]
    ENDSCAN
    ENDMEAS/
    ASSIGN/TOT_HITS=SCN1.NUMHITS
    ASSIGN/PERCENT=10                                                 [COLOR=#e74c3c]change this value to whatever % you want to remove[/COLOR]
    ASSIGN/FIRST_HIT=ROUND(TOT_HITS/PERCENT)                          [COLOR=#e74c3c]calculates % of hits and rounds to nearest whole number [/COLOR]
    ASSIGN/LAST_HIT=TOT_HITS-FIRST_HIT                                [COLOR=#e74c3c]subtracts the same number of hits from the total.[/COLOR]
    SCN2 =FEAT/SET,CARTESIAN
    THEO/<138.657,0,-9.693>,<0,0,1>
    ACTL/<138.657,0,-9.693>,<0,0,1>
    CONSTR/SET,BASIC,SCN1.HIT[FIRST_HIT..LAST_HIT],,                  [COLOR=#e74c3c]create feature set excluding the first & last % of hits.[/COLOR]
    You would probably need to use a script to sort the hits in terms of their X, Y or Z values as it would probably be too slow to loop through them inside of PC-Dmis.
    Neil Challinor
    PC-DMIS Product Owner

    T: +44 870 446 2667 (Hexagon UK office)
    E: [email protected]

    Comment

    Related Topics

    Collapse

    Working...
    X