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?
ASSIGN/V1=PL1.HIT[1..5].XYZ*MPOINT(1,1,0) .............is the projection of PL1 hits on the plane PL2 (primary datum here, even if it's PL2 !)
V2=CROSS(PL2.IJK,LN1.IJK) .........................................is a vector perp to PL2 and to LN1, so approximatly perp to PL1, but the direction is not fixed (depends on orientation of planes 1 & 2)
IF/DOT(V2.IJK,PL1.IJK)<0
ASSIGN/V2=-V2
END_IF/............................................................................allows to fix the direction in the right side
ASSIGN/V3=DOT(PL1.HIT[1..5].XYZ-LN1.XYZ,V2)........calculates the signed distances between hits and line along V2
ASSIGN/V4=MAXINDICES(V3).......................................create an array of sorted numbers of distances from the higher to the smaller.
In case 1, all the values of V3 are negatives, so the higher has the min absolute value.
In the case 2, the max value is the biggest distance.
In the case 1, another solution could be directly using the intersection as origin for B, it wouldn't be more wrong than the projection of hits...
Just a thougth...
ASSIGN/V1=PL1.HIT[1..5].XYZ*MPOINT(1,1,0) .............is the projection of PL1 hits on the plane PL2 (primary datum here, even if it's PL2 !)
V2=CROSS(PL2.IJK,LN1.IJK) .........................................is a vector perp to PL2 and to LN1, so approximatly perp to PL1, but the direction is not fixed (depends on orientation of planes 1 & 2)
IF/DOT(V2.IJK,PL1.IJK)<0
ASSIGN/V2=-V2
END_IF/............................................................................allows to fix the direction in the right side
ASSIGN/V3=DOT(PL1.HIT[1..5].XYZ-LN1.XYZ,V2)........calculates the signed distances between hits and line along V2
ASSIGN/V4=MAXINDICES(V3).......................................create an array of sorted numbers of distances from the higher to the smaller.
In case 1, all the values of V3 are negatives, so the higher has the min absolute value.
In the case 2, the max value is the biggest distance.
In the case 1, another solution could be directly using the intersection as origin for B, it wouldn't be more wrong than the projection of hits...
Just a thougth...