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
  • OK, I've officially given up on this method. Even if I can get something to always calculate the 'right thing' (I doubt it), it will be too cumbersome to add it to a part program that would benefit from it. My new approach to finding a tangent secondary plane, perpendicular to the primary, is using alignments to do the work instead.

    The idea is as follows - prerequisites: a coarse alignment (6DOF) done, a fine primary (ZPLUS) alignment done, a plane measured on the secondary (in my test case PNT2-PNT7) for the YMINUS direction.
    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 that is next to furthest away
    6. Calculate a rotation delta that would make the X-axis pass through both these points
    7. Move the origin i X to the first hit (3 above)
    8. Rotate the alignment around Z (amount from calculation (6))
    9. Move the alignment back to it's original X position
    10. (Optional) Verify that at least two of the points of the plane touches

    PLN4 =FEAT/PLANE,CARTESIAN,OUTLINE,NO
    THEO/<101.833,0,-17.333>,<0,-1,0>
    ACTL/<101.85,-2.622,-17.313>,<0.0175987,-0.999609,0.0217306>
    CONSTR/PLANE,TANGENT,PNT2,PNT3,PNT4,PNT5,PNT6,PNT7,,
    MATH_TYPE/CONSTRAINED_MINMAX,BF
    
    A2 =ALIGNMENT/START,RECALL:A1,LIST=YES
    ALIGNMENT/ROTATE,YMINUS,TO,PLN4,ABOUT,ZPLUS
    ALIGNMENT/END
    
    ASSIGN/VI1=MININDEX(PLN4.HIT[1..PLN4.NUMHITS].Y)
    
    A3 =ALIGNMENT/START,RECALL:A2,LIST=YES
    ALIGNMENT/TRANS_OFFSET,YAXIS,PLN4.HIT[VI1].Y
    ALIGNMENT/END
    
    ASSIGN/VI2=MININDICES(PLN4.HIT[1..PLN4.NUMHITS].Y)
    
    ASSIGN/ANG=ATAN(PLN4.HIT[VI2[2]].Y/(PLN4.HIT[VI2[2]].X - PLN4.HIT[VI1].X))/3.1415927*180
    
    A4 =ALIGNMENT/START,RECALL:A3,LIST=YES
    ALIGNMENT/TRANS_OFFSET,XAXIS,PLN4.HIT[VI1].X
    ALIGNMENT/END
    
    A5 =ALIGNMENT/START,RECALL:A4,LIST=YES
    ALIGNMENT/ROTATE_OFFSET,ANG,ABOUT,ZPLUS
    ALIGNMENT/END
    
    A6 =ALIGNMENT/START,RECALL:A5,LIST=YES
    ALIGNMENT/TRANS,XAXIS,PNT1
    ALIGNMENT/END
    
    ASSIGN/V6=PLN4.HIT[1..PLN4.NUMHITS].Y
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    V6
    


    Note: This will not give a 'balanced' tangent plane (CONSTRAINED_MINMAX), but one that tries to touch at least two points of the plane, and will fail miserably if the two high points have the same X value...

    Please find all errors and loopholes!
Reply
  • OK, I've officially given up on this method. Even if I can get something to always calculate the 'right thing' (I doubt it), it will be too cumbersome to add it to a part program that would benefit from it. My new approach to finding a tangent secondary plane, perpendicular to the primary, is using alignments to do the work instead.

    The idea is as follows - prerequisites: a coarse alignment (6DOF) done, a fine primary (ZPLUS) alignment done, a plane measured on the secondary (in my test case PNT2-PNT7) for the YMINUS direction.
    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 that is next to furthest away
    6. Calculate a rotation delta that would make the X-axis pass through both these points
    7. Move the origin i X to the first hit (3 above)
    8. Rotate the alignment around Z (amount from calculation (6))
    9. Move the alignment back to it's original X position
    10. (Optional) Verify that at least two of the points of the plane touches

    PLN4 =FEAT/PLANE,CARTESIAN,OUTLINE,NO
    THEO/<101.833,0,-17.333>,<0,-1,0>
    ACTL/<101.85,-2.622,-17.313>,<0.0175987,-0.999609,0.0217306>
    CONSTR/PLANE,TANGENT,PNT2,PNT3,PNT4,PNT5,PNT6,PNT7,,
    MATH_TYPE/CONSTRAINED_MINMAX,BF
    
    A2 =ALIGNMENT/START,RECALL:A1,LIST=YES
    ALIGNMENT/ROTATE,YMINUS,TO,PLN4,ABOUT,ZPLUS
    ALIGNMENT/END
    
    ASSIGN/VI1=MININDEX(PLN4.HIT[1..PLN4.NUMHITS].Y)
    
    A3 =ALIGNMENT/START,RECALL:A2,LIST=YES
    ALIGNMENT/TRANS_OFFSET,YAXIS,PLN4.HIT[VI1].Y
    ALIGNMENT/END
    
    ASSIGN/VI2=MININDICES(PLN4.HIT[1..PLN4.NUMHITS].Y)
    
    ASSIGN/ANG=ATAN(PLN4.HIT[VI2[2]].Y/(PLN4.HIT[VI2[2]].X - PLN4.HIT[VI1].X))/3.1415927*180
    
    A4 =ALIGNMENT/START,RECALL:A3,LIST=YES
    ALIGNMENT/TRANS_OFFSET,XAXIS,PLN4.HIT[VI1].X
    ALIGNMENT/END
    
    A5 =ALIGNMENT/START,RECALL:A4,LIST=YES
    ALIGNMENT/ROTATE_OFFSET,ANG,ABOUT,ZPLUS
    ALIGNMENT/END
    
    A6 =ALIGNMENT/START,RECALL:A5,LIST=YES
    ALIGNMENT/TRANS,XAXIS,PNT1
    ALIGNMENT/END
    
    ASSIGN/V6=PLN4.HIT[1..PLN4.NUMHITS].Y
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    V6
    


    Note: This will not give a 'balanced' tangent plane (CONSTRAINED_MINMAX), but one that tries to touch at least two points of the plane, and will fail miserably if the two high points have the same X value...

    Please find all errors and loopholes!
Children
No Data