EgtExecutor :
- modifica alla funzione EgtGetSurfFrZigZagInfill - modificati i valori di ritorno per LuaPocketing.
This commit is contained in:
+10
-9
@@ -34,6 +34,7 @@
|
||||
#include "/EgtDev/Include/EGkIntersLineBox.h"
|
||||
#include "/EgtDev/Include/EGkSurfLocal.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EGkCalcPocketing.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -310,7 +311,7 @@ ExeExtractSurfFrChunkLoops( int nId, int nChunk, int nDestGrpId, int* pnCount)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bool bStepCorrection, bool bInvert, int* pnCount)
|
||||
ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bool bSmooth, int* pnCount)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -327,21 +328,21 @@ ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bo
|
||||
bOk = bOk && pGeomDB->GetGlobFrame( nId, frSurf) ;
|
||||
// recupero il riferimento di destinazione
|
||||
Frame3d frDest ;
|
||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest) ;
|
||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest) ;
|
||||
|
||||
// creo il riferimento per il calcolo del percorso a zigzag
|
||||
// creo il riferimento per il calcolo del percorso a zigzag
|
||||
Vector3d vtN ;
|
||||
if ( bOk)
|
||||
vtN = pSfr->GetNormVersor() ;
|
||||
vtN = pSfr->GetNormVersor() ;
|
||||
bOk = bOk && vtN.ToGlob( frSurf) ;
|
||||
Frame3d frRef ;
|
||||
bOk = bOk && frRef.Set( ORIG, vtN) ;
|
||||
bOk = bOk && frRef.Rotate( ORIG, vtN, dAng) ;
|
||||
|
||||
// calcolo il percorso a zigzag
|
||||
// calcolo il percorso a zigzag
|
||||
bOk = bOk && pSfr->LocToLoc( frSurf, frRef) ;
|
||||
ICRVCOMPOPOVECTOR vpCrvs ;
|
||||
bOk = bOk && pSfr->GetZigZagInfill( dStep, bStepCorrection, bInvert, vpCrvs) ;
|
||||
bOk = bOk && CalcZigZagInfill( pSfr, dStep, bSmooth, vpCrvs) ;
|
||||
|
||||
// inserisco le curve risultanti nel DB
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
@@ -353,13 +354,13 @@ ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bo
|
||||
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vpCrvs[i])) : GDB_ID_NULL) ;
|
||||
bOk = bOk && ( nNewId != GDB_ID_NULL) ;
|
||||
// copio il materiale
|
||||
if ( ! pGeomDB->CopyMaterial( nId, nNewId))
|
||||
return GDB_ID_NULL ;
|
||||
//if ( ! pGeomDB->CopyMaterial( nId, nNewId))
|
||||
// return GDB_ID_NULL ;
|
||||
// aggiorno contatori
|
||||
if ( bOk && nFirstId == GDB_ID_NULL)
|
||||
nFirstId = nNewId ;
|
||||
if ( bOk)
|
||||
++ nCount ;
|
||||
++ nCount ;
|
||||
}
|
||||
ExeSetModified() ;
|
||||
|
||||
|
||||
+4
-6
@@ -242,7 +242,7 @@ LuaSurfFrRotateSimpleNoCollision( lua_State* L)
|
||||
static int
|
||||
LuaSurfFrGetZigZagInfill( lua_State* L)
|
||||
{
|
||||
// 6 parametri : nId, nDestGrpId, dSideStep, dAng, bAllowStepCorrection, bInvert
|
||||
// 5 parametri : nId, nDestGrpId, dSideStep, dAng, bSmooth
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
int nDestGrpId ;
|
||||
@@ -251,14 +251,12 @@ LuaSurfFrGetZigZagInfill( lua_State* L)
|
||||
LuaCheckParam( L, 3, dStep)
|
||||
double dAng ;
|
||||
LuaCheckParam( L, 4, dAng) ;
|
||||
bool bStepCorrection ;
|
||||
LuaCheckParam( L, 5, bStepCorrection)
|
||||
bool bInvert ;
|
||||
LuaCheckParam( L, 6, bInvert)
|
||||
bool bSmooth ;
|
||||
LuaCheckParam( L, 5, bSmooth) ;
|
||||
LuaClearStack( L) ;
|
||||
// recupero i contorni della superficie
|
||||
int nCount = 0 ;
|
||||
int nNewId = ExeSurfFrGetZigZagInfill( nId, nDestGrpId, dStep, dAng, bStepCorrection, bInvert, &nCount) ;
|
||||
int nNewId = ExeSurfFrGetZigZagInfill( nId, nDestGrpId, dStep, dAng, bSmooth, &nCount) ;
|
||||
// restituisco il risultato
|
||||
if ( nNewId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nNewId) ;
|
||||
|
||||
@@ -989,13 +989,15 @@ LuaPocketing( lua_State* L) {
|
||||
LuaCheckParam( L, 7, nDestGrpId) ;
|
||||
LuaClearStack( L) ;
|
||||
// calcolo delle curve elementari di svuotatura
|
||||
int nFirstId ;
|
||||
int nCrvCount ;
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
int nCrvCount = 0 ;
|
||||
bool bOk = ExePocketing( vId, dRad, dStep, dAngle, nType, bSmooth, nDestGrpId, nFirstId, nCrvCount) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
LuaSetParam( L, nFirstId) ;
|
||||
if ( ! bOk)
|
||||
LuaSetParam( L) ;
|
||||
else
|
||||
LuaSetParam( L, nFirstId) ;
|
||||
LuaSetParam( L, nCrvCount) ;
|
||||
return 3 ;
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user