EgtExecutor :
- cambio restituzione valori per ExeSurfBezParamsFromPoint.
This commit is contained in:
+7
-7
@@ -1674,7 +1674,7 @@ ExeSurfBezierGetCurveV( int nSurfId, double dU, int nDestGrpId)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSurfBezParamsFromPoint( int nSurfId, const Point3d& ptOnSurf, int nDestGrpId, Point3d& ptParam)
|
||||
ExeSurfBezParamsFromPoint( int nSurfId, const Point3d& ptOnSurf, int nDestGrpId, double& dU, double& dV)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -1682,12 +1682,12 @@ ExeSurfBezParamsFromPoint( int nSurfId, const Point3d& ptOnSurf, int nDestGrpId,
|
||||
const ISurfBezier* pSbz = GetSurfBezier( pGeomDB->GetGeoObj( nSurfId)) ;
|
||||
if ( pSbz == nullptr)
|
||||
return false ;
|
||||
Point3d ptParam ;
|
||||
Point3d ptBez ;
|
||||
bool bOk = pSbz->UnprojectPoint( ptOnSurf, ptParam, P_INVALID) ;
|
||||
if ( ! bOk) {
|
||||
ptParam = P_INVALID ;
|
||||
return bOk ;
|
||||
}
|
||||
if ( ! pSbz->UnprojectPoint( ptOnSurf, ptParam, P_INVALID))
|
||||
return false ;
|
||||
dU = ptParam.x ;
|
||||
dV = ptParam.y ;
|
||||
|
||||
if ( nDestGrpId != GDB_ID_NULL) {
|
||||
Vector3d vtNorm, vtDerU, vtDerV ;
|
||||
@@ -1723,7 +1723,7 @@ ExeSurfBezParamsFromPoint( int nSurfId, const Point3d& ptOnSurf, int nDestGrpId,
|
||||
ExeSetColor( vIds, Color(255,128,0), false) ;
|
||||
}
|
||||
|
||||
return bOk ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+7
-4
@@ -1172,10 +1172,13 @@ LuaSurfBezParamsFromPoint( lua_State* L)
|
||||
LuaCheckParam( L, 3, nDestGrp)
|
||||
LuaClearStack( L) ;
|
||||
// recupero le coordinate parametriche del punto
|
||||
Point3d ptParam = P_INVALID ;
|
||||
bool bOk = ExeSurfBezParamsFromPoint( nSurfId, ptOnSurf, nDestGrp, ptParam) ;
|
||||
if ( bOk)
|
||||
LuaSetParam( L, ptParam) ;
|
||||
double dU = - 1 ;
|
||||
double dV = - 1 ;
|
||||
bool bOk = ExeSurfBezParamsFromPoint( nSurfId, ptOnSurf, nDestGrp, dU, dV) ;
|
||||
if ( bOk) {
|
||||
LuaSetParam( L, dU) ;
|
||||
LuaSetParam( L, dV) ;
|
||||
}
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user