Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ff02fe0fe | |||
| 52cb174832 | |||
| d3a6f99ba5 | |||
| e31fcee338 | |||
| 4746474864 | |||
| 7cefd64b2a | |||
| 8a51d5e3a5 | |||
| 00e6d24f2e |
@@ -59,7 +59,7 @@ ExePocketing( int nId, double dRad, double dStep, double dAngle, int nType, bool
|
||||
|
||||
// eseguo Pocketing
|
||||
ICRVCOMPOPOVECTOR vCrvCompoRes ;
|
||||
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 5., nType, bSmooth, true, false, false, false, true, P_INVALID, nullptr, false,
|
||||
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 5., nType, bSmooth, true, false, false, true, false, true, P_INVALID, nullptr, false,
|
||||
dStep, 0, INFINITO, 0, 0, INFINITO, false, 0., 0., vCrvCompoRes) ;
|
||||
nFirstId = GDB_ID_NULL ;
|
||||
nCrvCount = int( vCrvCompoRes.size()) ;
|
||||
|
||||
@@ -2358,7 +2358,7 @@ ExeCurveCompoSetTempParam( int nId, int nCrv, double dParam, int nParamInd)
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static bool
|
||||
MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, int nRefType)
|
||||
MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, int nRefType, double dToler)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
@@ -2368,7 +2368,6 @@ MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, in
|
||||
if ( ! pGeomDB->GetGroupGlobFrame( nGroupId, frGrp))
|
||||
return false ;
|
||||
// preparo i dati per il concatenamento
|
||||
double dToler = 10 * EPS_SMALL ;
|
||||
ChainCurves chainC ;
|
||||
chainC.Init( bAllowInvert, dToler, pGeomDB->GetGroupObjs( nGroupId)) ;
|
||||
int nId = pGeomDB->GetFirstInGroup( nGroupId) ;
|
||||
@@ -2412,9 +2411,9 @@ MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, in
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType)
|
||||
ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType, double dToler)
|
||||
{
|
||||
bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, true, nRefType) ;
|
||||
bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, true, nRefType, dToler) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
@@ -2429,9 +2428,9 @@ ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType)
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeReorderCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType)
|
||||
ExeReorderCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType, double dToler)
|
||||
{
|
||||
bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, false, nRefType) ;
|
||||
bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, false, nRefType, dToler) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
|
||||
+5
-5
@@ -3142,12 +3142,12 @@ ExeGetClEntAxesVal( int nEntId, DBLVECTOR& vAxes)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetClEntTDir( int nEntId, Vector3d& vTDir)
|
||||
ExeGetClEntTDir( int nEntId, Vector3d& vtTDir)
|
||||
{
|
||||
IMachMgr* pMachMgr = GetCurrMachMgr() ;
|
||||
VERIFY_MACHMGR( pMachMgr, false) ;
|
||||
// recupero vTDir
|
||||
return pMachMgr->GetClEntTDir( nEntId, vTDir) ;
|
||||
// recupero TDir
|
||||
return pMachMgr->GetClEntTDir( nEntId, vtTDir) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -3162,12 +3162,12 @@ ExeGetClEntCDir( int nEntId, Vector3d& vtCDir)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetClEntADir( int nEntId, Vector3d& vADir)
|
||||
ExeGetClEntADir( int nEntId, Vector3d& vtADir)
|
||||
{
|
||||
IMachMgr* pMachMgr = GetCurrMachMgr() ;
|
||||
VERIFY_MACHMGR( pMachMgr, false) ;
|
||||
// recupero ADir
|
||||
return pMachMgr->GetClEntADir( nEntId, vADir) ;
|
||||
return pMachMgr->GetClEntADir( nEntId, vtADir) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+8
-5
@@ -868,8 +868,8 @@ ExeTrimmingGetSurfBzSyncPoints( int nParentId, int nEdge1Id, int nEdge2Id, doubl
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
bool
|
||||
ExeRegolarizeSurfaceLocally( int nSurfId, int nSyncStartId, int nSyncEndId, double dLinTol)
|
||||
int
|
||||
ExeRegolarizeSurfaceLocally( int nParentId, int nSurfId, int nSyncStartId, int nSyncEndId, double dLinTol, int nType)
|
||||
{
|
||||
bool bOk = true ;
|
||||
// Verifica database geometrico
|
||||
@@ -888,8 +888,11 @@ ExeRegolarizeSurfaceLocally( int nSurfId, int nSyncStartId, int nSyncEndId, doub
|
||||
Point3d ptS2 ; pSyncEnd->GetStartPoint( ptS2) ;
|
||||
Point3d ptE2 ; pSyncEnd->GetEndPoint( ptE2) ;
|
||||
BIPOINT bpIsoEnd( ptS2, ptE2) ;
|
||||
|
||||
PtrOwner<ISurfBezier> pNewSurf( RegolarizeBordersLocally( pSurfBez, bpIsoStart, bpIsoEnd, dLinTol, nType)) ;
|
||||
if ( IsNull( pNewSurf))
|
||||
return GDB_ID_NULL ;
|
||||
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pNewSurf)) ;
|
||||
|
||||
bOk = RegolarizeBordersLocally( pSurfBez, bpIsoStart, bpIsoEnd, 0.2) ;
|
||||
|
||||
return bOk ;
|
||||
return nId ;
|
||||
}
|
||||
Binary file not shown.
+13
-9
@@ -409,7 +409,7 @@ LuaTrimExtendCurveByLen( lua_State* L)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetParam( L, 4, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// taglio o allungo la curva nell'estremo più vicino al punto
|
||||
// taglio o allungo la curva nell'estremo più vicino al punto
|
||||
bool bOk = ExeTrimExtendCurveByLen( nId, dLen, ptNear, nRefType) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
@@ -943,7 +943,7 @@ LuaCurveCompoSetTempProp( lua_State* L)
|
||||
int nPropInd = 0 ;
|
||||
LuaGetParam( L, 4, nPropInd) ;
|
||||
LuaClearStack( L) ;
|
||||
// imposto sulla curva della composita la proprietà temporanea
|
||||
// imposto sulla curva della composita la proprietà temporanea
|
||||
bool bOk = ExeCurveCompoSetTempProp( nId, nCrv, nProp, nPropInd) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
@@ -973,16 +973,18 @@ LuaCurveCompoSetTempParam( lua_State* L)
|
||||
static int
|
||||
LuaChainCurvesInGroup( lua_State* L)
|
||||
{
|
||||
// 2 o 3 parametri : nGroupId, ptNear [, nRefType]
|
||||
// 2, 3 o 4 parametri : nGroupId, ptNear [, nRefType] [, dToler]
|
||||
int nGroupId ;
|
||||
LuaCheckParam( L, 1, nGroupId)
|
||||
Point3d ptNear ;
|
||||
LuaCheckParam( L, 2, ptNear)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetParam( L, 3, nRefType) ;
|
||||
double dToler = 10 * EPS_SMALL ;
|
||||
LuaGetParam( L, 4, dToler) ;
|
||||
LuaClearStack( L) ;
|
||||
// concateno le curve nel gruppo (senza fonderle in una curva composita)
|
||||
bool bOk = ExeChainCurvesInGroup( nGroupId, ptNear, nRefType) ;
|
||||
bool bOk = ExeChainCurvesInGroup( nGroupId, ptNear, nRefType, dToler) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
@@ -991,16 +993,18 @@ LuaChainCurvesInGroup( lua_State* L)
|
||||
static int
|
||||
LuaReorderCurvesInGroup( lua_State* L)
|
||||
{
|
||||
// 2 o 3 parametri : nGroupId, ptNear [, nRefType]
|
||||
// 2, 3 o 4 parametri : nGroupId, ptNear [, nRefType] [, dToler]
|
||||
int nGroupId ;
|
||||
LuaCheckParam( L, 1, nGroupId)
|
||||
Point3d ptNear ;
|
||||
LuaCheckParam( L, 2, ptNear)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetParam( L, 3, nRefType) ;
|
||||
double dToler = 10 * EPS_SMALL ;
|
||||
LuaGetParam( L, 4, dToler) ;
|
||||
LuaClearStack( L) ;
|
||||
// riordino le curve nel gruppo (senza fonderle in una curva composita)
|
||||
bool bOk = ExeReorderCurvesInGroup( nGroupId, ptNear, nRefType) ;
|
||||
bool bOk = ExeReorderCurvesInGroup( nGroupId, ptNear, nRefType, dToler) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
@@ -1021,7 +1025,7 @@ LuaProjectCurveOnSurf( lua_State* L)
|
||||
if ( LuaGetParam( L, 4, dLinTol))
|
||||
LuaGetParam( L, 5, dMaxSegmLen) ;
|
||||
LuaClearStack( L) ;
|
||||
// proietto la curva su una o più superfici a minima distanza
|
||||
// proietto la curva su una o più superfici a minima distanza
|
||||
bool bOk = ExeProjectCurveOnSurf( nCurveId, vSurfId, nDestGrpId, dLinTol, dMaxSegmLen) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
@@ -1051,7 +1055,7 @@ LuaProjectCurveOnSurfDir( lua_State* L)
|
||||
LuaGetParam( L, 8, bFromVsTo))
|
||||
LuaGetParam( L, 9, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// proietto la curva su una o più superfici secondo la direzione data
|
||||
// proietto la curva su una o più superfici secondo la direzione data
|
||||
bool bOk = ExeProjectCurveOnSurfDir( nCurveId, vSurfId, vtDir, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromProj, bFromVsTo, nRefType) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
@@ -1079,7 +1083,7 @@ LuaProjectCurveOnSurfExt( lua_State* L)
|
||||
LuaGetParam( L, 7, bDirFromGuide))
|
||||
LuaGetParam( L, 8, bFromVsTo) ;
|
||||
LuaClearStack( L) ;
|
||||
// proietto la curva su una o più superfici secondo la direzione verso la guida
|
||||
// proietto la curva su una o più superfici secondo la direzione verso la guida
|
||||
bool bOk = ExeProjectCurveOnSurfExt( nCurveId, vSurfId, nGuideId, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromGuide, bFromVsTo) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
|
||||
+12
-12
@@ -3317,11 +3317,11 @@ LuaGetClEntTDir( lua_State* L)
|
||||
int nEntId ;
|
||||
LuaGetParam( L, 1, nEntId) ;
|
||||
LuaClearStack( L) ;
|
||||
// recupero vTDir
|
||||
Vector3d vTDir ;
|
||||
bool bOk = ExeGetClEntTDir( nEntId, vTDir) ;
|
||||
// recupero TDir
|
||||
Vector3d vtTDir ;
|
||||
bool bOk = ExeGetClEntTDir( nEntId, vtTDir) ;
|
||||
if ( bOk)
|
||||
LuaSetParam( L, vTDir) ;
|
||||
LuaSetParam( L, vtTDir) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
@@ -3335,11 +3335,11 @@ LuaGetClEntCDir( lua_State* L)
|
||||
int nEntId ;
|
||||
LuaGetParam( L, 1, nEntId) ;
|
||||
LuaClearStack( L) ;
|
||||
// recupero vCDir
|
||||
Vector3d vCDir ;
|
||||
bool bOk = ExeGetClEntCDir( nEntId, vCDir) ;
|
||||
// recupero CDir
|
||||
Vector3d vtCDir ;
|
||||
bool bOk = ExeGetClEntCDir( nEntId, vtCDir) ;
|
||||
if ( bOk)
|
||||
LuaSetParam( L, vCDir) ;
|
||||
LuaSetParam( L, vtCDir) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
@@ -3353,11 +3353,11 @@ LuaGetClEntADir( lua_State* L)
|
||||
int nEntId ;
|
||||
LuaGetParam( L, 1, nEntId) ;
|
||||
LuaClearStack( L) ;
|
||||
// recupero vADir
|
||||
Vector3d vADir ;
|
||||
bool bOk = ExeGetClEntADir( nEntId, vADir) ;
|
||||
// recupero ADir
|
||||
Vector3d vtADir ;
|
||||
bool bOk = ExeGetClEntADir( nEntId, vtADir) ;
|
||||
if ( bOk)
|
||||
LuaSetParam( L, vADir) ;
|
||||
LuaSetParam( L, vtADir) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
|
||||
+10
-6
@@ -287,17 +287,21 @@ LuaTrimmingGetSurfBzSyncPoints( lua_State* L)
|
||||
static int
|
||||
LuaRegolarizeSurfaceLocally( lua_State* L)
|
||||
{
|
||||
int nParentId = GDB_ID_NULL ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
int nSurfId = GDB_ID_NULL ;
|
||||
LuaCheckParam( L, 1, nSurfId)
|
||||
LuaCheckParam( L, 2, nSurfId)
|
||||
int nSyncStartId ;
|
||||
LuaCheckParam( L, 2, nSyncStartId)
|
||||
LuaCheckParam( L, 3, nSyncStartId)
|
||||
int nSyncEndId ;
|
||||
LuaCheckParam( L, 3, nSyncEndId)
|
||||
LuaCheckParam( L, 4, nSyncEndId)
|
||||
double dLinTol ;
|
||||
LuaCheckParam( L, 4, dLinTol)
|
||||
LuaCheckParam( L, 5, dLinTol)
|
||||
int nType = 0 ;
|
||||
LuaCheckParam( L, 6, nType)
|
||||
|
||||
bool bOk = ExeRegolarizeSurfaceLocally( nSurfId, nSyncStartId, nSyncEndId, dLinTol) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
int nId = ExeRegolarizeSurfaceLocally( nParentId, nSurfId, nSyncStartId, nSyncEndId, dLinTol, nType) ;
|
||||
LuaSetParam( L, nId) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user