hexagon logo

Does anyone know an easy way to project all the points in a group to a plane?

I have a group of points (a plane for example) and I want to project them all to a plane (simplest case == WORKPLANE). Is there some smart way to do it all at once (a.k.a. "the JEFMAN way") or is it only possible with a loop? I haven't found anything yet...

The object of this is to create a secondary tangent plane perpendicular to the primary by the following method:

- measure the secondary plane
- project all points up/down to the primary (WORKPLANE)
- construct a tangent plane from the original plane points + the projected points (guaranteed to be perpendicular to the primary as that is our projection direction)

As a follow-up question: How can I use an ARRAY variable in the same way as .HIT[...] in the construction of a tangent plane?
Parents
  • Update:

    I've revised the method a bit further, as the previous one was of course not completely correct, and could still generate alignments where some point(s) of the plane ended up on the wrong side.

    This one has so far always generated an alignment which (a) touches at least one of the original hits, (b) leaves all the hits on, or on the same side of, the coordinate plane. Of course, that's no guarantee that it will always do that, but I haven't manage to provoke an error yet...

    Note that the final alignment plane is neither exactly L1, L2 or MINMAX, but just "a plane that satisfies the conditions: tangent plane, perpendicular to the primary".

    Also note that the code as written expects ZPLUS to be primary, and will align YMINUS to the secondary plane.

    I would be happy for any verifications/refutations you can provide!


    The current steps are:
    1. Create a Tangent plane of the points
    2. Align (Rotate) to that
    3. Find the hit of the tangent plane that is furthest away in YMINUS
    4. Move the origin in Y to that hit
    5. Find the hit with the smallest polar angle in this coordinate system, remember the angle
    6. Move the origin in X to the first hit (3 above)
    7. Rotate the alignment around Z (amount from (5))
    8. Move the alignment back to it's original X position
    9. (Optional) Verify that at least one of the points of the plane touches, and all the others are on the same side

    $$ NO,
                (1)
                .
    PL1        =FEAT/PLANE,CARTESIAN,TRIANGLE,NO
                THEO/<108.5,0,-14.8333>,<0,-1,0>
                ACTL/<108.8336,-0.5148,-14.835>,<0.0011097,-0.9999797,-0.006276>
                CONSTR/PLANE,TANGENT,F1,F2,F3,F4,F5,F51,,
                MATH_TYPE/CONSTRAINED_MINMAX,BFRE
    $$ NO,
                (2)
                .
    A2         =ALIGNMENT/START,RECALL:A1,LIST=YES
                  ALIGNMENT/ROTATE,YMINUS,TO,PL1,ABOUT,ZPLUS
                ALIGNMENT/END
    $$ NO,
                (3)
                .
                ASSIGN/VI2=MININDICES(PL1.HIT[1..PL1.NUMHITS].Y)
                ASSIGN/VI1=VI2[1]
                ASSIGN/Y1=PL1.HIT[VI1].Y
    $$ NO,
                (4)
                .
    A3         =ALIGNMENT/START,RECALL:A2,LIST=YES
                  ALIGNMENT/TRANS_OFFSET,YAXIS,Y1
                ALIGNMENT/END
    $$ NO,
                (5)
                .
                ASSIGN/ANG=RAD2DEG(ATAN(PL1.HIT[1..PL1.NUMHITS].Y/(PL1.HIT[1..PL1.NUMHITS].X - PL1.HIT[VI1].X)))
                ASSIGN/AANG=ABS(ANG)
                ASSIGN/IANG=MININDEX(AANG)
                ASSIGN/ANGT=ANG[IANG]
    $$ NO,
                (6), (7), (8)
                .
    A4         =ALIGNMENT/START,RECALL:A3,LIST=YES
                  ALIGNMENT/TRANS_OFFSET,XAXIS,PL1.HIT[VI1].X
                  ALIGNMENT/ROTATE_OFFSET,ANGT,ABOUT,ZPLUS
                  ALIGNMENT/TRANS,XAXIS,PNT_C
                ALIGNMENT/END
    $$ NO,
                (9)
                .
    DIM LOC1= LOCATION OF POINT F1  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.2217     0.0500    -0.0500     0.2217 -------->
    END OF DIMENSION LOC1
    DIM LOC2= LOCATION OF POINT F2  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.0000     0.0500    -0.0500     0.0000 ----#----
    END OF DIMENSION LOC2
    DIM LOC3= LOCATION OF POINT F3  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.4962     0.0500    -0.0500     0.4962 -------->
    END OF DIMENSION LOC3
    DIM LOC4= LOCATION OF POINT F4  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.6424     0.0500    -0.0500     0.6424 -------->
    END OF DIMENSION LOC4
    DIM LOC5= LOCATION OF POINT F5  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.0000     0.0500    -0.0500     0.0000 ----#----
    END OF DIMENSION LOC5
    DIM LOC6= LOCATION OF POINT F51  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.0988     0.0500    -0.0500     0.0988 -------->
    END OF DIMENSION LOC6
    
