EgtGeomKernel 1.6r9 :

- inseriti sviluppi Zmap.
This commit is contained in:
Dario Sassi
2016-06-13 07:10:18 +00:00
parent c202b070e3
commit 3bbdfc4a74
5 changed files with 3703 additions and 60 deletions
BIN
View File
Binary file not shown.
+50 -7
View File
@@ -2589,6 +2589,9 @@ GdbExecutor::ExecuteVolZmap(const string& sCmd2, const STRVECTOR& vsParams)
else if ( sCmd2 == "SET") {
return VolZmapSetTool( vsParams) ;
}
else if ( sCmd2 == "SETSTD") {
return VolZmapSetStdTool( vsParams) ;
}
return false ;
}
@@ -2735,8 +2738,8 @@ GdbExecutor::VolZmapMilling( const STRVECTOR& vsParams)
bool
GdbExecutor::VolZmapSetTool( const STRVECTOR& vsParams)
{
// parametri : ZmapId, CrvId, nToolType, sToolName
if ( vsParams.size() != 4)
// parametri : ZmapId, CrvId, sToolName
if ( vsParams.size() != 3)
return false ;
// recupero lo Zmap
int nZmapId = GetIdParam( vsParams[0]) ;
@@ -2748,15 +2751,55 @@ GdbExecutor::VolZmapSetTool( const STRVECTOR& vsParams)
CurveComposite* pToolOutline = GetBasicCurveComposite( m_pGDB->GetGeoObj( nCrvId)) ;
if ( pToolOutline == nullptr)
return false ;
// recupero tipo utensile
int nToolType ;
if ( ! FromString( vsParams[2], nToolType))
// recupero la stringa nome dell'utensile
string sToolName ;
sToolName = vsParams[2] ;
// assegno utensile
return pZmap->SetTool( sToolName, pToolOutline) ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::VolZmapSetStdTool( const STRVECTOR& vsParams)
{
// parametri : ZmapId, sToolName, nToolType, dH, dTH, dR, dTR, dRc
if ( vsParams.size() != 8)
return false ;
// recupero lo Zmap
int nZmapId = GetIdParam( vsParams[0]) ;
VolZmap* pZmap = GetBasicVolZmap( m_pGDB->GetGeoObj( nZmapId)) ;
if ( pZmap == nullptr)
return false ;
// recupero la stringa nome dell'utensile
string sToolName ;
sToolName = vsParams[3] ;
sToolName = vsParams[1] ;
// recupero il tipo di utensile
int nToolType ;
if ( ! FromString( vsParams[2], nToolType))
return false ;
if (nToolType < 0 || nToolType > 4)
return false ;
// recupero altezza utensile
double dH ;
if ( ! FromString( vsParams[3], dH))
return false ;
// recupero raggio utensile
double dTH ;
if ( ! FromString( vsParams[4], dTH))
return false ;
// recupero raggio corner
double dR ;
if ( ! FromString( vsParams[5], dR))
return false ;
double dTR ;
if ( ! FromString( vsParams[6], dTR))
return false ;
double dRc ;
if ( ! FromString( vsParams[7], dRc))
return false ;
// assegno utensile
return pZmap->SetTool( sToolName, nToolType, pToolOutline) ;
return pZmap->SetStdTool( sToolName, nToolType, dH, dTH, dR, dTR, dRc) ;
}
//----------------------------------------------------------------------------
+1
View File
@@ -119,6 +119,7 @@ class GdbExecutor : public IGdbExecutor
bool VolZmapIntervalsAddiction( const STRVECTOR& vsParams) ;
bool VolZmapMilling( const STRVECTOR& vsParams) ;
bool VolZmapSetTool( const STRVECTOR& vsParams) ;
bool VolZmapSetStdTool( const STRVECTOR& vsParams) ;
bool ExecuteText( const std::string& sCmd2, const STRVECTOR& vsParams) ;
bool TextSimple( const STRVECTOR& vsParams) ;
bool TextComplete( const STRVECTOR& vsParams) ;
+3596 -46
View File
File diff suppressed because it is too large Load Diff
+56 -7
View File
@@ -25,6 +25,9 @@
#include <string>
// Tipi utensile
enum ToolType { GenericTool = 0, CylindricalMill = 1, BallEndMill = 2, BullNoseMill = 3, ConusMill = 4} ;
//----------------------------------------------------------------------------
class VolZmap : public IVolZmap, public IGeoObjRW
{
@@ -69,8 +72,9 @@ class VolZmap : public IVolZmap, public IGeoObjRW
bool SubtractIntervals( const Point3d& ptP, double dMin, double dMax) ;
bool AddIntervals( unsigned int nI, unsigned int nJ, double dMin, double dMax) ;
bool AddIntervals( const Point3d& ptP, double dMin, double dMax) ;
bool SetTool( const std::string& pToolName, unsigned int nToolType, const CurveComposite* pToolOutline) ;
bool MillingStep( const Point3d& ptPs, const Point3d& ptPe, const Vector3d& vtDs, const Vector3d& vtDe) ;
bool SetTool( const std::string& pToolName, const CurveComposite* pToolOutline) ;
bool SetStdTool( const std::string& pToolName, unsigned int nToolType, double dH, double dTH, double dR, double dTR, double dRc = 0) ;
bool MillingStep( const Point3d& ptPs, const Point3d& ptPe, Vector3d& vtDs, Vector3d& vtDe) ;
public : // IGeoObjRW
virtual int GetNgeId( void) const ;
@@ -94,8 +98,44 @@ class VolZmap : public IVolZmap, public IGeoObjRW
bool CalcDexelPrisms( int nPos1, int nPos2, TRIA3DLIST& lstTria) const ;
bool AddDexelSideFace( int nPos, int nPosAdj, const Point3d& ptP, const Point3d& ptQ,
const Vector3d& vtZ, const Vector3d& vtNorm, TRIA3DLIST& lstTria) const ;
bool MillingDrill( const Point3d& ptLs, const Point3d& ptLe, double dHeight, double dRadius) ;
bool MillingPerp( Point3d& ptPs, Point3d& ptPe, double dHeight, double dRadius) ;
// frese: cylindrical, ball-end e bull-nose
// Versore utensile parallelo all'asse Z
bool MillingDrillZ( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingPerpZ( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingZ( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
inline bool GetMinMaxZ( unsigned int nI, unsigned int nJ, double dZCutBase, double dDeltaZ, double dSqDist, const Vector3d& vtToolDir) ;
inline bool GetMinMaxZGen( unsigned int nI, unsigned int nJ, double dProj, double dSqd, double dLenPath, double dZheight, double dDelta, const Vector3d& vtToolDir) ;
// Versore utensile nel piano XY
bool MillingDrillXY( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingPerpXY( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingXYPlaneGen( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingXYCyl( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingXYBall( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingXYPlusCyl( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingXYPlusBall( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
bool MillingXYLongVert( const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir) ;
inline bool GetMinMaxXY( unsigned int nI, unsigned int nJ, double dProj, double dZheight, double dSqD, double dPathPerp, double dPathPar, double dScProd) ;
inline bool GetMMPlaneGenCyl( unsigned int i, unsigned int j, double dZ, double dLen1, double dLen2, double dProj1, double dProj2) ;
inline bool GetMMPlaneGenBall( unsigned int i, unsigned int j, double dZ, double dLen1, double dLen2, Point3d ptIxy, Vector3d vtMove, Vector3d vtV1, Vector3d vtV2) ;
// frese: conus
// Versore utensile parallelo all'asse Z
bool ConusDrillingZ( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
bool ConusPerpZ( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
//bool ConusMillingZDr( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
//bool ConusMillingZDrP( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
//bool ConusMillingZDrPnew( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
//bool ConusMillingZDrPnew2( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
bool ConusMillingZDr( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
bool ConusMillingZSw( const Point3d ptLs, const Point3d ptLe, const Vector3d vtToolDir) ;
inline bool GetMinMaxZSw( const Point3d ptO, unsigned int nStartI, unsigned int nEndI, unsigned int nStartJ, unsigned int nEndJ, double dMinZ, double dMaxZ, double dMinRad, double dMaxRad, double dDir, double dDeltaZ) ;
inline bool GetMinMaxZDr( const Point3d ptO, unsigned int nStartI, unsigned int nEndI, unsigned int nStartJ, unsigned int nEndJ, double dMinZ, double dMaxZ, double dMinRad, double dMaxRad, double dDir, double dDeltaZ) ;
// utensile generico
inline bool GetMinMaxZGenTool( unsigned int nI, unsigned int nJ, double dZCutBase, double dDeltaZ, double dSqDist, const Vector3d& vtToolDir) ;
private :
enum Status { ERR = 0, OK = 1, TO_VERIFY = 2} ;
@@ -110,11 +150,18 @@ class VolZmap : public IVolZmap, public IGeoObjRW
unsigned int m_nNx ; // i = 0, 1, ..., m_nNx - 1
unsigned int m_nNy ; // j = 0, 1, ..., m_nNy - 1
unsigned int m_nDim ;
std::vector <std::vector<double>> m_ZValues ;
double m_dMinZ ;
double m_dMaxZ ;
std::vector <std::vector<double>> m_ZValues ;
CurveComposite m_ToolOutline ;
std::string m_sToolName ;
unsigned int m_nToolType ; // 0, 1, 2 per cylindrical mill, fresa ball-end, bull nose
unsigned int m_nToolType ;
CurveComposite m_ToolOutline ;
double m_dHeight ;
double m_dTipHeight ;
double m_dRadius ;
double m_dRCorner ;
double m_dTipRadius ;
} ;
//-----------------------------------------------------------------------------
@@ -132,3 +179,5 @@ inline VolZmap* GetBasicVolZmap( IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != VOL_ZMAP)
return nullptr ;
return (static_cast<VolZmap*>(pGObj)) ; }