EgtExecutor :

- piccole aggiunte alla chiamata delle funzioni per le bezier
- aggiunta della chiamata alla funzione SurfBzByPointCurve.
This commit is contained in:
Daniele Bariletti
2024-07-16 11:22:58 +02:00
parent 560d7af700
commit ddbc2a81e6
7 changed files with 81 additions and 19 deletions
+37
View File
@@ -1174,6 +1174,43 @@ ExeCreateSurfTmByRevolve( int nParentId, int nCrvId,
return nNewId ;
}
//-------------------------------------------------------------------------------
int
ExeCreateSurfBzByPointCurve( int nParentId, int nCrvId, const Point3d& ptTop,
bool bCapEnds, double dLinTol, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// recupero la curva in locale
CurveLocal CrvLoc( pGeomDB, nCrvId, frLoc) ;
bOk = bOk && ( CrvLoc.Get() != nullptr) ;
// porto in locale punto e vettore asse
Point3d ptAxL = GetPointLocal( pGeomDB, ptTop, nRefType, frLoc) ;
// calcolo la superficie
ISurfBezier* pSTM = ( bOk ? GetSurfBezierRuled( ptTop, CrvLoc, dLinTol) : nullptr) ;
// inserisco la superficie nel DB
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, pSTM) : GDB_ID_NULL) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfBzByPointCurve(" + IdToString( nParentId) + "," +
ToString( nCrvId) + ",{" +
ToString( ptTop) + "},{" +
( bCapEnds ? "true" : "false") + "," +
ToString( dLinTol) + "," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco l'identificativo della nuova entità
return nNewId ;
}
//-------------------------------------------------------------------------------
int
ExeCreateSurfTmByScrewing( int nParentId, int nCrvId,