Reply
  • Update:

    I've revised the method a bit further, as the previous one was of course not completely correct, and could still generate alignments where some point(s) of the plane ended up on the wrong side.

    This one has so far always generated an alignment which (a) touches at least one of the original hits, (b) leaves all the hits on, or on the same side of, the coordinate plane. Of course, that's no guarantee that it will always do that, but I haven't manage to provoke an error yet...

    Note that the final alignment plane is neither exactly L1, L2 or MINMAX, but just "a plane that satisfies the conditions: tangent plane, perpendicular to the primary".

    Also note that the code as written expects ZPLUS to be primary, and will align YMINUS to the secondary plane.

    I would be happy for any verifications/refutations you can provide!


    The current steps are:
    1. Create a Tangent plane of the points
    2. Align (Rotate) to that
    3. Find the hit of the tangent plane that is furthest away in YMINUS
    4. Move the origin in Y to that hit
    5. Find the hit with the smallest polar angle in this coordinate system, remember the angle
    6. Move the origin in X to the first hit (3 above)
    7. Rotate the alignment around Z (amount from (5))
    8. Move the alignment back to it's original X position
    9. (Optional) Verify that at least one of the points of the plane touches, and all the others are on the same side

    $$ NO,
                (1)
                .
    PL1        =FEAT/PLANE,CARTESIAN,TRIANGLE,NO
                THEO/<108.5,0,-14.8333>,<0,-1,0>
                ACTL/<108.8336,-0.5148,-14.835>,<0.0011097,-0.9999797,-0.006276>
                CONSTR/PLANE,TANGENT,F1,F2,F3,F4,F5,F51,,
                MATH_TYPE/CONSTRAINED_MINMAX,BFRE
    $$ NO,
                (2)
                .
    A2         =ALIGNMENT/START,RECALL:A1,LIST=YES
                  ALIGNMENT/ROTATE,YMINUS,TO,PL1,ABOUT,ZPLUS
                ALIGNMENT/END
    $$ NO,
                (3)
                .
                ASSIGN/VI2=MININDICES(PL1.HIT[1..PL1.NUMHITS].Y)
                ASSIGN/VI1=VI2[1]
                ASSIGN/Y1=PL1.HIT[VI1].Y
    $$ NO,
                (4)
                .
    A3         =ALIGNMENT/START,RECALL:A2,LIST=YES
                  ALIGNMENT/TRANS_OFFSET,YAXIS,Y1
                ALIGNMENT/END
    $$ NO,
                (5)
                .
                ASSIGN/ANG=RAD2DEG(ATAN(PL1.HIT[1..PL1.NUMHITS].Y/(PL1.HIT[1..PL1.NUMHITS].X - PL1.HIT[VI1].X)))
                ASSIGN/AANG=ABS(ANG)
                ASSIGN/IANG=MININDEX(AANG)
                ASSIGN/ANGT=ANG[IANG]
    $$ NO,
                (6), (7), (8)
                .
    A4         =ALIGNMENT/START,RECALL:A3,LIST=YES
                  ALIGNMENT/TRANS_OFFSET,XAXIS,PL1.HIT[VI1].X
                  ALIGNMENT/ROTATE_OFFSET,ANGT,ABOUT,ZPLUS
                  ALIGNMENT/TRANS,XAXIS,PNT_C
                ALIGNMENT/END
    $$ NO,
                (9)
                .
    DIM LOC1= LOCATION OF POINT F1  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.2217     0.0500    -0.0500     0.2217 -------->
    END OF DIMENSION LOC1
    DIM LOC2= LOCATION OF POINT F2  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.0000     0.0500    -0.0500     0.0000 ----#----
    END OF DIMENSION LOC2
    DIM LOC3= LOCATION OF POINT F3  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.4962     0.0500    -0.0500     0.4962 -------->
    END OF DIMENSION LOC3
    DIM LOC4= LOCATION OF POINT F4  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.6424     0.0500    -0.0500     0.6424 -------->
    END OF DIMENSION LOC4
    DIM LOC5= LOCATION OF POINT F5  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.0000     0.0500    -0.0500     0.0000 ----#----
    END OF DIMENSION LOC5
    DIM LOC6= LOCATION OF POINT F51  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       MEAS       +TOL       -TOL        DEV
    Y       0.0000     0.0988     0.0500    -0.0500     0.0988 -------->
    END OF DIMENSION LOC6
    
Children
No Data