From f614420f37a634dc5035d7c56fcd9507b5f1ca3d Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 24 Apr 2023 15:38:36 +0200 Subject: [PATCH 1/6] =?UTF-8?q?Include=20:=20-=20miglioramenti=20interfacc?= =?UTF-8?q?e=20di=20Vector3d,=20Point3d=20e=20Frame3d=20-=20aggiunta=20cos?= =?UTF-8?q?tante=20ICurve::APL=5FSPECIAL=5FINT=20per=20nuovo=20tipo=20di?= =?UTF-8?q?=20approssimazione=20(come=20SP=C3=A9ECIAL=20ma=20con=20almeno?= =?UTF-8?q?=20tre=20punti=20per=20curve=20non=20rettilinee).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EGkCurve.h | 1 + EGkFrame3d.h | 20 ++++++++++---------- EGkPoint3d.h | 36 ++++++++++++++++++------------------ EGkVector3d.h | 36 ++++++++++++++++++------------------ 4 files changed, 47 insertions(+), 46 deletions(-) diff --git a/EGkCurve.h b/EGkCurve.h index 1144609..7d20f16 100644 --- a/EGkCurve.h +++ b/EGkCurve.h @@ -31,6 +31,7 @@ class __declspec( novtable) ICurve : public IGeoObj PP_END = 3} ; // punto coincidente con la fine enum ApprLineType { APL_STD = 0, // approssimazione standard APL_SPECIAL = 10, // come STD, per composite conserva estremi di curve componenti + APL_SPECIAL_INT = 20, // come SPECIAL, per composite anche almeno un interno di componenti non rettilinei APL_LEFT = 1, // linee sempre a sinistra APL_LEFT_CONVEX = 11, // linee sempre a sinistra convesse APL_RIGHT = 2, // linee sempre a destra diff --git a/EGkFrame3d.h b/EGkFrame3d.h index b92aa2d..2502099 100644 --- a/EGkFrame3d.h +++ b/EGkFrame3d.h @@ -56,23 +56,23 @@ class EGK_EXPORT Frame3d bool ToLoc( const Frame3d& frRef) ; bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ; Frame3d& operator*=( const Frame3d& frRef) - { this->ToGlob( frRef) ; return *this ;} + { ToGlob( frRef) ; return *this ; } Frame3d& operator/=( const Frame3d& frRef) - { this->ToLoc( frRef) ; return *this ;} + { ToLoc( frRef) ; return *this ; } bool IsValid( void) const { return ( m_nType != ERR) ; } int GetType( void) const - { return m_nType ;} + { return m_nType ; } int GetZType( void) const - { return m_nZType ;} + { return m_nZType ; } const Point3d& Orig( void) const - { return m_ptOrig ;} + { return m_ptOrig ; } const Vector3d& VersX( void) const - { return m_vtVersX ;} + { return m_vtVersX ; } const Vector3d& VersY( void) const - { return m_vtVersY ;} + { return m_vtVersY ; } const Vector3d& VersZ( void) const - { return m_vtVersZ ;} + { return m_vtVersZ ; } bool GetRotationsCAC1( double& dAngC, double& dAngA, double& dAngC1) const ; bool GetFixedAxesRotationsABC( double& dAngADeg, double& dAngBDeg, double& dAngCDeg) const ; @@ -97,7 +97,7 @@ const Frame3d GLOB_FRM ; //---------------------------------------------------------------------------- // Prodotto di due frame (porta il primo dal secondo nel globale) //---------------------------------------------------------------------------- -inline Frame3d +inline const Frame3d operator*( const Frame3d& frRef1, const Frame3d& frRef2) { Frame3d frRefR = frRef1 ; @@ -108,7 +108,7 @@ operator*( const Frame3d& frRef1, const Frame3d& frRef2) //---------------------------------------------------------------------------- // Divisione di due frame (porta il primo dal globale nel secondo) //---------------------------------------------------------------------------- -inline Frame3d +inline const Frame3d operator/( const Frame3d& frRef1, const Frame3d& frRef2) { Frame3d frRefR = frRef1 ; diff --git a/EGkPoint3d.h b/EGkPoint3d.h index e0c33a0..2e3dcce 100644 --- a/EGkPoint3d.h +++ b/EGkPoint3d.h @@ -50,19 +50,19 @@ class EGK_EXPORT Point3d { return ( ( x * x + y * y + z * z) < SQ_EPS_ZERO) ; } //! Somma sul posto con un vettore Point3d& operator +=( const Vector3d& vtV) - { this->x += vtV.x ; this->y += vtV.y ; this->z += vtV.z ; return *this ; } + { x += vtV.x ; y += vtV.y ; z += vtV.z ; return *this ; } //! Sottrazione sul posto con un vettore Point3d& operator -=( const Vector3d& vtV) - { this->x -= vtV.x ; this->y -= vtV.y ; this->z -= vtV.z ; return *this ; } + { x -= vtV.x ; y -= vtV.y ; z -= vtV.z ; return *this ; } //! Somma sul posto con un altro punto (valida solo se equivalente ad una combinazione baricentrica) Point3d& operator +=( const Point3d& ptP) - { this->x += ptP.x ; this->y += ptP.y ; this->z += ptP.z ; return *this ; } + { x += ptP.x ; y += ptP.y ; z += ptP.z ; return *this ; } //! Moltiplicazione sul posto con un numero Point3d& operator *=( double dMul) - { this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; } + { x *= dMul ; y *= dMul ; z *= dMul ; return *this ; } //! Divisione sul posto con un numero Point3d& operator /=( double dDiv) - { double dMul = 1 / dDiv ; this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; } + { double dMul = 1 / dDiv ; x *= dMul ; y *= dMul ; z *= dMul ; return *this ; } //! Traslazione dato il vettore di movimento void Translate( const Vector3d& vtMove) ; //! Rotazione attorno ad un asse per un punto, dato l'angolo in gradi @@ -102,7 +102,7 @@ const Point3d ORIG( 0, 0, 0) ; //---------------------------------------------------------------------------- //! Somma di due punti (valida solo se equivalente ad una combinazione baricentrica) //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d operator+( const Point3d& ptP1, const Point3d& ptP2) { return Point3d( ptP1.x + ptP2.x, ptP1.y + ptP2.y, ptP1.z + ptP2.z) ; @@ -111,16 +111,16 @@ operator+( const Point3d& ptP1, const Point3d& ptP2) //---------------------------------------------------------------------------- //! Somma di un punto e un vettore //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d operator+( const Point3d& ptP1, const Vector3d& vtV2) { return Point3d( ptP1.x + vtV2.x, ptP1.y + vtV2.y, ptP1.z + vtV2.z) ; } //---------------------------------------------------------------------------- -//! Opposto di un punto +//! Opposto di un punto, genera un vettore //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator-( const Point3d& ptP) { return Vector3d( - ptP.x, - ptP.y, - ptP.z) ; @@ -129,7 +129,7 @@ operator-( const Point3d& ptP) //---------------------------------------------------------------------------- //! Differenza di due punti, genera un vettore //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator-( const Point3d& ptP1, const Point3d& ptP2) { return Vector3d( ptP1.x - ptP2.x, ptP1.y - ptP2.y, ptP1.z - ptP2.z) ; @@ -138,7 +138,7 @@ operator-( const Point3d& ptP1, const Point3d& ptP2) //---------------------------------------------------------------------------- //! Sottrazione di un punto e un vettore //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d operator-( const Point3d& ptP1, const Vector3d& vtV2) { return Point3d( ptP1.x - vtV2.x, ptP1.y - vtV2.y, ptP1.z - vtV2.z) ; @@ -147,7 +147,7 @@ operator-( const Point3d& ptP1, const Vector3d& vtV2) //---------------------------------------------------------------------------- //! Prodotto con uno scalare //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d operator*( const Point3d& ptP, double dMul) { return Point3d( ptP.x * dMul, ptP.y * dMul, ptP.z * dMul) ; @@ -156,7 +156,7 @@ operator*( const Point3d& ptP, double dMul) //---------------------------------------------------------------------------- //! Prodotto di uno scalare con un punto //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d operator*( double dMul, const Point3d& ptP) { return Point3d( ptP.x * dMul, ptP.y * dMul, ptP.z * dMul) ; @@ -165,7 +165,7 @@ operator*( double dMul, const Point3d& ptP) //---------------------------------------------------------------------------- //! Divisione per uno scalare //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d operator/( const Point3d& ptP, double dDiv) { double dMul ; @@ -177,7 +177,7 @@ operator/( const Point3d& ptP, double dDiv) //---------------------------------------------------------------------------- //! Somma mediata di due punti (baricentrica) //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d Media( const Point3d& ptP1, const Point3d& ptP2, double dCoeff = 0.5) { return Point3d( ( 1 - dCoeff) * ptP1.x + dCoeff * ptP2.x, @@ -368,7 +368,7 @@ AreSamePointXYExact( const Point3d& ptP1, const Point3d& ptP2) //---------------------------------------------------------------------------- //! Restituisce una copia in locale del punto passato //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d GetToLoc( const Point3d& ptP, const Frame3d& frRef) { Point3d ptQ = ptP ; @@ -379,7 +379,7 @@ GetToLoc( const Point3d& ptP, const Frame3d& frRef) //---------------------------------------------------------------------------- //! Restituisce una copia in globale del punto passato //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d GetToGlob( const Point3d& ptP, const Frame3d& frRef) { Point3d ptQ = ptP ; @@ -390,7 +390,7 @@ GetToGlob( const Point3d& ptP, const Frame3d& frRef) //---------------------------------------------------------------------------- //! Restituisce una copia dal primo al secondo riferimento del punto passato //---------------------------------------------------------------------------- -inline Point3d +inline const Point3d GetLocToLoc( const Point3d& ptP, const Frame3d& frOri, const Frame3d& frDest) { Point3d ptQ = ptP ; diff --git a/EGkVector3d.h b/EGkVector3d.h index 0c9bf54..dc25701 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -110,21 +110,21 @@ class EGK_EXPORT Vector3d { return ( ! IsX() && ! IsY() && ! IsZ()) ; } //! Somma sul posto con altro vettore Vector3d& operator +=( const Vector3d& vtV) - { this->x += vtV.x ; this->y += vtV.y ; this->z += vtV.z ; return *this ; } + { x += vtV.x ; y += vtV.y ; z += vtV.z ; return *this ; } //! Sottrazione sul posto con altro vettore Vector3d& operator -=( const Vector3d& vtV) - { this->x -= vtV.x ; this->y -= vtV.y ; this->z -= vtV.z ; return *this ; } + { x -= vtV.x ; y -= vtV.y ; z -= vtV.z ; return *this ; } //! Moltiplicazione sul posto con un numero Vector3d& operator *=( double dMul) - { this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; } + { x *= dMul ; y *= dMul ; z *= dMul ; return *this ; } //! Divisione sul posto con un numero Vector3d& operator /=( double dDiv) - { double dMul = 1 / dDiv ; this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; } + { double dMul = 1 / dDiv ; x *= dMul ; y *= dMul ; z *= dMul ; return *this ; } //! Ritorna la rappresentazione in coordinate sferiche void ToSpherical( double* pdLen, double* pdAngVertDeg, double* pdAngOrizzDeg) const ; //! Inversione del vettore void Invert( void) - { x = - x ; y = - y ; z = - z ; } + { x = -x ; y = -y ; z = -z ; } //! Normalizzazione del vettore (trasformazione in versore) bool Normalize( double dEps = EPS_SMALL) ; //! Rotazione attorno ad un asse, dato l'angolo in gradi @@ -199,7 +199,7 @@ EGK_EXPORT Vector3d FromNearestHorizontalOrtho( const Vector3d& vtV, const Vecto //---------------------------------------------------------------------------- //! Opposto di un vettore //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator-( const Vector3d& vtV) { return ( Vector3d( - vtV.x, - vtV.y, - vtV.z)) ; @@ -208,7 +208,7 @@ operator-( const Vector3d& vtV) //---------------------------------------------------------------------------- //! Somma di due vettori //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator+( const Vector3d& vtV1, const Vector3d& vtV2) { return ( Vector3d( vtV1.x + vtV2.x, vtV1.y + vtV2.y, vtV1.z + vtV2.z)) ; @@ -217,7 +217,7 @@ operator+( const Vector3d& vtV1, const Vector3d& vtV2) //---------------------------------------------------------------------------- //! Sottrazione di due vettori //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator-( const Vector3d& vtV1, const Vector3d& vtV2) { return ( Vector3d( vtV1.x - vtV2.x, vtV1.y - vtV2.y, vtV1.z - vtV2.z)) ; @@ -226,7 +226,7 @@ operator-( const Vector3d& vtV1, const Vector3d& vtV2) //---------------------------------------------------------------------------- //! Prodotto con uno scalare //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator*( const Vector3d& vtV, double dMul) { return ( Vector3d( vtV.x * dMul, vtV.y * dMul, vtV.z * dMul)) ; @@ -235,7 +235,7 @@ operator*( const Vector3d& vtV, double dMul) //---------------------------------------------------------------------------- //! Prodotto di uno scalare con un vettore //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator*( double dMul, const Vector3d& vtV) { return ( Vector3d( vtV.x * dMul, vtV.y * dMul, vtV.z * dMul)) ; @@ -244,7 +244,7 @@ operator*( double dMul, const Vector3d& vtV) //---------------------------------------------------------------------------- //! Divisione con uno scalare //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator/( const Vector3d& vtV, double dDiv) { double dMul = 1 / dDiv ; @@ -272,7 +272,7 @@ ScalarXY( const Vector3d& vtV1, const Vector3d& vtV2) //---------------------------------------------------------------------------- //! Prodotto vettoriale //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d operator^( const Vector3d& vtV1, const Vector3d& vtV2) { return ( Vector3d( vtV1.y * vtV2.z - vtV1.z * vtV2.y, @@ -292,7 +292,7 @@ CrossXY( const Vector3d& vtV1, const Vector3d& vtV2) //---------------------------------------------------------------------------- //! Somma mediata di due vettori (baricentrica) //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d Media( const Vector3d& vtV1, const Vector3d& vtV2, double dCoeff = 0.5) { return ( Vector3d( ( 1 - dCoeff) * vtV1.x + dCoeff * vtV2.x, @@ -303,7 +303,7 @@ Media( const Vector3d& vtV1, const Vector3d& vtV2, double dCoeff = 0.5) //---------------------------------------------------------------------------- //! Restituisce il componente del vettore parallelo a quello di riferimento //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d ParallCompo( const Vector3d& vtV, const Vector3d& vtRef) { if ( vtRef.IsNormalized()) @@ -315,7 +315,7 @@ ParallCompo( const Vector3d& vtV, const Vector3d& vtRef) //---------------------------------------------------------------------------- //! Restituisce il componente del vettore ortogonale a quello di riferimento //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d OrthoCompo( const Vector3d& vtV, const Vector3d& vtRef) { if ( vtRef.IsNormalized()) @@ -426,7 +426,7 @@ AreOrthoExact( const Vector3d& vtV1, const Vector3d& vtV2) //---------------------------------------------------------------------------- //! Restituisce una copia in locale del vettore passato //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d GetToLoc( const Vector3d& vtV, const Frame3d& frRef) { Vector3d vtW = vtV ; @@ -437,7 +437,7 @@ GetToLoc( const Vector3d& vtV, const Frame3d& frRef) //---------------------------------------------------------------------------- //! Restituisce una copia in globale del vettore passato //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d GetToGlob( const Vector3d& vtV, const Frame3d& frRef) { Vector3d vtW = vtV ; @@ -448,7 +448,7 @@ GetToGlob( const Vector3d& vtV, const Frame3d& frRef) //---------------------------------------------------------------------------- //! Restituisce una copia dal primo al secondo riferimento del vettore passato //---------------------------------------------------------------------------- -inline Vector3d +inline const Vector3d GetLocToLoc( const Vector3d& vtV, const Frame3d& frOri, const Frame3d& frDest) { Vector3d vtW = vtV ; From 65fee5de7b4e33863df281ffa4c7055e0a7cec17 Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 3 May 2023 09:36:31 +0200 Subject: [PATCH 2/6] Include : - aggiornamento codici protezione librerie per cambio mese. --- EgtKeyCodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EgtKeyCodes.h b/EgtKeyCodes.h index 9b0cadf..924176b 100644 --- a/EgtKeyCodes.h +++ b/EgtKeyCodes.h @@ -24,7 +24,7 @@ //---------------------------------------------------------------------------- const int KEY_BASELIB_PROD = 207 ; -const int KEY_BASELIB_VER = 2504 ; +const int KEY_BASELIB_VER = 2505 ; const int KEY_BASELIB_LEV = 1 ; //---------------------------------------------------------------------------- From bd7ed863695e4186e2ad079f518a356528d0e2eb Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 8 May 2023 08:24:58 +0200 Subject: [PATCH 3/6] Include : - aggiornamento prototipi. --- EGkStmFromTriangleSoup.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/EGkStmFromTriangleSoup.h b/EGkStmFromTriangleSoup.h index 470299c..354e90a 100644 --- a/EGkStmFromTriangleSoup.h +++ b/EGkStmFromTriangleSoup.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2014-2014 +// EgalTech 2014-2023 //---------------------------------------------------------------------------- -// File : EGkStmFromTriangleSoup.h Data : 19.05.14 Versione : 1.5e7 +// File : EGkStmFromTriangleSoup.h Data : 07.05.23 Versione : 2.5e2 // Contenuto : Dichiarazione della classe StmFromTriangleSoup. // // @@ -36,6 +36,7 @@ class StmFromTriangleSoup EGK_EXPORT bool Start( int nBuckets = GRID_STD_BUCKETS) ; EGK_EXPORT bool AddTriangle( const Triangle3d& Tria) ; EGK_EXPORT bool AddTriangle( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2) ; + EGK_EXPORT bool AddSurfTriMesh( const ISurfTriMesh& stmSource) ; EGK_EXPORT bool End( void) ; EGK_EXPORT ISurfTriMesh* GetSurf( void) ; From 0318d44994efa83e47e08bc764b2638f542f6f96 Mon Sep 17 00:00:00 2001 From: DarioS Date: Sun, 14 May 2023 11:54:02 +0200 Subject: [PATCH 4/6] Include : - aggiornamento prototipi - a BBox3d aggiunto metodo Overlaps per box con orientamento diverso. --- EGkBBox3d.h | 48 +++++++++++++++++++++++++++----- EGkCDeConvexTorusClosedSurfTm.h | 2 +- EGkFrame3d.h | 49 +++++++++++++++++++++++++++------ 3 files changed, 83 insertions(+), 16 deletions(-) diff --git a/EGkBBox3d.h b/EGkBBox3d.h index 48ddfaf..00b6630 100644 --- a/EGkBBox3d.h +++ b/EGkBBox3d.h @@ -1,14 +1,14 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2022 +// EgalTech 2013-2023 //---------------------------------------------------------------------------- -// File : EGkBBox3d.h Data : 17.08.22 Versione : 2.4h1 +// File : EGkBBox3d.h Data : 12.05.23 Versione : 2.5e3 // Contenuto : Dichiarazione della classe axis aligned bounding box BBox3d. // // // // Modifiche : 14.01.13 DS Creazione modulo. // 17.08.22 DS Aggiunte GetDimX, GetDimY, GetDimZ. -// +// 12.05.23 DS Aggiunta Overlaps con Box su riferimento. // //---------------------------------------------------------------------------- @@ -90,10 +90,11 @@ class EGK_EXPORT BBox3d bool EnclosesXY( const Point3d& ptP) const ; bool Encloses( const BBox3d& b3Box) const ; bool EnclosesXY( const BBox3d& b3Box) const ; - bool Overlaps( const BBox3d& b3B) const ; - bool OverlapsXY( const BBox3d& b3B) const ; - bool FindIntersection( const BBox3d& b3B, BBox3d& b3Int) const ; - bool FindIntersectionXY( const BBox3d& b3B, BBox3d& b3Int) const ; + bool Overlaps( const BBox3d& b3Box) const ; + bool OverlapsXY( const BBox3d& b3Box) const ; + bool Overlaps( const Frame3d& frBox, const BBox3d& b3Box) const ; + bool FindIntersection( const BBox3d& b3Box, BBox3d& b3Int) const ; + bool FindIntersectionXY( const BBox3d& b3Box, BBox3d& b3Int) const ; double SqDistFromPoint( const Point3d& ptP) const ; double SqDistFromPointXY( const Point3d& ptP) const ; double DistFromPoint( const Point3d& ptP) const @@ -126,3 +127,36 @@ class EGK_EXPORT BBox3d Point3d m_ptMin ; Point3d m_ptMax ; } ; + +//---------------------------------------------------------------------------- +//! Restituisce una copia in locale del box passato +//---------------------------------------------------------------------------- +inline const BBox3d +GetToLoc( const BBox3d& b3Box, const Frame3d& frRef) +{ + BBox3d b3New = b3Box ; + b3New.ToLoc( frRef) ; + return b3New ; +} + +//---------------------------------------------------------------------------- +//! Restituisce una copia in globale del box passato +//---------------------------------------------------------------------------- +inline const BBox3d +GetToGlob( const BBox3d& b3Box, const Frame3d& frRef) +{ + BBox3d b3New = b3Box ; + b3New.ToGlob( frRef) ; + return b3New ; +} + +//---------------------------------------------------------------------------- +//! Restituisce una copia dal primo al secondo riferimento del box passato +//---------------------------------------------------------------------------- +inline const BBox3d +GetLocToLoc( const BBox3d& b3Box, const Frame3d& frOri, const Frame3d& frDest) +{ + BBox3d b3New = b3Box ; + b3New.LocToLoc( frOri, frDest) ; + return b3New ; +} diff --git a/EGkCDeConvexTorusClosedSurfTm.h b/EGkCDeConvexTorusClosedSurfTm.h index f414a50..8d35834 100644 --- a/EGkCDeConvexTorusClosedSurfTm.h +++ b/EGkCDeConvexTorusClosedSurfTm.h @@ -28,5 +28,5 @@ // Raggio principale R1, raggio secondario R2. // Il toro è posto nel piano XY del suo riferimento, centrato sull'origine. // La funzione restituisce true in caso di collisione. -EGK_EXPORT bool CDeConvexTorusClosedSurfTm( const Frame3d& frTorusFrame, double dRad1, double dRad2, +EGK_EXPORT bool CDeConvexTorusClosedSurfTm( const Frame3d& frTorus, double dRad1, double dRad2, double dSafeDist, const ISurfTriMesh& tmSurf) ; diff --git a/EGkFrame3d.h b/EGkFrame3d.h index 2502099..6c35eb0 100644 --- a/EGkFrame3d.h +++ b/EGkFrame3d.h @@ -98,22 +98,55 @@ const Frame3d GLOB_FRM ; // Prodotto di due frame (porta il primo dal secondo nel globale) //---------------------------------------------------------------------------- inline const Frame3d -operator*( const Frame3d& frRef1, const Frame3d& frRef2) +operator*( const Frame3d& frRef, const Frame3d& frOri) { - Frame3d frRefR = frRef1 ; - frRefR.ToGlob( frRef2) ; - return frRefR ; + Frame3d frNew = frRef ; + frNew.ToGlob( frOri) ; + return frNew ; } //---------------------------------------------------------------------------- // Divisione di due frame (porta il primo dal globale nel secondo) //---------------------------------------------------------------------------- inline const Frame3d -operator/( const Frame3d& frRef1, const Frame3d& frRef2) +operator/( const Frame3d& frRef, const Frame3d& frDest) { - Frame3d frRefR = frRef1 ; - frRefR.ToLoc( frRef2) ; - return frRefR ; + Frame3d frNew = frRef ; + frNew.ToLoc( frDest) ; + return frNew ; +} + +//---------------------------------------------------------------------------- +//! Restituisce una copia in locale del frame passato +//---------------------------------------------------------------------------- +inline const Frame3d +GetToLoc ( const Frame3d& frRef, const Frame3d& frDest) +{ + Frame3d frNew = frRef ; + frNew.ToLoc( frDest) ; + return frNew ; +} + +//---------------------------------------------------------------------------- +//! Restituisce una copia in globale del frame passato +//---------------------------------------------------------------------------- +inline const Frame3d +GetToGlob( const Frame3d& frRef, const Frame3d& frOri) +{ + Frame3d frNew = frRef ; + frNew.ToGlob( frOri) ; + return frNew ; +} + +//---------------------------------------------------------------------------- +//! Restituisce una copia dal primo al secondo riferimento del frame passato +//---------------------------------------------------------------------------- +inline const Frame3d +GetLocToLoc( const Frame3d& frRef, const Frame3d& frOri, const Frame3d& frDest) +{ + Frame3d frNew = frRef ; + frNew.LocToLoc( frOri, frDest) ; + return frNew ; } //---------------------------------------------------------------------------- From 80423a1eb68bdc326e8ea078ca758200a6951e55 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 15 May 2023 14:51:16 +0200 Subject: [PATCH 5/6] =?UTF-8?q?Include=20:=20-=20modifiche=20a=20Vector3d?= =?UTF-8?q?=20e=20Point3d=20per=20controllo=20validit=C3=A0=20coordinate?= =?UTF-8?q?=20(isfinite).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EGkPoint3d.h | 3 +++ EGkVector3d.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/EGkPoint3d.h b/EGkPoint3d.h index 2e3dcce..3d23f4c 100644 --- a/EGkPoint3d.h +++ b/EGkPoint3d.h @@ -42,6 +42,9 @@ class EGK_EXPORT Point3d void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ;} public : + //! Verifica la validità delle coordinate del punto + bool IsValid( void) const + { return ( std::isfinite( x) && std::isfinite( y) && std::isfinite( z)) ; } //! Verifica se il punto è quasi l'origine bool IsSmall( void) const { return ( ( x * x + y * y + z * z) < SQ_EPS_SMALL) ; } diff --git a/EGkVector3d.h b/EGkVector3d.h index dc25701..a4f0f69 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -44,6 +44,9 @@ class EGK_EXPORT Vector3d void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ; } public : + //! Verifica la validità delle coordinate del vettore + bool IsValid( void) const + { return ( std::isfinite( x) && std::isfinite( y) && std::isfinite( z)) ; } //! Quadrato della lunghezza del vettore double SqLen( void) const { return ( x * x + y * y + z * z) ; } From 05243da50b7b5499c09125f5217b070a230ac6d8 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 16 May 2023 09:38:26 +0200 Subject: [PATCH 6/6] Include : - a plane3d aggiunto metodo per calcolo piano dati tre punti. --- EGkPlane3d.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/EGkPlane3d.h b/EGkPlane3d.h index 2305dcd..e0868a6 100644 --- a/EGkPlane3d.h +++ b/EGkPlane3d.h @@ -38,6 +38,16 @@ class Plane3d m_dDist = ( ptP - ORIG) * m_vtN ; return true ; } + bool Set( const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3) + { if ( AreSamePointApprox( ptP1, ptP2) || + AreSamePointApprox( ptP2, ptP3) || + AreSamePointApprox( ptP3, ptP1)) { + m_vtN = V_NULL ; + return false ; + } + Vector3d vtN = ( ptP2 - ptP1) ^ ( ptP3 - ptP2) ; + return Set( ptP1, vtN) ; + } void Reset( void) { m_vtN = V_NULL ; m_dDist = 0 ;