EgtGeomKernel 1.8d1 :

- inserite le modifiche di Lorenzo a Zmap
- aggiunta a Zmap la possibilità di visualizzare le normali.
This commit is contained in:
Dario Sassi
2017-04-06 07:22:43 +00:00
parent ed16ca5f3a
commit e7b2c55cbb
9 changed files with 4839 additions and 1633 deletions
+99 -13
View File
@@ -17,6 +17,8 @@
#include "CurveArc.h"
#include "VolZmap.h"
#include "GeoConst.h"
#include "\EgtDev\Include\EGKLinePntTgCurve.h"
#include "\EgtDev\Include\EGKFilletChamfer.h"
using namespace std ;
@@ -100,24 +102,108 @@ VolZmap::SetAdvTool( const string& sToolName, double dH, double dR,
if ( dH < EPS_SMALL || dR < EPS_SMALL)
return false ;
// se altezza punta nulla, ricado nel caso standard
if ( dTipH < EPS_SMALL)
if ( dTipH < EPS_SMALL || abs( dTipR - dR) < 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 ;
}
// caso avanzato
else {
m_nToolType = ConusMill ;
m_dHeight = dH ;
m_dRadius = dR ;
m_dTipHeight = dTipH ;
m_dTipRadius = max( dTipR, 0.) ;
m_dRCorner = dCornR ;
if ( dCornR < EPS_SMALL) {
m_nToolType = ConusMill ;
m_dRCorner = 0 ;
}
// Se il raggio corner è non nullo
// l'utensile viene descritto da
// come utensile generico.
else {
m_dRCorner = dCornR ;
m_nToolType = GenericTool ;
// 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) ;
if ( m_dTipRadius < m_dRadius) {
Point3d ptInt( dTipR, - dH, 0) ;
Point3d ptLast( 0, - dH, 0) ;
CurveLine cLine1 ; cLine1.Set( pt2, ptInt) ;
CurveLine cLine2 ; cLine2.Set( ptInt, ptLast) ;
double dTrim1, dTrim2 ;
Point3d ptIn1 = ptInt + Y_AX * dCornR ;
Point3d ptIn2 = ptInt - X_AX * dCornR ;
ICurveArc* pArc = CreateFillet( cLine1, ptIn1, cLine2, ptIn2, Z_AX, dCornR, dTrim1, dTrim2) ;
cLine1.TrimEndAtParam( abs( dTrim1)) ;
cLine2.TrimStartAtParam( abs( dTrim2)) ;
Point3d pt3, pt4 ;
cLine1.GetEndPoint( pt3) ;
cLine2.GetStartPoint( pt4) ;
Point3d ptC = pArc -> GetCenter() ;
CurveArc cvArc ; cvArc.SetC2P( ptC, pt3, pt4) ;
m_ToolOutline.Clear() ;
CurveLine LineSt ; LineSt.Set( pt0, pt1) ;
m_ToolOutline.AddCurve( LineSt) ;
m_ToolOutline.AddLine( pt2);
m_ToolOutline.AddLine( pt3);
m_ToolOutline.AddCurve( cvArc) ;
m_ToolOutline.AddLine( ptLast) ;
}
else {
if ( dTipR - dCornR < 0)
return false ;
Point3d ptC( dTipR - dCornR, - dH + dCornR, 0) ;
CurveArc cvCirc ; cvCirc.SetXY( ptC, dCornR) ;
Point3d ptNear( ptC.x + dCornR, ptC.y + dCornR, 0) ;
ICurveLine* pLine = GetLinePointTgCurve( pt2, cvCirc, ptNear) ;
Point3d pt3 ;
pLine -> GetEndPoint( pt3) ;
Point3d pt4( ptC.x, - dH, 0) ;
CurveArc cvArc ; cvArc.SetC2P( ptC, pt3, pt4) ;
Point3d pt5( 0, - dH, 0) ;
m_ToolOutline.Clear() ;
CurveLine Line ; Line.Set( pt0, pt1) ;
m_ToolOutline.AddCurve( Line) ;
m_ToolOutline.AddLine( pt2);
m_ToolOutline.AddLine( pt3);
m_ToolOutline.AddCurve( cvArc) ;
m_ToolOutline.AddLine( pt5) ;
}
return SetGenTool( sToolName, &m_ToolOutline) ;
}
}
// assegno il nome
m_sToolName = sToolName ;
@@ -146,7 +232,7 @@ VolZmap::SetGenTool( const string& sToolName, const ICurveComposite* pToolOutlin
// Ciclo sulle curve componenti
while ( pCurve != nullptr) {
// Se la curva è un arco valuto approssimarlo
// Se la curva è un arco valuto se approssimarlo
if ( pCurve->GetType() == CRV_ARC) {
// Centro e punti iniziale e finale dell'arco