几何尺寸与公差论坛

 找回密码
 注册
查看: 159|回复: 2

PR #253182 Iterative repiercing doesn't work for AF points (angle, corner, e

[复制链接]
发表于 2008-3-19 09:26:53 | 显示全部楼层 |阅读模式
Iterative repiercing doesn't work for AF points (angle, corner, edge, surface, vector)
<< Dan Zwick  --  02/07/08  17:10:04>>
These points don't have a find_nominals function and they are not basic hit objects, so they use the default find_nominals, which simply returns without piercing the CAD.
Steps to reproduce:
If any of these points are included as inputs to a BF alignment with iterative repiercing the nominals will not change. The user doesn't notice this. If only, say, AF vector points are used, then only a single iteration will be done. I tested this using one of the part programs and debug file from 252178 in simulated online mode.
<<END>>
 楼主| 发表于 2008-3-19 09:27:04 | 显示全部楼层

回复: PR #253182 Iterative repiercing doesn't work for AF points (angle, cor

<< Dan Zwick  --  02/27/08  08:52:16>>
Changing the theoretical values is precisely what repiercing does. This is as designed, but is also the reason that iterative repiercing can fail in certain cases where it is difficult or impossible to find new nominal points. For example, if the part has holes, recesses, or edges near a nominal point, then it抯 possible that either no new nominal point can be found within the tolerance given, or else one is found on the wrong surface. This may be why there are problems with edge points and corner points. If no new nominal point is found, then that point is simply excluded from subsequent iterations. In either case, the 6-point best fit alignment is likely to be bad. Iterative repiercing was conceived as a method of aligning a cloud of points to a large, smooth surface, where only a small number of points were likely to be excluded. With only six points, a single vector fit alignment may work better in many cases than a BF alignment with iterative repiercing. Incidentally, it抯 not actually piercing in most cases. It抯 actually 揹ropping.?That is, it is usually finding the closest point in any direction, not just in the nominal direction.
<<END>>

<< Domenico Varacalli  --  02/27/08  16:01:33>>
I have effected some tests (Version 4.3Beta, Feb 24, 2008). The description inside the ZIP (253182_README.TXT)
<<END>>

<< Dan Zwick  --  02/12/08  11:48:07>>
I uploaded to 4.4B.
<<END>>

<< Changes made by Dan Zwick -- 02/12/08  11:48:44>>
Status:  OPEN to RESOLVED
<<END>>

<< Dan Zwick  --  02/12/08  11:00:12>>
I uploaded the fix to 4.3B and will upload to 4.4B later. The same problem exists in 4.2R and above so maybe after further testing we can upload to all versions above 4.2R.
Files uploaded:
V43B\AUTOFEAT\AFANGLEPOINTCONTACT.CPP
V43B\AUTOFEAT\AFCORNERPOINTCONTACT.CPP
V43B\AUTOFEAT\AFEDGEPOINTCONTACT.CPP
V43B\AUTOFEAT\AFSURFACEPOINTCONTACT.CPP
V43B\AUTOFEAT\AFVECTORPOINTCONTACT.CPP
V43B\INCLUDE\AFANGLEPOINTCONTACT.H
V43B\INCLUDE\AFCORNERPOINTCONTACT.H
V43B\INCLUDE\AFEDGEPOINTCONTACT.H
V43B\INCLUDE\AFSURFACEPOINTCONTACT.H
V43B\INCLUDE\AFVECTORPOINTCONTACT.H
<<END>>

<< Changes made by Tim Wernicke -- 02/08/08  17:24:25>>
Priority:  to Critical
<<END>>

<< Dan Zwick  --  02/07/08  17:13:56>>
I tested one possible fix. I copied the find_nominals function from hit_basi.cpp to AFVectorPointContact.cpp and it seems to work. The trouble with this is that I would have to do the same for all of the other AF points, and possibly other features.
<<END>>
 楼主| 发表于 2008-3-19 09:34:22 | 显示全部楼层

回复: PR #253182 Iterative repiercing doesn't work for AF points (angle, cor

// V43B\AUTOFEAT\AFANGLEPOINTCONTACT.CPP
int CPCDAFAnglePointContact::find_nominals(CTransform & machine_to_cad)
{
  CPoint3 pnt,vec,outpnt,outvec;
  gp(BALLCENTER, MEAS, MACHINE, global_align, pnt);
  gp(VECTOR, MEAS, MACHINE, global_align, vec);
  machine_to_cad.aaforw(ROTANDTRANS,pnt,pnt);
  machine_to_cad.aaforw(ROTONLY,vec,vec);
  if(CPCDbasic_hit::IterateAndRePierceCadOnBestFitAlignmentsToleranceInMM == -1.0)
  {
    CPCDbasic_hit::IterateAndRePierceCadOnBestFitAlignmentsToleranceInMM = _ttof(CheckStringForExpression(m_pPartProgram, _T("IARPCOBFATIMM"), _T("-1.0")));
    if(CPCDbasic_hit::IterateAndRePierceCadOnBestFitAlignmentsToleranceInMM == -1.0)
      CPCDbasic_hit::IterateAndRePierceCadOnBestFitAlignmentsToleranceInMM = PCDGetProfileDouble(_T("Option"),_T("IterateAndRePierceCadOnBestFitAlignmentsToleranceInMM"), 20.0);
  }
  if(!m_pPartProgram->LISTIsEmpty(GSURF) && closest_cad_drop2(m_pPartProgram,pnt,vec,outpnt,outvec,GSURF,FALSE,FALSE,CPCDbasic_hit::IterateAndRePierceCadOnBestFitAlignmentsToleranceInMM*global_units/25.4,FALSE))
  {
    pp(CENTROID, THEO, CAD, global_align, outpnt);
    pp(VECTOR, THEO, CAD, global_align, outvec);
    pp(VECTOR, MEAS, CAD, global_align, outvec); // need to update the measured vector now that we have a better theo vector.
    return CADGEOMHIT;
  }
  else if(!m_pPartProgram->LISTIsEmpty(GCAD) && closest_cad_drop2(m_pPartProgram,pnt,vec,outpnt,outvec,GCAD,FALSE,FALSE,CPCDbasic_hit::IterateAndRePierceCadOnBestFitAlignmentsToleranceInMM*global_units/25.4,FALSE))
  {
    pp(CENTROID, THEO, CAD, global_align, outpnt);
    CPoint3 NVect=vec.cross(outvec);
    outvec = NVect.cross(outvec);
    if(outvec * vec < 0.0)
      outvec*=-1.0;
    pp(VECTOR, THEO, CAD, global_align, outvec);
    //pp(VECTOR, MEAS, CAD, global_align, outvec);
    return CADGEOMHIT;
  }
  else if(!m_pPartProgram->LISTIsEmpty(GSURF) || !m_pPartProgram->LISTIsEmpty(GCAD))
  {
    return CADGEOMFAIL;
  }
  return CADACCESSFAIL;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 19:04 , Processed in 0.039024 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表