diff --git a/EXE_Trimming.cpp b/EXE_Trimming.cpp index 0614d14..71866b4 100644 --- a/EXE_Trimming.cpp +++ b/EXE_Trimming.cpp @@ -866,3 +866,30 @@ ExeTrimmingGetSurfBzSyncPoints( int nParentId, int nEdge1Id, int nEdge2Id, doubl return bOk ; } + +// --------------------------------------------------------------------------- +bool +ExeRegolarizeSurfaceLocally( int nSurfId, int nSyncStartId, int nSyncEndId, double dLinTol) +{ + bool bOk = true ; + // Verifica database geometrico + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + + // recupero la superficie + ISurfBezier* pSurfBez = GetSurfBezier( GetSurf( pGeomDB->GetGeoObj( nSurfId))) ; + + // recupero le due isocurve + const ICurve* pSyncStart = GetCurveLine( GetCurve( pGeomDB->GetGeoObj( nSyncStartId))) ; + const ICurve* pSyncEnd = GetCurveLine( GetCurve( pGeomDB->GetGeoObj( nSyncEndId))) ; + Point3d ptS1 ; pSyncStart->GetStartPoint( ptS1) ; + Point3d ptE1 ; pSyncStart->GetEndPoint( ptE1) ; + BIPOINT bpIsoStart( ptS1, ptE1) ; + Point3d ptS2 ; pSyncEnd->GetStartPoint( ptS2) ; + Point3d ptE2 ; pSyncEnd->GetEndPoint( ptE2) ; + BIPOINT bpIsoEnd( ptS2, ptE2) ; + + bOk = RegolarizeBordersLocally( pSurfBez, bpIsoStart, bpIsoEnd, 0.2) ; + + return bOk ; +} \ No newline at end of file diff --git a/Lua_Trimming.cpp b/Lua_Trimming.cpp index 88214e3..0522d32 100644 --- a/Lua_Trimming.cpp +++ b/Lua_Trimming.cpp @@ -283,6 +283,24 @@ LuaTrimmingGetSurfBzSyncPoints( lua_State* L) return 3 ; } +//------------------------------------------------------------------------------- +static int +LuaRegolarizeSurfaceLocally( lua_State* L) +{ + int nSurfId = GDB_ID_NULL ; + LuaCheckParam( L, 1, nSurfId) + int nSyncStartId ; + LuaCheckParam( L, 2, nSyncStartId) + int nSyncEndId ; + LuaCheckParam( L, 3, nSyncEndId) + double dLinTol ; + LuaCheckParam( L, 4, dLinTol) + + bool bOk = ExeRegolarizeSurfaceLocally( nSurfId, nSyncStartId, nSyncEndId, dLinTol) ; + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- bool LuaInstallTrimming( LuaMgr& luaMgr) @@ -302,5 +320,7 @@ LuaInstallTrimming( LuaMgr& luaMgr) // --- Recupero linee di sincronizzazione bOk = bOk && luaMgr.RegisterFunction( "EgtTrimmingInterpolateSyncLines", LuaTrimmingInterpolateSyncLines) ; bOk = bOk && luaMgr.RegisterFunction( "EgtTrimmingGetSurfBzSyncPoints", LuaTrimmingGetSurfBzSyncPoints) ; + // --- Modifica della superficie + bOk = bOk && luaMgr.RegisterFunction( "EgtRegolarizeSurfaceLocally", LuaRegolarizeSurfaceLocally) ; return bOk ; } \ No newline at end of file