hexagon logo

Surface Profile - Iterate and Repierce function

Can someone give me a rundown of what the iterate and repierce function does? I turn it on and all of a sudden my surface profile improves significantly. Is that real?

On a similar topic, has anyone else had trouble with vector least square best fit causing a best fit error? I have had several parts now that had profile dimensions set to vector best fit, which runs fine offline, that have given me best fit errors at the end of the program. If I hunt down the offending dimension and change it to least squares the error goes away immediately. I have also had a similar problem if I set the iterate and repierce function with too small of a tolerance. I'm using an .039 (1mm) ruby and have found I need to set the repierce tolerance to at least .025 to reliably run through the program without any best fit errors. This seems to be related to features with very large radiuses of contour (almost flat, but not quite). My assumption is that the math runs out to too many decimal places and it can't handle it.

Thanks for any advice. I am inspecting a part that is just one giant contour, no flats at all, and need to have all of my ducks in a row around how all of the surface profile options work.
  • Ok, I'm going to answer my own question here based on some experimentation and give myself, and anyone else who might come along later, some advice:

    What does it do?: It seems to work like a mini iterative alignment for your profile dimension. It will take your measured points and move them around on the CAD model within the tolerance zone you allow. It moves, pierces, iterates, re-pierces, and reiterates until it hits your maximum allowed iterations. Then it spits out the best answer it has found.

    Rules: You MUST specify a tolerance zone at least as big as the radius of your ruby. In practice it seems that you must go a bit bigger, ~.005", or it will occasionally throw a best fit error message and give you some crazy results.

    How well does it work? : At first it works great. It generally improved my profile numbers by ~.001-.002 in an .008 zone. In my opinion that is a very significant improvement.

    So what's the catch? : Only that it slowly and quietly chews away at the integrity of your programs' nominals and eventually something breaks and your program falls apart in a sudden and catastrophic failure. Other than that its great!

    Unsolicited advice: DO NOT turn this on in your master production program. If you do, make sure you have a very good collection of backups (I did, luckily). If you want to use this add in one of the auto save-as scripts that are in the code samples forum so you have a copy of each part inspection. Then, after making a backup, turn this feature on in the saved off file that contains your actual inspection data and it will run the iteration and, very likely, give you a better number for your profile dimension. This way it only gets run once and won't continuously overwrite the nominals in your master program.

    Also, probably best to check with your customer before providing data created with this feature. It is unclear to me whether this feature is truly compliant with the ASME standard.

    Hope this is helpful to someone.
  • It is NOT compliant with ANY profile callout that specifies all 3 datums since you are doing a best-fit alignment with all the points/features involved.
  • I have been applying this to "form only" profile callouts only! NO datum callouts. Just "|SPF|.008|" . You are absolutely correct that this would be in no way appropriate for anything referencing datums.
  • I have been applying this to "form only" profile callouts only! NO datum callouts. Just "|SPF|.008|" . You are absolutely correct that this would be in no way appropriate for anything referencing datums.


    Whew! Ya never know around here!!!!!

    In that case, I would say yep, you're doing just fine!
  • I'd like to bump this thread as I have a part where this "Iterate and repierce CAD" is available as an option for my form only surface profile. Like DaSalo above, this did wonders to some of my form only profiles, where the result without it activated showed 0.0565 mm and the result with it activated gave 0.0146 mm (!). That is some serious improvement, which makes me question the first result...

    Were the actual measurement so "off" from the CAD surface that it measured it that bad? I mean, with a form only surface it should make the necessary best-fits automagically? Shouldn't this "iterate and repierce" be included in that calculation? Now it only adds to the confusion "Am I allowed to use this?" and "Should I use it?". Like I said, some form only evaluations are improving significantly from it.
  • Only time I've used "Iterate and repierce CAD" is on a 3d bestifit alignment using a manual CMM / Arm


    The way it was explained to me was we can't iterate on a manual CMM (keep remeasuring by hand until you get within PTR) so using this instead, it's adjusts the theo's to best match the measured values.

    I don't think you should use this on a DCC machine really - at least not in this fashion.
  • A big problem with iterate and repierce, at least in the versions I tested, is that it will actually drop points from your measured points set if they fall off the surface during the iteration. It is quite possible that these points could be the points with maximum deviation so when you see your results improve it could be that it is simply because a sort of edge filter has been applied that has trimmed off the end points as the algorithm seeks a solution that is best for the majority of the points in the set. This is the same behavior that happens if you have a scan that runs off the defined surface: it tells you that nominals could not be found for some points and then asks if you want to delete them. The difference is that with iterate and repierce I don't believe it tells you that it is doing it. It has been a long time since I tested this function so please verify this on your own.

    Once you run iterate and repierce there is no going back. If it drops measured points you can not recover them. This aspect of the functionality is the primary reason why I cut this tool from my box. I can see a path to safely using it if some scripting is applied before hand. If you write a script to pull the points from a scan and stuff them into another scan feature you can then perform the iterate and repierce on this second scan feature without risk of losing your original measured data. You will then have the ability to compare the two points sets and validate exactly what is happening with the iterate and repierce.

    My general conclusion when I last tested this was that it has good potential for post processing data on certain problematic parts that might otherwise be scrapped but had too many pitfalls for general production use.
  • I'm fairly new to programming. Been working on it for about a year, but I have only been to the level 1 classes. I've been wondering about the iterate and repierce function in the best fit alignment. I see the discussion here has primarily been about using it for surface profile, but what are your thoughts on using it for a best fit hole pattern? I have a part with a constructed primary datum plane. It sits slightly differently on the fixture every time it runs, and there's no avoiding that. I do not use an iterative alignment on the part because I really don't know what I'm doing there, but best fit for hole patterns I think I understand. I actually want pcdmis to move my points around on the cad model and find the best fit. If I don't check iterate and repierce the measurements are in on some parts, and slightly out on others, but all of the parts drop on to our hard "bed of nails" gage with no problem. Could iterate and repierce be what I need to get the correct the results? Sorry if this is a "noob" question, but I haven't seen a lot of posts on iterate and repierce and hoped I could learn from this one.
  • Sorry if my question was poorly worded, or if this is something any programmer should already know the answer to. I've been begging for the level 2 classes from Hexagon, but of course "anyone should be an expert after one whole week of classroom training" Rolling eyes (Or so those who haven't attempted any kind of CMM programming seem to think). I just want to know if I use this for a best fit hole pattern will it
    slowly and quietly chews away at the integrity of your programs' nominals and eventually something breaks and your program falls apart in a sudden and catastrophic failure
    ? Any information, even if it's just a tip on where to get more information, would be greatly appreciated.

  • This feauture, iterate and repeirce, is intended for situation where you are measuring a complex surface with constantly changing surface normal directions. In this situation a small difference in the measured location of a point can have a significant impact in the probe radius compensation. To mitigate this sensitivity to the exact location of each measured point the iterate and repeirce function will shift the measured points around to find the best fit to the CAD surface in order to get the best possible probe radius compensation and most accurate surface profile value.

    With a hole pattern you are dealing with simple geometry and there is no issue with unpredictable probe radius compensation. There are tons of options for creating best-fit circles that do not involve this iterate option at all. My recommendation is that you research the best practices for measuring circles and cylinders (there are a million threads about this) and stay away from iterate and repierece, which is really a tool for free form surfaces.