hexagon logo

PC-DMIS 3D Line Straightness

PC-DMIS appears to have issues calculating the proper straightness of a 3D line. The definition of straightness from the PC-DMIS online help is: This is the diameter of a cylinder that contains all the input points. A best-fitting routine determines the axis of the cylinder. If this is actually what PC-DMIS is using then the results are wrong using any method available in PC-DMIS.

; test points and resulting line
PNT1 =FEAT/POINT,CARTESIAN,NO
THEO/<432.03501,-1213.3127,50.2008>,<0,0,1>
ACTL/<432.03501,-1213.3127,50.2008>,<0,0,1>
CONSTR/POINT,CAST,PT_46_1
PNT2 =FEAT/POINT,CARTESIAN,NO
THEO/<455.70566,-1213.79075,42.17132>,<0,0,1>
ACTL/<455.70566,-1213.79075,42.17132>,<0,0,1>
CONSTR/POINT,CAST,PT_46_2
PNT3 =FEAT/POINT,CARTESIAN,NO
THEO/<479.38146,-1214.19232,34.15272>,<0,0,1>
ACTL/<479.38146,-1214.19232,34.15272>,<0,0,1>
CONSTR/POINT,CAST,PT_46_3
PNT4 =FEAT/POINT,CARTESIAN,NO
THEO/<503.0449,-1214.60886,26.09845>,<0,0,1>
ACTL/<503.0449,-1214.60886,26.09845>,<0,0,1>
CONSTR/POINT,CAST,PT_46_4
PNT5 =FEAT/POINT,CARTESIAN,NO
THEO/<526.72087,-1215.06874,18.08364>,<0,0,1>
ACTL/<526.72087,-1215.06874,18.08364>,<0,0,1>
CONSTR/POINT,CAST,PT_46_5
LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
THEO/<432.0354,-1213.32863,50.20282>,<0.9468433,-0.0173208,-0.3212286>
ACTL/<432.0354,-1213.32863,50.20282>,<0.9468433,-0.0173208,-0.3212286>
CONSTR/LINE,BF,3D,PNT1,PNT2,PNT3,PNT4,PNT5,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0

​; straightness results
DIM STRA3= STRAIGHTNESS OF LINE LIN1 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=10.00 ARROWDENSITY=100 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
M 0.00000 0.01000 0.00000 0.04133 0.04133 0.03133 -------->

​FCFSTRA2 =GEOMETRIC_TOLERANCE/STANDARD=ASME Y14.5,SHOWEXPANDED=YES,
UNITS=MM,OUTPUT=BOTH,ARROWDENSITY=100,
SEGMENT_1,STRAIGHTNESS,DIAMETER,0.01,TOL_ZONE_MATH =DEFAULT,
TEXT=OFF,CADGRAPH=OFF,REPORTGRAPH=OFF,MULT=10,
MEASURED:
LIN1:0.04623,
ADD
FEATURES/LIN1,,

​FCFSTRA3 =GEOMETRIC_TOLERANCE/STANDARD=ASME Y14.5,SHOWEXPANDED=YES,
UNITS=MM,OUTPUT=BOTH,ARROWDENSITY=100,
SEGMENT_1,STRAIGHTNESS,DIAMETER,0.01,TOL_ZONE_MATH =LSQ,
TEXT=OFF,CADGRAPH=OFF,REPORTGRAPH=OFF,MULT=10,
MEASURED:
LIN1:0.05824,
ADD
FEATURES/LIN1,,​


First off, why three different (and wrong) answers for the same thing?

The correct result is 0.04936 mm using the above data. I was able to verify this in PC-DMIS by creating an alignment from the best fit line and finding the smallest diameter circle containing all the input points:

A1 =ALIGNMENT/START,RECALL:MC_CSY,LIST=YES
ALIGNMENT/LEVEL,ZPLUS,LIN1
ALIGNMENT/TRANS,XAXIS,LIN1
ALIGNMENT/TRANS,YAXIS,LIN1
ALIGNMENT/END

CIR1 =FEAT/CIRCLE,CARTESIAN,IN,MIN_CIRCSC],NO
THEO/<-0.00715,0.00477,463.95901>,<0,0,1>,0.04936
ACTL/<-0.00715,0.00477,463.95901>,<0,0,1>,0.04936
CONSTR/CIRCLE,BF,2D,PNT1,PNT2,PNT3,PNT4,PNT5,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,UPR=0


