EgtExecutor :

- in Trimming piccole migliorie/correzioni.
This commit is contained in:
Riccardo Elitropi
2026-01-26 18:04:19 +01:00
parent e68153fb70
commit 7cf368e518
2 changed files with 31 additions and 16 deletions
+13 -6
View File
@@ -297,8 +297,8 @@ ExeTrimmingGetAdjSurfs( const INTVECTOR& vSurfId, const INTVECTOR& vOtherSurfId,
// ---------------------------------------------------------------------------
bool
ExeTrimmingGetBorders( int nParentId, const SELVECTOR& vIds, double dLinTol, double dAngTol,
int& nFirstId, int& nCount)
ExeTrimmingGetBorders( int nParentId, const SELVECTOR& vIds, double dSurfLinTol, double dSurfAngTol,
double dLinTol, double dAngTol, int& nFirstId, int& nCount)
{
// Verifica database geometrico
IGeomDB* pGeomDB = GetCurrGeomDB() ;
@@ -340,7 +340,7 @@ ExeTrimmingGetBorders( int nParentId, const SELVECTOR& vIds, double dLinTol, dou
// Calcolo le curve di Edge grezze ( quindi i tratti lineari)
ICRVCOMPOPOVECTOR vRawEdges ;
bOk = bOk && GetTrimmingRawEdges( vpSurf, vFaces, dLinTol, dAngTol, vRawEdges) &&
bOk = bOk && GetTrimmingRawEdges( vpSurf, vFaces, dSurfLinTol, dSurfAngTol, vRawEdges) &&
( ! vRawEdges.empty()) ;
// Calcolo le curve di Edge approssimate mediante curve di Bezier
@@ -363,6 +363,8 @@ ExeTrimmingGetBorders( int nParentId, const SELVECTOR& vIds, double dLinTol, dou
// Se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtTrimmingGetBorders(" + IdToString( nParentId) + "," +
ToString( dSurfLinTol) + "," +
ToString( dSurfAngTol) + "," +
ToString( dLinTol) + "," +
ToString( dAngTol) + ")" ;
sLua += " -- bOk=" + ToString( bOk) +
@@ -375,8 +377,9 @@ ExeTrimmingGetBorders( int nParentId, const SELVECTOR& vIds, double dLinTol, dou
// ---------------------------------------------------------------------------
bool
ExeTrimmingGetBordersByNormals( int nParentId, const SELVECTOR& vIds, double dLinTol,
double dAngTol, double dThick, Point3d& ptNear, int& nFirstId, int& nCount)
ExeTrimmingGetBordersByNormals( int nParentId, const SELVECTOR& vIds, double dSurfLinTol,
double dSurfAngTol, double dLinTol, double dAngTol, double dThick,
Point3d& ptNear, int& nFirstId, int& nCount)
{
// Verifica database geometrico
IGeomDB* pGeomDB = GetCurrGeomDB() ;
@@ -418,7 +421,7 @@ ExeTrimmingGetBordersByNormals( int nParentId, const SELVECTOR& vIds, double dLi
// Calcolo le curve di Edge approssimate mediante curve di Bezier
ICRVCOMPOPOVECTOR vBezierEdges ;
bOk = bOk && GetTrimmingFinalBorders( vpSurf, vFaces, dLinTol, dAngTol, dThick, vBezierEdges) ;
bOk = bOk && GetTrimmingFinalBorders( vpSurf, vFaces, dSurfLinTol, dSurfAngTol, dLinTol, dAngTol, dThick, vBezierEdges) ;
if ( bOk) {
// Se non ho un punto di vicinanza, le inserisco tutte
if ( ! ptNear.IsValid()) {
@@ -716,7 +719,11 @@ ExeTrimmingGetSurfBzSyncPoints( int nParentId, int nEdge1Id, int nEdge2Id, doubl
if ( bOk) {
// Se devo visualizzarne più di quante sono, allora le visualizzo tutte
if ( nLineNbr >= nToTSyncLines) {
bool bAllClosed = ( pCrvEdge1->IsClosed() && pCrvEdge2->IsClosed()) ;
for ( int nL = 0 ; bOk && nL < nToTSyncLines ; ++ nL) {
// Se ho due curve chiuse, non ripeto l'ultimo tratto di Sync
if ( bAllClosed && nL == nToTSyncLines - 1)
continue ;
PtrOwner<ICurveLine> pLine( CreateCurveLine()) ;
bOk = ( ! IsNull( pLine) && pLine->Set( vSyncPoints[nL].first, vSyncPoints[nL].second)) ;
if ( bOk) {
+18 -10
View File
@@ -125,20 +125,24 @@ LuaTrimmingGetAdjSurfs( lua_State* L)
static int
LuaTrimmingGetBorders( lua_State* L)
{
// 4 parametri : nParentId, vIds, dLinTol, dAngTol
// 6 parametri : nParentId, vIds, dSurfLinTol, dSurfAngTol, dLinTol, dAngTol
int nParentId ;
LuaCheckParam( L, 1, nParentId)
SELVECTOR vIds ;
LuaCheckParam( L, 2, vIds)
double dSurfLinTol ;
LuaCheckParam( L, 3, dSurfLinTol) ;
double dSurfAngTol ;
LuaCheckParam( L, 4, dSurfAngTol) ;
double dLinTol ;
LuaCheckParam( L, 3, dLinTol)
LuaCheckParam( L, 5, dLinTol)
double dAngTol ;
LuaCheckParam( L, 4, dAngTol)
LuaCheckParam( L, 6, dAngTol)
LuaClearStack( L) ;
// Creo le curve di Edge grezze
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
bool bOk = ExeTrimmingGetBorders( nParentId, vIds, dLinTol, dAngTol, nFirstId, nCount) ;
bool bOk = ExeTrimmingGetBorders( nParentId, vIds, dSurfLinTol, dSurfAngTol, dLinTol, dAngTol, nFirstId, nCount) ;
LuaSetParam( L, bOk) ;
LuaSetParam( L, nFirstId) ;
LuaSetParam( L, nCount) ;
@@ -149,24 +153,28 @@ LuaTrimmingGetBorders( lua_State* L)
static int
LuaTrimmingGetBordersByNormals( lua_State* L)
{
// 5 o 6 parametri : nParentId, vIds, dLinTol, dAngTol, dThickness [, ptNear]
// 7 o 8 parametri : nParentId, vIds, dLinTol, dAngTol, dThickness [, ptNear]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
SELVECTOR vIds ;
LuaCheckParam( L, 2, vIds)
double dSurfLinTol ;
LuaCheckParam( L, 3, dSurfLinTol) ;
double dSurfAngTol ;
LuaCheckParam( L, 4, dSurfAngTol) ;
double dLinTol ;
LuaCheckParam( L, 3, dLinTol)
LuaCheckParam( L, 5, dLinTol)
double dAngTol ;
LuaCheckParam( L, 4, dAngTol)
LuaCheckParam( L, 6, dAngTol)
double dThickness ;
LuaCheckParam( L, 5, dThickness)
LuaCheckParam( L, 7, dThickness)
Point3d ptNear = P_INVALID ;
LuaGetParam( L, 6, ptNear) ;
LuaGetParam( L, 8, ptNear) ;
LuaClearStack( L) ;
// Creo le curve di Edge grezze
int nFirstId = GDB_ID_NULL ;
int nCount = 0 ;
bool bOk = ExeTrimmingGetBordersByNormals( nParentId, vIds, dLinTol, dAngTol, dThickness, ptNear, nFirstId, nCount) ;
bool bOk = ExeTrimmingGetBordersByNormals( nParentId, vIds, dSurfLinTol, dSurfAngTol, dLinTol, dAngTol, dThickness, ptNear, nFirstId, nCount) ;
LuaSetParam( L, bOk) ;
LuaSetParam( L, nFirstId) ;
LuaSetParam( L, nCount) ;