hexagon logo

Generic line from 2 generic points

Hi,
How would you construct a generic line from 2 generic points, correctly oriented ? (from point 1 to point 2)


I'm scanning an hexagonal part to find the closest point to its centre.

AFFECTER/V1=SCN2.HIT[1..SCN2.NUMHITS].XYZ*MPOINT(1,1,0)
AFFECTER/V2=MININDEX(SQRT(DOT(V1,V1)))
AFFECTER/V3=SCN2.HIT[V2].XYZ => generic point 2
AFFECTER/V4=SCN2.XYZ*MPOINT(0,0,1) => generic point 1 (center)
AFFECTER/VECT_1=UNIT(V3-V4) => I tried UNIT(V4-V3) but there is no incidence ???????​
Parents
  • So it appears you have a measured scan.
    I'd align/origin to the center to the scan (presuming you have a means to consistently control rotation)
    construct a generic plane and construct intersect points between the scan and the plane, then again between the plane and the scan.
    construct a line between the two points.
    I have the same scenario, and i do this (well i actually just take 2-hit lines on each face, not a scan) 3x to determine my hexagon-shaped bore with a max inscribed diameter specification.


    You can't intersect directly a scan with a plane.
    You can create a curve from the scan, with a little tol (0.00001) to get the same number of points, and then intersect the curve with the plane.
    You can also search the two ponts on each side of the plane, and create a line between them (i think there's a code somewhere here, but I don't remember where...)
    Something like :
    ASSIGN/V1=MININDICES(ABS(DOT(SCN1.HIT[1..SCN1.NUMHITS].XYZ-PL1.XYZ,PL1.IJK)))
    ASSIGN/V2=UNIT(SCN1.HIT[V1[2]].XYZ-SCN1.HIT[V1[1]].XYZ)
    ASSIGN/V3=DOT(V2,PL1.IJK)
    ASSIGN/V4=SCN1.HIT[V1[1]].XYZ
    IF/V3<0
    ASSIGN/V4=SCN1.HIT[V1[2]].XYZ
    END IF/
    ASSIGN/V5=DOT(V4-PL1.XYZ,PL1.IJK)/V3
    ASSIGN/V6=V4+V5*V2
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<V6.X,V6.Y,V6.Z>,$
    MEAS/XYZ,<V6.X,V6.Y,V6.Z>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>


    You can check that F1 is on the plane with ASSIGN/V7=DOT(F1.XYZ-PL1.XYZ,PL1.IJK) ; V7 should be =0 (I'm not at the cmm; it's late... maybe V4 depends on V3>0...)​
Reply
  • So it appears you have a measured scan.
    I'd align/origin to the center to the scan (presuming you have a means to consistently control rotation)
    construct a generic plane and construct intersect points between the scan and the plane, then again between the plane and the scan.
    construct a line between the two points.
    I have the same scenario, and i do this (well i actually just take 2-hit lines on each face, not a scan) 3x to determine my hexagon-shaped bore with a max inscribed diameter specification.


    You can't intersect directly a scan with a plane.
    You can create a curve from the scan, with a little tol (0.00001) to get the same number of points, and then intersect the curve with the plane.
    You can also search the two ponts on each side of the plane, and create a line between them (i think there's a code somewhere here, but I don't remember where...)
    Something like :
    ASSIGN/V1=MININDICES(ABS(DOT(SCN1.HIT[1..SCN1.NUMHITS].XYZ-PL1.XYZ,PL1.IJK)))
    ASSIGN/V2=UNIT(SCN1.HIT[V1[2]].XYZ-SCN1.HIT[V1[1]].XYZ)
    ASSIGN/V3=DOT(V2,PL1.IJK)
    ASSIGN/V4=SCN1.HIT[V1[1]].XYZ
    IF/V3<0
    ASSIGN/V4=SCN1.HIT[V1[2]].XYZ
    END IF/
    ASSIGN/V5=DOT(V4-PL1.XYZ,PL1.IJK)/V3
    ASSIGN/V6=V4+V5*V2
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<V6.X,V6.Y,V6.Z>,$
    MEAS/XYZ,<V6.X,V6.Y,V6.Z>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>


    You can check that F1 is on the plane with ASSIGN/V7=DOT(F1.XYZ-PL1.XYZ,PL1.IJK) ; V7 should be =0 (I'm not at the cmm; it's late... maybe V4 depends on V3>0...)​
Children
No Data