|
楼主 |
发表于 2009-2-28 14:46:47
|
显示全部楼层
回复: PR 249641 symmetry calculation result is wrong when use FCF mode
BOOL CPCDdim_symmetry::do_symmetry_set(CPCDcommand * pSet1, CPCDcommand * pSet2 /*= NULL*/)
if (m_feature3 && !m_feature4) // only 1 datum PR249641
{
//248035 <29may07 paola>: calculation for SETs should be equivalent to do_math_legacy()
SetWorkplaneAlignment();
if (m_feature3->feature() == F_PLANE)
{
// If the datum is a plane, the vector is the direction we want to check with.
m_feature3->gp(CENTROID, MEAS, PART, global_align, datumCentroid, global_workplane); //PR#245439 - was using feature2 and causing crash.
m_feature3->gp(VECTOR, MEAS, PART, global_align, datumVec, global_workplane); //PR#245439 - was using feature2 and causing crash.
mat.newmat(datumVec, datumCentroid);
}
else if (m_feature3->feature() == F_LINE)
{
// If the datum is a line, the direction we want to check with is perpendicular to the line, but
// this can be done by projecting into the current workplane, and doing a rotmat towards the points.
m_feature3->gp(CENTROID, MEAS, PART, global_align, datumCentroid, global_workplane);
m_feature3->gp(VECTOR, MEAS, PART, global_align, datumVec, global_workplane);
CPoint3 workplane_vec(0,0,1); // PR248499 set to TOP by SetWorkplaneAlignment()
datumVec = datumVec.cross(workplane_vec); // PR248499
mat.newmat(datumVec, datumCentroid);
}
}
else
{
// PR249641
CPCDcommand * pAlign;
// Create datum reference frame alignment.
pAlign= create_DRF_alignment(&dirVec, &latVec, &longVec);
if (pAlign)
{
CPoint3 datumCentroid; // origin
mat.newmat(dirVec, datumCentroid);
}
} |
|