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
  • I can't find a good solution without looping Disappointed !
    PL1 and PL2 are tangent planes using Minimax option.

    AFFECTER/V2=PL1.XYZ-CROSS(CROSS(PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ,PL1.IJK),PL1.IJK)*SQRT(DOT(PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ,PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ))*SIN(DEG2RAD(ANGLEBETWEEN(PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ,PL1.IJK)))
    V3         =BOUCLE/DÉPART,ID=OUI,NOMBRE=PL2.NUMHITS,DÉPART=1,IGNORER=,
                  DÉCALAGE:AXEX=0,AXEY=0,AXEZ=0,ANGLE=0
                  AFFECTER/V4=V2[V3]
    F3           =GÉNÉRIQUE/POINT,DÉPENDANT,CARTÉSIEN,$
    VAL. NOM.     /XYZ,<V4.X,V4.Y,V4.Z>,$
                  MESU/XYZ,<V4.X,V4.Y,V4.Z>,$
    VAL. NOM.     /IJK,<0,1,0>,$
                  MESU/IJK,<0,1,0>
                BOUCLE/FIN
    SCN6       =ÉLÉM/SÉRIE,CARTÉSIEN
                THÉO/<24.9837,-0.0255,0>,<0,0,1>
                RÉEL/<24.9837,-0.0255,0>,<0,0,1>
                CONSTR/SÉRIE,BASE,F3[1..PL2.NUMHITS],,
    SCN8       =ÉLÉM/SÉRIE,CARTÉSIEN
                THÉO/<24.9837,-0.0255,14.9765>,<0,0,1>
                RÉEL/<24.9837,-0.0255,14.9765>,<0,0,1>
                CONSTR/SÉRIE,BASE,PL2.HIT[1..PL2.NUMHITS],SCN6.HIT[1..PL2.NUMHITS],,
    PL3        =ÉLÉM/PLAN,CARTÉSIEN,TRIANGLE,NON
                THÉO/<24.9837,0.0074,14.9765>,<0.0004654,0.9999999,0>
                RÉEL/<24.9837,0.0074,14.9765>,<0.0004654,0.9999999,0>
                CONSTR/PLAN,TANGENTE,SCN8,,
                TYPE_MATH/CONTRAINT_MINMAX,BFRE



    I'd look at another solution using the intersection between both tangent planes, the max distance between hits and line perp to the line, then create a generic plane :


    LN1        =ÉLÉM/LIGNE,CARTÉSIEN,ILLIMITÉ,NON
                THÉO/<24.9927,0.0062,0>,<1,0.0000829,0>
                RÉEL/<24.9927,0.0062,0>,<1,0.0000829,0>
                CONSTR/DROITE,INTER DE,PL2,PL1
                AFFECTER/V5=CROSS(PL1.IJK,LN1.IJK)
                AFFECTER/V6=MAXINDEX(DOT(PL2.HIT[1..PL2.NUMHITS].XYZ-LN1.XYZ,V5))
                AFFECTER/V8=MAXINDICES(DOT(PL2.HIT[1..PL2.NUMHITS].XYZ-LN1.XYZ,V5))
                AFFECTER/V7=PL2.HIT[V6].XYZ
    F4         =GÉNÉRIQUE/PLAN,DÉPENDANT,CARTÉSIEN,$
    VAL. NOM.   /XYZ,<V7.X,V7.Y,V7.Z>,$
                MESU/XYZ,<V7.X,V7.Y,V7.Z>,$
    VAL. NOM.   /IJK,<V5.I,V5.J,V5.K>,$
                MESU/IJK,<V5.I,V5.J,V5.K>


    It gives a plane F4 perp to PL1, but with a tangent in a lonely point, instead of 2.

    I'm wondering if the construction of a line through the first and the second values of V8 could give a better result which work whatever those values (if those values show hits which are aligned along PL1 vector, it can't work...)


