EgtMachKernel :
- corretta AddPartToRawPart per grezzo generico con riferimento non in basso a sinistra.
This commit is contained in:
+6
-4
@@ -78,9 +78,11 @@ MachMgr::AddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId)
|
||||
// verifico che il pezzo non sia già usato nella macchinata corrente
|
||||
if ( m_pGeomDB->GetParentId( nPartId) != GDB_ID_ROOT)
|
||||
return false ;
|
||||
// recupero il riferimento del grezzo
|
||||
Frame3d frRaw ;
|
||||
m_pGeomDB->GetGroupGlobFrame( nRawId, frRaw) ;
|
||||
// recupero il box del solido del grezzo in locale
|
||||
int nRawSolidId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_SOLID) ;
|
||||
BBox3d b3RawSolid ;
|
||||
if ( ! m_pGeomDB->GetLocalBBox( nRawSolidId, b3RawSolid))
|
||||
return false ;
|
||||
// recupero box del pezzo
|
||||
BBox3d b3Part ;
|
||||
if ( ! m_pGeomDB->GetGlobalBBox( nPartId, b3Part))
|
||||
@@ -89,7 +91,7 @@ MachMgr::AddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId)
|
||||
Frame3d frPart ;
|
||||
m_pGeomDB->GetGroupGlobFrame( nPartId, frPart) ;
|
||||
// muovo riferimento del pezzo per posizionare correttamente nel grezzo
|
||||
Vector3d vtMove = ptPos - b3Part.GetMin() ;
|
||||
Vector3d vtMove = b3RawSolid.GetMin() + ptPos - b3Part.GetMin() ;
|
||||
frPart.Translate( vtMove) ;
|
||||
// inserisco il pezzo
|
||||
int nGroup = m_pGeomDB->AddGroup( GDB_ID_NULL, nRawId, frPart) ;
|
||||
|
||||
Reference in New Issue
Block a user