EgtExecutor 1.6h3 :
- rettangoli sempre disegnati CCW - aggiunta creazione di Regioni rettangolo, stadium e disco - correzioni a ExeSplitCurveAtSel - aggiunta ExeProjectCurveOnPlane - aggiunte funzioni per normale a regione piana e numero di chunk - sostituzione di Num o Nbr con Count.
This commit is contained in:
+33
-30
@@ -1663,7 +1663,7 @@ MyCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds,
|
||||
return GDB_ID_NULL ;
|
||||
}
|
||||
// se non sono state inserite curve, vado oltre
|
||||
if ( pCrvCompo->GetCurveNumber() == 0)
|
||||
if ( pCrvCompo->GetCurveCount() == 0)
|
||||
continue ;
|
||||
// se curva chiusa entro la tolleranza di concatenamento ma considerata aperta, la chiudo bene
|
||||
Point3d ptStart, ptEnd ;
|
||||
@@ -1949,30 +1949,31 @@ ExeCreateRectangle2P( int nParentId, const Point3d& ptIni,
|
||||
// porto in locale i punti e il versore estrusione
|
||||
Point3d ptIniL = GetPointLocal( pGeomDB, ptIni, nRefType, frLoc) ;
|
||||
Point3d ptCrossL = GetPointLocal( pGeomDB, ptCross, nRefType, frLoc) ;
|
||||
Vector3d vtDirXL = GetVectorLocal( pGeomDB, X_AX, nRefType, frLoc) ;
|
||||
Vector3d vtExtrL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||
// calcolo il lato X
|
||||
Vector3d vtDirX = X_AX ;
|
||||
bOk = bOk && vtDirX.Normalize() ;
|
||||
Vector3d vtLatoX = bOk ? (( ptCrossL - ptIniL) * vtDirX) * vtDirX : V_NULL ;
|
||||
// calcolo il lato ( XL o YL per avere senso CCW)
|
||||
Vector3d vtLatoL = (( ptCrossL - ptIniL) * vtDirXL) * vtDirXL ;
|
||||
if ( ( vtLatoL ^ ( ptCrossL - ptIniL)) * vtExtrL < - EPS_SMALL)
|
||||
vtLatoL = ( ptCrossL - ptIniL) - vtLatoL ;
|
||||
// creo la polilinea con i punti
|
||||
int nId = GDB_ID_NULL ;
|
||||
if ( bOk) {
|
||||
PolyLine PL ;
|
||||
PL.AddUPoint( 0, ptIniL) ;
|
||||
PL.AddUPoint( 1, Point3d( ptIniL) + vtLatoX) ;
|
||||
PL.AddUPoint( 1, Point3d( ptIniL) + vtLatoL) ;
|
||||
PL.AddUPoint( 2, ptCrossL) ;
|
||||
PL.AddUPoint( 3, Point3d( ptCrossL) - vtLatoX) ;
|
||||
PL.AddUPoint( 3, Point3d( ptCrossL) - vtLatoL) ;
|
||||
PL.AddUPoint( 4, ptIniL) ;
|
||||
// disabilito log dei comandi e salvo stato precedente
|
||||
bool bPrevCmdLog = SetCmdLog( false) ;
|
||||
// creo la curva e la inserisco nel GDB
|
||||
nId = ExeCreateCurveCompoFromPoints( nParentId, PL, RTY_LOC) ;
|
||||
// ripristino precedente stato dei comandi
|
||||
SetCmdLog( bPrevCmdLog) ;
|
||||
// ne sistemo il vettore estrusione
|
||||
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pCurve != nullptr)
|
||||
pCurve->SetExtrusion( vtExtrL) ;
|
||||
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
|
||||
bOk = bOk && ! IsNull( pCrvCompo) ;
|
||||
// inserisco i segmenti che uniscono i punti
|
||||
bOk = bOk && pCrvCompo->FromPolyLine( PL) ;
|
||||
// assegno il versore estrusione
|
||||
bOk = bOk && pCrvCompo->SetExtrusion( vtExtrL) ;
|
||||
// inserisco la curva composita nel DB
|
||||
nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvCompo)) : GDB_ID_NULL) ;
|
||||
ExeSetModified() ;
|
||||
}
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
@@ -2006,28 +2007,30 @@ ExeCreateRectangle3P( int nParentId, const Point3d& ptIni,
|
||||
Point3d ptDirL = GetPointLocal( pGeomDB, ptDir, nRefType, frLoc) ;
|
||||
Vector3d vtExtrL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||
// calcolo il lato X
|
||||
Vector3d vtDirX = ptDirL - ptIniL ;
|
||||
bOk = bOk && vtDirX.Normalize() ;
|
||||
Vector3d vtLatoX = bOk ? (( ptCrossL - ptIniL) * vtDirX) * vtDirX : V_NULL ;
|
||||
Vector3d vtDirXL = ptDirL - ptIniL ;
|
||||
bOk = bOk && vtDirXL.Normalize() ;
|
||||
Vector3d vtLatoL = bOk ? (( ptCrossL - ptIniL) * vtDirXL) * vtDirXL : V_NULL ;
|
||||
if ( ( vtLatoL ^ ( ptCrossL - ptIniL)) * vtExtrL < - EPS_SMALL)
|
||||
vtLatoL = ( ptCrossL - ptIniL) - vtLatoL ;
|
||||
// creo la polilinea con i punti
|
||||
int nId = GDB_ID_NULL ;
|
||||
if ( bOk) {
|
||||
PolyLine PL ;
|
||||
PL.AddUPoint( 0, ptIniL) ;
|
||||
PL.AddUPoint( 1, Point3d( ptIniL) + vtLatoX) ;
|
||||
PL.AddUPoint( 1, Point3d( ptIniL) + vtLatoL) ;
|
||||
PL.AddUPoint( 2, ptCrossL) ;
|
||||
PL.AddUPoint( 3, Point3d( ptCrossL) - vtLatoX) ;
|
||||
PL.AddUPoint( 3, Point3d( ptCrossL) - vtLatoL) ;
|
||||
PL.AddUPoint( 4, ptIniL) ;
|
||||
// disabilito log dei comandi e salvo stato precedente
|
||||
bool bPrevCmdLog = SetCmdLog( false) ;
|
||||
// creo la curva e la inserisco nel GDB
|
||||
nId = ExeCreateCurveCompoFromPoints( nParentId, PL, RTY_LOC) ;
|
||||
// ripristino precedente stato dei comandi
|
||||
SetCmdLog( bPrevCmdLog) ;
|
||||
// ne sistemo il vettore estrusione
|
||||
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pCurve != nullptr)
|
||||
pCurve->SetExtrusion( vtExtrL) ;
|
||||
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
|
||||
bOk = bOk && ! IsNull( pCrvCompo) ;
|
||||
// inserisco i segmenti che uniscono i punti
|
||||
bOk = bOk && pCrvCompo->FromPolyLine( PL) ;
|
||||
// assegno il versore estrusione
|
||||
bOk = bOk && pCrvCompo->SetExtrusion( vtExtrL) ;
|
||||
// inserisco la curva composita nel DB
|
||||
nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvCompo)) : GDB_ID_NULL) ;
|
||||
ExeSetModified() ;
|
||||
}
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
|
||||
Reference in New Issue
Block a user