EgtGeomKernel 1.6v6 :
- miglioramenti a interfaccia Zmap.
This commit is contained in:
+111
-112
@@ -331,7 +331,10 @@ VolZmap::ToGlob( const Frame3d& frRef)
|
||||
// verifico lo stato
|
||||
if ( m_nStatus != OK)
|
||||
return false ;
|
||||
return false ;
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
// trasformo il riferimento
|
||||
return m_LocalFrame.ToGlob( frRef) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -341,7 +344,10 @@ VolZmap::ToLoc( const Frame3d& frRef)
|
||||
// verifico lo stato
|
||||
if ( m_nStatus != OK)
|
||||
return false ;
|
||||
return false ;
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
// trasformo il riferimento
|
||||
return m_LocalFrame.ToLoc( frRef) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -351,12 +357,15 @@ VolZmap::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
|
||||
// verifico lo stato
|
||||
if ( m_nStatus != OK)
|
||||
return false ;
|
||||
return false ;
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
// trasformo il riferimento
|
||||
return m_LocalFrame.LocToLoc( frOri, frDest) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CreateMap( const Point3d& ptO, double dPrec, double dLengthX, double dLengthY, double dLengthZ)
|
||||
VolZmap::CreateMap( const Point3d& ptO, double dLengthX, double dLengthY, double dLengthZ, double dPrec)
|
||||
{
|
||||
// Controlli sui parametri
|
||||
if ( dPrec < EPS_SMALL || dLengthX < EPS_SMALL || dLengthY < EPS_SMALL || dLengthZ < EPS_SMALL)
|
||||
@@ -1061,7 +1070,100 @@ VolZmap::SetTolerances( double dLinTol, double dAngTolDeg)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::SetTool( const string& pToolName, const ICurveComposite* pToolOutline)
|
||||
VolZmap::SetStdTool( const string& sToolName, double dH, double dR, double dCornR)
|
||||
{
|
||||
// reset nome
|
||||
m_sToolName.clear() ;
|
||||
// verifica minime dimensioni globali
|
||||
if ( dH < EPS_SMALL || dR < EPS_SMALL)
|
||||
return false ;
|
||||
// utensile cilindrico
|
||||
if ( dCornR < EPS_SMALL) {
|
||||
m_nToolType = CylindricalMill ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeight = 0 ;
|
||||
m_dTipRadius = m_dRadius ;
|
||||
m_dRCorner = 0 ;
|
||||
}
|
||||
// utensile naso di toro
|
||||
else if ( dCornR < dR - EPS_SMALL) {
|
||||
m_nToolType = BullNoseMill ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeight = dCornR ;
|
||||
m_dTipRadius = m_dRadius ;
|
||||
m_dRCorner = dR - dCornR ;
|
||||
// come profilo
|
||||
m_nToolType = GenericTool ;
|
||||
Point3d pt0( 0, 0, 0) ;
|
||||
Point3d pt1( m_dRadius, 0, 0) ;
|
||||
Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ;
|
||||
Point3d pt3( m_dTipRadius, - m_dHeight, 0) ;
|
||||
Point3d pt4( 0, - m_dHeight, 0) ;
|
||||
m_ToolOutline.Clear() ;
|
||||
CurveLine Line ;
|
||||
Line.Set( pt0, pt1) ;
|
||||
m_ToolOutline.AddCurve( Line) ;
|
||||
m_ToolOutline.AddLine( pt2);
|
||||
m_ToolOutline.AddArcTg( pt3) ;
|
||||
m_ToolOutline.AddLine( pt4) ;
|
||||
}
|
||||
// utensile sferico
|
||||
else if ( dCornR < dR + EPS_SMALL) {
|
||||
m_nToolType = BallEndMill ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeight = m_dRadius ;
|
||||
m_dTipRadius = 0 ;
|
||||
m_dRCorner = m_dRadius ;
|
||||
}
|
||||
// impossibile
|
||||
else
|
||||
return false ;
|
||||
// assegno il nome
|
||||
m_sToolName = sToolName ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
double dTipH, double dTipR, double dCornR)
|
||||
{
|
||||
// reset nome
|
||||
m_sToolName.clear() ;
|
||||
// verifica dimensioni globali
|
||||
if ( dH < EPS_SMALL || dR < EPS_SMALL)
|
||||
return false ;
|
||||
// se altezza punta nulla, ricado nel caso standard
|
||||
if ( dTipH < EPS_SMALL)
|
||||
return SetStdTool( sToolName, dH, dR, dCornR) ;
|
||||
// caso avanzato
|
||||
if ( abs( dTipR - dR) < EPS_SMALL) {
|
||||
m_nToolType = CylindricalMill ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeight = 0 ;
|
||||
m_dTipRadius = m_dRadius ;
|
||||
m_dRCorner = 0 ;
|
||||
}
|
||||
else {
|
||||
m_nToolType = ConusMill ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeight = dTipH ;
|
||||
m_dTipRadius = max( dTipR, 0.) ;
|
||||
m_dRCorner = dCornR ;
|
||||
}
|
||||
// assegno il nome
|
||||
m_sToolName = sToolName ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::SetGenTool( const string& pToolName, const ICurveComposite* pToolOutline)
|
||||
{
|
||||
m_sToolName = pToolName ;
|
||||
|
||||
@@ -1080,116 +1182,14 @@ VolZmap::SetTool( const string& pToolName, const ICurveComposite* pToolOutline)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::SetStdTool( const string& pToolName, unsigned int nToolType, double dH, double dTH, double dR, double dTR, double dRc)
|
||||
{
|
||||
// Controllo sull'ammissibilità del tipo di utensile
|
||||
if ( nToolType == GenericTool || nToolType > 4)
|
||||
|
||||
return false ;
|
||||
else {
|
||||
// Controllo sull'ammissibilità dei parametri geometrici dell'utensile
|
||||
if ( dH < EPS_SMALL || dR < EPS_SMALL)
|
||||
|
||||
return false ;
|
||||
|
||||
m_sToolName = pToolName ;
|
||||
m_nToolType = nToolType ;
|
||||
|
||||
m_dRadius = dR ;
|
||||
m_dHeight = dH ;
|
||||
|
||||
if ( nToolType == CylindricalMill) {
|
||||
|
||||
m_dTipHeight = 0 ;
|
||||
m_dTipRadius = m_dRadius ;
|
||||
}
|
||||
else if ( nToolType == BallEndMill) {
|
||||
|
||||
m_dTipHeight = m_dRadius ;
|
||||
m_dTipRadius = 0 ;
|
||||
}
|
||||
else if ( nToolType == BullNoseMill) {
|
||||
|
||||
if ( dR < dRc)
|
||||
|
||||
return false ;
|
||||
|
||||
else if ( dRc < EPS_SMALL) {
|
||||
|
||||
m_dRCorner = 0 ;
|
||||
m_dTipHeight = 0 ;
|
||||
m_dTipRadius = m_dRadius ;
|
||||
m_nToolType = CylindricalMill ;
|
||||
}
|
||||
else if ( dRc > dR - EPS_SMALL) {
|
||||
|
||||
m_dRCorner = m_dRadius ;
|
||||
m_dTipHeight = m_dRadius ;
|
||||
m_dTipRadius = 0 ;
|
||||
m_nToolType = BallEndMill ;
|
||||
}
|
||||
else {
|
||||
|
||||
m_dRCorner = dRc ;
|
||||
m_dTipHeight = dRc ;
|
||||
m_dTipRadius = dR - dRc ;
|
||||
|
||||
Point3d pt0( 0, 0, 0) ;
|
||||
Point3d pt1( m_dRadius, 0, 0) ;
|
||||
Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ;
|
||||
Point3d pt3( m_dTipRadius, - m_dHeight, 0) ;
|
||||
Point3d pt4( 0, - m_dHeight, 0) ;
|
||||
Point3d ptO( m_dTipRadius, - m_dHeight + m_dTipHeight, 0) ;
|
||||
|
||||
CurveLine cvC1, cvC2, cvC4 ;
|
||||
CurveArc cvC3 ;
|
||||
|
||||
cvC1.Set( pt0, pt1) ;
|
||||
cvC2.Set( pt1, pt2) ;
|
||||
cvC3.SetC2P( ptO, pt2, pt3) ;
|
||||
cvC4.Set( pt3, pt4) ;
|
||||
|
||||
m_ToolOutline.Clear() ;
|
||||
|
||||
m_ToolOutline.AddCurve( cvC1) ;
|
||||
m_ToolOutline.AddCurve( cvC2) ;
|
||||
m_ToolOutline.AddCurve( cvC3) ;
|
||||
m_ToolOutline.AddCurve( cvC4) ;
|
||||
|
||||
m_nToolType = GenericTool ;
|
||||
}
|
||||
}
|
||||
else if ( nToolType == ConusMill) {
|
||||
|
||||
if ( dTH < 0 || dTR < 0) return false ;
|
||||
|
||||
if ( abs( dR - dTR) < EPS_SMALL) {
|
||||
|
||||
m_nToolType = CylindricalMill ;
|
||||
|
||||
m_dTipHeight = 0 ;
|
||||
m_dTipRadius = m_dRadius ;
|
||||
}
|
||||
else {
|
||||
|
||||
m_dTipHeight = dTH ;
|
||||
m_dTipRadius = dTR ;
|
||||
}
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::MillingStep( const Point3d& ptPs, const Point3d& ptPe, Vector3d& vtDs, Vector3d& vtDe)
|
||||
VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Point3d& ptPe, const Vector3d& vtDe)
|
||||
{
|
||||
|
||||
// Controllo sull'effettiva esisenza del movimento
|
||||
if ( AreSamePointApprox( ptPs, ptPe) && AreSameVectorApprox( vtDs, vtDe))
|
||||
// Controllo sull'effettiva esistenza del movimento
|
||||
if ( AreSamePointApprox( ptPs, ptPe) && AreSameVectorApprox( vtDs, vtDe))
|
||||
return true ;
|
||||
|
||||
// Porto i dati del movimento nel riferimento intrinseco; quest'oprazione è necessaria perché
|
||||
// Porto i dati del movimento nel riferimento intrinseco; quest'operazione è necessaria perché
|
||||
// viene chiamata la funzione di sottrazione che accetta come parametri gli indici,
|
||||
// non quella che chiede il punto, nella quale viene eseguita la trasformazione di coordinate.
|
||||
Point3d ptLs = ptPs ;
|
||||
@@ -1201,7 +1201,6 @@ VolZmap::MillingStep( const Point3d& ptPs, const Point3d& ptPe, Vector3d& vtDs,
|
||||
Vector3d vtLe = vtDe ;
|
||||
vtLe.ToLoc( m_LocalFrame) ;
|
||||
|
||||
|
||||
// Normalizzo i vettori
|
||||
vtLs.Normalize() ;
|
||||
vtLe.Normalize() ;
|
||||
|
||||
Reference in New Issue
Block a user