EgtExecutor 1.6v6 :

- modificata in Exe e Lua ImportCnc per aggiunta del parametro nFlag
- corretta ExeAdjustFlatPartLayer per non trasformare in composite cerchi completi.
This commit is contained in:
Dario Sassi
2016-10-26 16:04:51 +00:00
parent 3feaa09d51
commit 9b54f331c4
4 changed files with 11 additions and 7 deletions
+2 -2
View File
@@ -132,7 +132,7 @@ ExeImportStl( const string& sFilePath, double dScaleFactor)
//-----------------------------------------------------------------------------
bool
ExeImportCnc( const string& sFilePath)
ExeImportCnc( const string& sFilePath, int nFlag)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_GEOMDB( pGseCtx, false)
@@ -144,7 +144,7 @@ ExeImportCnc( const string& sFilePath)
PtrOwner<IImportCnc> pImpCnc( MyCreateImportCnc()) ;
bOk = bOk && ! IsNull( pImpCnc) ;
// eseguo l'importazione
bOk = bOk && pImpCnc->Import( sFilePath, pGseCtx->m_pGeomDB, nPartId) ;
bOk = bOk && pImpCnc->Import( sFilePath, pGseCtx->m_pGeomDB, nPartId, nFlag) ;
// aggiorno stato file corrente
pGseCtx->m_sFilePath = sFilePath ;
ExeSetModified() ;
+4 -3
View File
@@ -631,16 +631,17 @@ ExeAdjustFlatPartLayer( int nLayerId)
// Passo all'entità successiva
nId = nNextId ;
}
// Unisco gli archi consecutivi con la stessa concavità
// Unisco gli archi consecutivi con la stessa concavità (escluse circonferenze)
INTVECTOR vAccwIds ;
INTVECTOR vAcwIds ;
nId = pGeomDB->GetFirstInGroup( nLayerId) ;
while ( nId != GDB_ID_NULL && bOk) {
const ICurveArc* pArc = GetCurveArc( pGeomDB->GetGeoObj( nId)) ;
if ( pArc != nullptr) {
if ( pArc->GetAngCenter() > 0)
double dAngCen = pArc->GetAngCenter() ;
if ( dAngCen > EPS_ANG_SMALL && dAngCen < ANG_FULL - EPS_ANG_SMALL)
vAccwIds.emplace_back( nId) ;
else
else if ( dAngCen < - EPS_ANG_SMALL && dAngCen > - ANG_FULL + EPS_ANG_SMALL)
vAcwIds.emplace_back( nId) ;
}
nId = pGeomDB->GetNext( nId) ;
BIN
View File
Binary file not shown.
+5 -2
View File
@@ -15,6 +15,7 @@
#include "stdafx.h"
#include "LUA.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkLuaAux.h"
#include "/EgtDev/Include/EgnStringUtils.h"
@@ -58,12 +59,14 @@ LuaImportStl( lua_State* L)
static int
LuaImportCnc( lua_State* L)
{
// 1 parametro : path del file da importare
// 1 o 2 parametri : FilePath [, Flag]
string sFilePath ;
LuaCheckParam( L, 1, sFilePath)
int nFlag = EIC_FLAG_NONE ;
LuaGetParam( L, 2, nFlag) ;
LuaClearStack( L) ;
// apro il file
bool bOk = ExeImportCnc( sFilePath) ;
bool bOk = ExeImportCnc( sFilePath, nFlag) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;