Reply
  • I can't find a good solution without looping Disappointed !
    PL1 and PL2 are tangent planes using Minimax option.

    AFFECTER/V2=PL1.XYZ-CROSS(CROSS(PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ,PL1.IJK),PL1.IJK)*SQRT(DOT(PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ,PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ))*SIN(DEG2RAD(ANGLEBETWEEN(PL2.HIT[1..PL2.NUMHITS].XYZ-PL1.XYZ,PL1.IJK)))
    V3         =BOUCLE/DÉPART,ID=OUI,NOMBRE=PL2.NUMHITS,DÉPART=1,IGNORER=,
                  DÉCALAGE:AXEX=0,AXEY=0,AXEZ=0,ANGLE=0
                  AFFECTER/V4=V2[V3]
    F3           =GÉNÉRIQUE/POINT,DÉPENDANT,CARTÉSIEN,$
    VAL. NOM.     /XYZ,<V4.X,V4.Y,V4.Z>,$
                  MESU/XYZ,<V4.X,V4.Y,V4.Z>,$
    VAL. NOM.     /IJK,<0,1,0>,$
                  MESU/IJK,<0,1,0>
                BOUCLE/FIN
    SCN6       =ÉLÉM/SÉRIE,CARTÉSIEN
                THÉO/<24.9837,-0.0255,0>,<0,0,1>
                RÉEL/<24.9837,-0.0255,0>,<0,0,1>
                CONSTR/SÉRIE,BASE,F3[1..PL2.NUMHITS],,
    SCN8       =ÉLÉM/SÉRIE,CARTÉSIEN
                THÉO/<24.9837,-0.0255,14.9765>,<0,0,1>
                RÉEL/<24.9837,-0.0255,14.9765>,<0,0,1>
                CONSTR/SÉRIE,BASE,PL2.HIT[1..PL2.NUMHITS],SCN6.HIT[1..PL2.NUMHITS],,
    PL3        =ÉLÉM/PLAN,CARTÉSIEN,TRIANGLE,NON
                THÉO/<24.9837,0.0074,14.9765>,<0.0004654,0.9999999,0>
                RÉEL/<24.9837,0.0074,14.9765>,<0.0004654,0.9999999,0>
                CONSTR/PLAN,TANGENTE,SCN8,,
                TYPE_MATH/CONTRAINT_MINMAX,BFRE



    I'd look at another solution using the intersection between both tangent planes, the max distance between hits and line perp to the line, then create a generic plane :


    LN1        =ÉLÉM/LIGNE,CARTÉSIEN,ILLIMITÉ,NON
                THÉO/<24.9927,0.0062,0>,<1,0.0000829,0>
                RÉEL/<24.9927,0.0062,0>,<1,0.0000829,0>
                CONSTR/DROITE,INTER DE,PL2,PL1
                AFFECTER/V5=CROSS(PL1.IJK,LN1.IJK)
                AFFECTER/V6=MAXINDEX(DOT(PL2.HIT[1..PL2.NUMHITS].XYZ-LN1.XYZ,V5))
                AFFECTER/V8=MAXINDICES(DOT(PL2.HIT[1..PL2.NUMHITS].XYZ-LN1.XYZ,V5))
                AFFECTER/V7=PL2.HIT[V6].XYZ
    F4         =GÉNÉRIQUE/PLAN,DÉPENDANT,CARTÉSIEN,$
    VAL. NOM.   /XYZ,<V7.X,V7.Y,V7.Z>,$
                MESU/XYZ,<V7.X,V7.Y,V7.Z>,$
    VAL. NOM.   /IJK,<V5.I,V5.J,V5.K>,$
                MESU/IJK,<V5.I,V5.J,V5.K>


    It gives a plane F4 perp to PL1, but with a tangent in a lonely point, instead of 2.

    I'm wondering if the construction of a line through the first and the second values of V8 could give a better result which work whatever those values (if those values show hits which are aligned along PL1 vector, it can't work...)


Children
No Data