I did figure out the method PC-DMIS used to calculate the straightness with the GeoTol command when the TOL_ZONE_MATH is set to DEFAULT or LSQ (Least Squares is not a valid description by the way). Neither method results in the smallest containing cylinder. The legacy method is a mystery and clearly wrong.
  • maybe as has been pointed out o me a few times??

    Any time you level in a new command, you should always follow that up with the rotation/origin commands
  • Using Excel gives 0.04948, not too far from your result.
    It's just the projection of hits on a plane of which you don't know the vector.
    You use the solver to minimize the max radius, then *2 gives the diameter.
  • There is some rounding to the 5th decimal place in the above data and that is probably why your result is slightly different. You should get identical results with the original test data (see below).

    Note: This is 1 of 50 sets I created for testing. The only ones PC-DMIS got right were the two point lines!

    432.035011 -1213.312697 50.200802
    455.705657 -1213.790748 42.171318
    479.381464 -1214.192316 34.152720
    503.044899 -1214.608860 26.098445
    526.720865 -1215.068737 18.083636​
  • Legacy is based on the math used when constructing the line - which will be least squares. The geometric tolerance command, when set to DEFAULT math, will use Chebyshev because that is what is required by both ISO and ASME. I do not have time to investigate further at the moment but I am extremely confident the math for geotol is correct. I would need 's routine to see exactly what is happening.
  • @ neil.challinor​ I tried fitting the data with different criteria (Chebyshev) and I was able to get it down close to what is reported by GeoTol when the option TOL_ZONE_MATH is set to DEFAULT. I can't quite get the number reported by the GeoTol straightness but it is close enough that the error is probably on my end. The values I ended up with are 0.04634 and 0.04647 mm (results from different methods).

    The other two results should both be 0.04936 mm if the fit is Least Squares and you are reporting the smallest containing cylinder parallel to the best fit of the axis, When the GeoTol option TOL_ZONE_MATH is set to LSQ the reported straightness is double the distance to the furthest point from the best fit line and not the smallest containing cylinder. I got the identical results of 0.05824 mm by taking the worst deviation and doubling it.

    It would be nice if the GeoTol command reported the actual vector of the line used for the straightness calculation when TOL_ZONE_MATH is set to DEFAULT since it is not the same as that of the input feature.
  • I would see different problems in this thread :
    gave 5 points coordinates. Mathematically, it's enough to construct a cylinder, so its diameter should be directly the straightness, without any algorithm.
    It would be nice to be able to construct cylinders from 5 hits (Flexylearn was able to do it Wink)
    It could be interesting to extract the feature which is used to calculate the form (long time ago, it was possible to calculate the flatness with Chebychev, but the associated plane wasn't accessible...)

    PS : Using Excel or Python gives a solution about 0.04654, 0.04648, 0.04641 depending on the settings
  • The axis that results in the minimum 3D line form error is 0.946782827303 -0.017286046094 -0.321408572591 and when I use this I am able to get the same result as PC-DMIS:
    ; Create two points along the target axis.  I scaled up the second point so it would not be rounded.
    PNT6 =FEAT/POINT,CARTESIAN,NO
    THEO/<0,0,0>,<0,0,1>
    ACTL/<0,0,0>,<0,0,1>
    CONSTR/POINT,OFFSET,ORIGIN,0,0,0
    PNT7 =FEAT/POINT,CARTESIAN,NO
    THEO/<94678282.7303,-1728604.6094,-32140857.2591>,<0,0,1>
    ACTL/<94678282.7303,-1728604.6094,-32140857.2591>,<0,0,1>
    CONSTR/POINT,OFFSET,ORIGIN,94678282.7303,-1728604.6094,-32140857.2591
    
    LIN2 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
    THEO/<0,0,0>,<0.9467828,-0.017286,-0.3214086>
    ACTL/<0,0,0>,<0.9467828,-0.017286,-0.3214086>
    CONSTR/LINE,BF,3D,PNT6,PNT7,,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,WAVELENGTH=0
    
    A1 =ALIGNMENT/START,RECALL:MC_CSY,LIST=YES
    ALIGNMENT/LEVEL,ZPLUS,LIN2
    ALIGNMENT/TRANS,XAXIS,LIN1
    ALIGNMENT/TRANS,YAXIS,LIN1
    ALIGNMENT/TRANS,ZAXIS,LIN1
    ALIGNMENT/END
    
    ; smallest containing circle
    CIR2 =FEAT/CIRCLE,CARTESIAN,IN,MIN_CIRCSC,NO
    THEO/<-0.00812,0.00477,0>,<0,0,1>,0.0463
    ACTL/<-0.00812,0.00477,0>,<0,0,1>,0.0463
    CONSTR/CIRCLE,BF,2D,PNT1,PNT2,PNT3,PNT4,PNT5,,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,UPR=0


    3D Line:
    Expected: 0.04936
    PC-DMIS Legacy: 0.04133 ; result is impossibly small
    PC-DMIS GeoTol LSQ: 0.05824 ; result is too large
    PC-DMIS GeoTol DEFAULT: 0.04623 ; okay. smallest containing cylinder

    ​I tried the same kind of test with a plane and everything makes sense. Using the four points below the results are as described in the following summary:

    -98.349897 372.834009 384.745043
    -105.289880 358.827047 403.885249
    -107.735745 373.212952 381.762867
    -109.651065 362.120718 397.638148​


    Plane:
    Expected: 0.091857
    PC-DMIS Legacy: 0.09186 ; okay. range of points following Least Squares fit of plane
    PC-DMIS GeoTol LSQ: 0.09186 ; okay. range of points following Least Squares fit of plane
    PC-DMIS GeoTol DEFAULT: 0.07966 ; okay. range of points following MinMax fit of plane

    @ neil.challinor​​ there is something obviously wrong with the 3D line results (Legacy and GeoTol LSQ). Although the standards define straightness as the smallest containing cylinder (or minimum separation of containing parallel planes for flatness) I don't have a problem with the Least Squares version. You have this an an option so I don't think you see this as a problem either. A CMM is just a big approximation machine to begin with and Least Squares is the preferred fit in most (maybe all) cases as it tends to filter out the filiers. The Least Squares result is usually what I expect to find in any software as the default.