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.
This commit is contained in:
Dario Sassi
2014-12-30 17:32:23 +00:00
parent 3e8e7e2e2a
commit bea7644551
5 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -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()) ;
}
+8 -6
View File
@@ -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))
BIN
View File
Binary file not shown.
+4 -5
View File
@@ -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 ;
+1 -2
View File
@@ -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"
//----------------------------------------------------------------------------