EgtMachKernel :

- aggiunto PARALLEL_SLANT da faccia
- aggiunte mortase inclinate.
This commit is contained in:
Dario Sassi
2019-06-22 07:32:48 +00:00
parent 3e542bd41f
commit fd99ed62f4
3 changed files with 18 additions and 3 deletions
+1 -1
View File
@@ -957,7 +957,7 @@ Mortising::GetCurve( SelData Id)
else if ( ( m_Params.m_nFaceUse & 32) != 0)
nToolDir = TOOL_ORTHO ;
else
nToolDir = TOOL_PARAL ;
nToolDir = TOOL_PAR_SLANT ;
int nFaceUse = ( m_Params.m_nFaceUse & 31) ;
AdjustCurveFromSurf( pCrvCompo, nToolDir, nFaceUse, m_TParams.m_dThick) ;
// la restituisco
+16 -1
View File
@@ -611,6 +611,10 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF
Vector3d vtN ;
pCrvCompo->GetExtrusion( vtN) ;
// direzioni lati precedente e successivo
Vector3d vtDirPrev ;
Vector3d vtDirNext ;
// se richiesto contorno
if ( nFaceUse == FACE_CONT) {
// cerco l'estremo più alto e lo imposto come inizio
@@ -654,6 +658,7 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF
if ( ( vtN ^ vtDir) * vtRef < COS_ANG_MAX) {
delete( pCrvCompo->RemoveFirstOrLastCurve( false)) ;
pCrv = pCrvCompo->GetFirstCurve() ;
vtDirPrev = vtDir ;
}
else
break ;
@@ -664,6 +669,7 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF
if ( ( vtN ^ vtDir) * vtRef < COS_ANG_MAX) {
delete( pCrvCompo->RemoveFirstOrLastCurve( true)) ;
pCrv = pCrvCompo->GetLastCurve() ;
vtDirNext = vtDir ;
}
else
break ;
@@ -692,7 +698,7 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF
}
pCrvCompo->SetThickness( 0) ;
}
else { // nToolDir == TOOL_PARAL
else { // nToolDir == TOOL_PARAL o TOOL_PAR_SLANT
// sistemo versore
Point3d ptStart, ptEnd ;
pCrvCompo->GetStartPoint( ptStart) ;
@@ -701,6 +707,15 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF
Vector3d vtExtr = vtN ^ vtT ;
if ( ! vtExtr.Normalize())
return false ;
if ( nToolDir == TOOL_PAR_SLANT) {
Vector3d vtDirPN = - vtDirPrev + vtDirNext ;
if ( vtDirPN.Normalize()) {
if ( vtDirPN * vtExtr > 0)
vtExtr = vtDirPN ;
else
vtExtr = - vtDirPN ;
}
}
pCrvCompo->SetExtrusion( vtExtr) ;
// elimino eventuali parti iniziali e/o finali dirette circa come il versore
const double MAX_ALL_COS = cos( 25 * DEGTORAD) ;
+1 -1
View File
@@ -166,6 +166,6 @@ inline Operation* GetOperation( IUserObj* pUserObj)
//----------------------------------------------------------------------------
// tipo posizione utensile
enum { TOOL_PARAL = 1, TOOL_ORTHO = 2, TOOL_ORTUP = 3} ;
enum { TOOL_PARAL = 1, TOOL_ORTHO = 2, TOOL_ORTUP = 3, TOOL_PAR_SLANT= 4} ;
// tipo di utilizzo contorno faccia
enum { FACE_DOWN = 1, FACE_TOP = 2, FACE_FRONT = 3, FACE_BACK = 4, FACE_LEFT = 5, FACE_RIGHT = 6, FACE_CONT = 7} ;