From bea7644551553a9711b5940ff04e0d50ffcfdb5b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 30 Dec 2014 17:32:23 +0000 Subject: [PATCH] EgtGeomKernel 1.5l2 : - correzione a offset a sinistra con chamfer e extend - correzione a offset semplice con angoli di 180 deg - modifica a calcolo colore back per superfici. --- Color.cpp | 6 +++--- CurveCompositeOffset.cpp | 14 ++++++++------ EgtGeomKernel.rc | Bin 11718 -> 11718 bytes GdbExecutor.cpp | 9 ++++----- PointsPCA.h | 3 +-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Color.cpp b/Color.cpp index 78849fe..2a98971 100644 --- a/Color.cpp +++ b/Color.cpp @@ -90,8 +90,8 @@ Color GetSurfBackColor( Color cCol) { float fLum = ( cCol.GetRed() + cCol.GetGreen() + cCol.GetBlue()) / 3 ; - return Color( 0.4 * fLum + 0.2 * cCol.GetRed(), - 0.4 * fLum + 0.2 * cCol.GetGreen(), - 0.4 * fLum + 0.2 * cCol.GetBlue(), + return Color( 0.4 * fLum + 0.4 * cCol.GetRed(), + 0.4 * fLum + 0.4 * cCol.GetGreen(), + 0.4 * fLum + 0.4 * cCol.GetBlue(), cCol.GetAlpha()) ; } diff --git a/CurveCompositeOffset.cpp b/CurveCompositeOffset.cpp index ffefa38..5bd390a 100644 --- a/CurveCompositeOffset.cpp +++ b/CurveCompositeOffset.cpp @@ -295,15 +295,17 @@ VerifyAndAdjustExternalAngle( ICurve* pCrv1, ICurve* pCrv2, double dDist, int nT if ( IsNull( pCrvOri2) || ! pCrvOri2->SimpleOffset( - dDist, nType)) return false ; // eseguo calcolo spostato su curve originali - Point3d ptDummy ; double dU1 = 1 ; double dU2 = 0 ; + Point3d ptDummy ; + Vector3d vtDir1b ; + Vector3d vtDir2b ; if ( ! MoveParamToAvoidTg( dU1, ICurve::FROM_MINUS, *pCrvOri1) || - ! pCrvOri1->GetPointTang( dU1, ICurve::FROM_MINUS, ptDummy, vtDir1) || + ! pCrvOri1->GetPointTang( dU1, ICurve::FROM_MINUS, ptDummy, vtDir1b) || ! MoveParamToAvoidTg( dU2, ICurve::FROM_PLUS, *pCrvOri2) || - ! pCrvOri2->GetPointTang( dU2, ICurve::FROM_PLUS, ptDummy, vtDir2)) + ! pCrvOri2->GetPointTang( dU2, ICurve::FROM_PLUS, ptDummy, vtDir2b)) return false ; - if ( ! vtDir1.GetAngleXY( vtDir2, dAngDeg)) + if ( ! vtDir1b.GetAngleXY( vtDir2b, dAngDeg)) return false ; } @@ -336,7 +338,7 @@ VerifyAndAdjustExternalAngle( ICurve* pCrv1, ICurve* pCrv2, double dDist, int nT case ICurve::OFF_CHAMFER : { // lunghezza aggiuntiva in tangenza - double dLen = dDist * tan( fabs( dAngDeg) / 4 * DEGTORAD) ; + double dLen = fabs( dDist) * tan( fabs( dAngDeg) / 4 * DEGTORAD) ; // punti di costruzione smusso Point3d ptP1, ptP1a, ptP2a, ptP2 ; if ( ! pCrv1->GetEndPoint( ptP1) || ! pCrv2->GetStartPoint( ptP2)) @@ -387,7 +389,7 @@ VerifyAndAdjustExternalAngle( ICurve* pCrv1, ICurve* pCrv2, double dDist, int nT case ICurve::OFF_EXTEND : { // lunghezza aggiuntiva in tangenza - double dLen = dDist * tan( fabs( dAngDeg) / 2 * DEGTORAD) ; + double dLen = fabs( dDist) * tan( fabs( dAngDeg) / 2 * DEGTORAD) ; // punti di costruzione estensione Point3d ptP1, ptPc, ptP2 ; if ( ! pCrv1->GetEndPoint( ptP1) || ! pCrv2->GetStartPoint( ptP2)) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index df59174a14f9835f7ea312d7b85dfa28228877ca..3b7967ce439cf11d417ff0407182434f5c8ae46f 100644 GIT binary patch delta 260 zcmX>WeJpyzI%aKGhCGIJh8%`WhGK>c1_cHUhESkLCPN8BDnkm89}HwAf_cT0FKS6| z{=m$^%xJXvHs5)s$u(R$lRrqRF&a(YC?LLBKq-!K^8{`$h_o$`0t*`mtzZFbKoS8e z?2(2l#9~eesm?k$`JT?a$*WeJpyzI%aiGhCGIJh8%`ehGHOAV9;O)W+-7u1ma8}FBB-731Uyas3kpFPd#gM z9Lqc=M#Ihb`OY&hX`jGK#;zcG^Fwu6)J>CBt_NlipBAM6KDupe@OZchZce6ybVG-gbx%@?)4G64V{ CS4hAB diff --git a/GdbExecutor.cpp b/GdbExecutor.cpp index b6e1bbf..23fd51c 100644 --- a/GdbExecutor.cpp +++ b/GdbExecutor.cpp @@ -47,8 +47,7 @@ using namespace std ; //---------------------------------------------------------------------------- // Per Id di entità -static const int ID_SEL = -2 ; -static const int ID_NO = -3 ; +static const int ID_NO = -99 ; // Per tipo di costruzione di poligono static const int POLYG_INSCR = 1 ; static const int POLYG_CIRC = 2 ; @@ -160,7 +159,7 @@ GdbExecutor::AddStandardVariables( void) return false ; // imposto variabili predefinite m_pParser->AddVariable( "$ROOT", GDB_ID_ROOT) ; - m_pParser->AddVariable( "$SEL", ID_SEL) ; + m_pParser->AddVariable( "$SEL", GDB_ID_SEL) ; m_pParser->AddVariable( "$NN", ID_NO) ; // verifico la corrispondenza tra GDB_ID_NULL e CMD_ID_NULL return ( GDB_ID_NULL == CMD_ID_NULL) ; @@ -2983,7 +2982,7 @@ GdbExecutor::GetNamesParam( const string& sParam, INTVECTOR& vnNames) for ( Iter = vsNames.begin() ; Iter != vsNames.end() ; ++Iter) { Trim( (*Iter), " \t\r\n()") ; int nId = GetIdParam( *Iter) ; - if ( nId != ID_SEL) { + if ( nId != GDB_ID_SEL) { vnNames.push_back( nId) ; } else { @@ -3434,7 +3433,7 @@ GdbExecutor::GetPointsParam( const string& sParam, const Frame3d& frPnt, PolyLin STRVECTOR::iterator Iter ; for ( Iter = vsPoints.begin() ; Iter != vsPoints.end() ; ++Iter) { Trim( (*Iter), " \t\r\n") ; - if ( GetIdParam( *Iter) == ID_SEL) { + if ( GetIdParam( *Iter) == GDB_ID_SEL) { int nId = m_pGDB->GetFirstSelectedObj() ; while ( nId != GDB_ID_NULL) { Point3d ptP ; diff --git a/PointsPCA.h b/PointsPCA.h index a2d8770..0aceff0 100644 --- a/PointsPCA.h +++ b/PointsPCA.h @@ -13,8 +13,7 @@ #pragma once -#include "/EgtDev/Include/EGkFrame3d.h" -#include "/EgtDev/Include/EGkPlane3d.h" +#include "/EgtDev/Include/EGkPoint3d.h" #include "/EgtDev/Extern/Eigen/Dense" //----------------------------------------------------------------------------