diff --git a/EXE_GdbCreateSurf.cpp b/EXE_GdbCreateSurf.cpp index 530b0dd..962e87b 100644 --- a/EXE_GdbCreateSurf.cpp +++ b/EXE_GdbCreateSurf.cpp @@ -1082,7 +1082,7 @@ ExeCreateSurfTmByRevolve( int nParentId, int nCrvId, int ExeCreateSurfTmByScrewing( int nParentId, int nCrvId, const Point3d& ptAx, const Vector3d& vtAx, - double dAngRotDeg, double dMove, double dLinTol, int nRefType) + double dAngRotDeg, double dMove, bool bCapEnds, double dLinTol, int nRefType) { IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) @@ -1098,7 +1098,7 @@ ExeCreateSurfTmByScrewing( int nParentId, int nCrvId, Point3d ptAxL = GetPointLocal( pGeomDB, ptAx, nRefType, frLoc) ; Vector3d vtAxL = GetVectorLocal( pGeomDB, vtAx, nRefType, frLoc) ; // calcolo la superficie - ISurfTriMesh* pSTM = ( bOk ? GetSurfTriMeshByScrewing( CrvLoc, ptAxL, vtAxL, dAngRotDeg, dMove, dLinTol) : nullptr) ; + ISurfTriMesh* pSTM = ( bOk ? GetSurfTriMeshByScrewing( CrvLoc, ptAxL, vtAxL, dAngRotDeg, dMove, bCapEnds, dLinTol) : nullptr) ; // inserisco la superficie nel DB int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, pSTM) : GDB_ID_NULL) ; ExeSetModified() ; @@ -1110,6 +1110,7 @@ ExeCreateSurfTmByScrewing( int nParentId, int nCrvId, ToString( vtAx) + "}," + ToString( dAngRotDeg) + "," + ToString( dMove) + "," + + ( bCapEnds ? "true" : "false") + "," + ToString( dLinTol) + "," + RefTypeToString( nRefType) + ")" + " -- Id=" + ToString( nNewId) ; diff --git a/LUA_GdbCreateSurf.cpp b/LUA_GdbCreateSurf.cpp index 7792d28..0cf7cdd 100644 --- a/LUA_GdbCreateSurf.cpp +++ b/LUA_GdbCreateSurf.cpp @@ -529,7 +529,7 @@ LuaCreateSurfTmByRevolve( lua_State* L) static int LuaCreateSurfTmByScrewing( lua_State* L) { - // 6 o 7 o 8 parametri : ParentId, CrvId, ptAx, vtAx, dAngRotDeg, dMove [, dTol] [, nRefType] + // 6 o 7 o 8 o 9 parametri : ParentId, CrvId, ptAx, vtAx, dAngRotDeg, dMove [, bCapEnds] [, dTol] [, nRefType] int nParentId ; LuaCheckParam( L, 1, nParentId) int nCrvId ; @@ -542,15 +542,19 @@ LuaCreateSurfTmByScrewing( lua_State* L) LuaCheckParam( L, 5, dAngRotDeg) double dMove ; LuaCheckParam( L, 6, dMove) + int nPar = 7 ; + bool bCapEnds = false ; + if ( LuaGetParam( L, nPar, bCapEnds)) + ++ nPar ; double dLinTol = LIN_TOL_DEF ; + if ( LuaGetParam( L, nPar, dLinTol)) + ++ nPar ; int nRefType = RTY_DEFAULT ; - if ( LuaGetParam( L, 7, dLinTol)) - LuaGetParam( L, 8, nRefType) ; - else - LuaGetParam( L, 7, nRefType) ; + if ( LuaGetParam( L, nPar, nRefType)) + ++ nPar ; LuaClearStack( L) ; // creo STM riempiendo un contorno piano - int nId = ExeCreateSurfTmByScrewing( nParentId, nCrvId, ptAx, vtAx, dAngRotDeg, dMove, dLinTol, nRefType) ; + int nId = ExeCreateSurfTmByScrewing( nParentId, nCrvId, ptAx, vtAx, dAngRotDeg, dMove, bCapEnds, dLinTol, nRefType) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetParam( L, nId) ;