hexagon logo

The shortest way to the center(scan)

When scanned in the shape shown in the figure

I want to know how to find the shortest distance between each point relative to the center.

There will be more than 140 such bends, so the we should be able to find them automatically.




For reference, the program version : PCDMIS 2019 R2 CAD++





Parents
  • ASSIGN/V1=SQRT(DOT(SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ,SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ))
    ASSIGN/V2=MIN(V1)
    ASSIGN/V3=MININDEX(V1)
    ASSIGN/V4=SCAN1.HIT[V3].XYZ

    V1 is an array of radii
    V2 is the min radius
    V3 is the index of the min radius
    V4 is the coordinates of the hit which give the min radius

    The result depends also on the constructed circle (LS, mincirc, minsep...), so the center can change.
Reply
  • ASSIGN/V1=SQRT(DOT(SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ,SCAN1.HIT[1..SCAN1.NUMHITS].XYZ-CIRC1.XYZ))
    ASSIGN/V2=MIN(V1)
    ASSIGN/V3=MININDEX(V1)
    ASSIGN/V4=SCAN1.HIT[V3].XYZ

    V1 is an array of radii
    V2 is the min radius
    V3 is the index of the min radius
    V4 is the coordinates of the hit which give the min radius

    The result depends also on the constructed circle (LS, mincirc, minsep...), so the center can change.
Children
No Data