From 4a81b0fc94a9ac8251bdccd590c4f98c1ec7e8a2 Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Mon, 18 Sep 2023 10:43:11 +0200 Subject: [PATCH 1/3] Include : - aggiunte coordinate U e V ai vertici delle TriMesh. --- EGkStmFromTriangleSoup.h | 6 ++++-- EGkSurfTriMesh.h | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/EGkStmFromTriangleSoup.h b/EGkStmFromTriangleSoup.h index 354e90a..f417910 100644 --- a/EGkStmFromTriangleSoup.h +++ b/EGkStmFromTriangleSoup.h @@ -35,13 +35,15 @@ class StmFromTriangleSoup EGK_EXPORT ~StmFromTriangleSoup( void) ; 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 AddTriangle( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2, + const double dU0 = -1, const double dV0 = -1, const double dU1 = -1, const double dV1 = -1, + const double dU2 = -1, const double dV2 = -1) ; EGK_EXPORT bool AddSurfTriMesh( const ISurfTriMesh& stmSource) ; EGK_EXPORT bool End( void) ; EGK_EXPORT ISurfTriMesh* GetSurf( void) ; private : - inline int AddVertex( const Point3d& ptP) ; + inline int AddVertex( const Point3d& ptP, const double dU = -1, const double dV = -1) ; private : ISurfTriMesh* m_pSTM ; diff --git a/EGkSurfTriMesh.h b/EGkSurfTriMesh.h index e37521a..94c1f9f 100644 --- a/EGkSurfTriMesh.h +++ b/EGkSurfTriMesh.h @@ -43,7 +43,7 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual void SetLinearTolerance( double dLinTol) = 0 ; virtual void SetBoundaryAngle( double dBoundaryAngDeg) = 0 ; virtual void SetSmoothAngle( double dSmoothAngDeg) = 0 ; - virtual int AddVertex( const Point3d& ptVert) = 0 ; + virtual int AddVertex( const Point3d& ptVert, const double dU = -1, const double dV = -1) = 0 ; virtual bool MoveVertex( int nInd, const Point3d& ptNewVert) = 0 ; virtual int AddTriangle( const int nIdVert[3], int nTFlag = 0) = 0 ; virtual bool RemoveTriangle( int nId) = 0 ; @@ -68,8 +68,11 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual double GetLinearTolerance( void) const = 0 ; virtual double GetSmoothAngle( void) const = 0 ; virtual bool GetVertex( int nId, Point3d& ptP) const = 0 ; + virtual bool GetVertexParam( int nId, double& dU, double& dV) const = 0 ; virtual int GetFirstVertex( Point3d& ptP) const = 0 ; + virtual int GetFirstVertexParam( int nId, double& dU, double& dV) const = 0 ; virtual int GetNextVertex( int nId, Point3d& ptP) const = 0 ; + virtual int GetNextVertexParam( int nId, double& dU, double& dV) const = 0 ; virtual bool GetTriangle( int nId, int nIdVert[3]) const = 0 ; virtual int GetFirstTriangle( int nIdVert[3]) const = 0 ; virtual int GetNextTriangle( int nId, int nIdVert[3]) const = 0 ; From 29c292b075745dd143bf62795d1fe9e3f8a3cce0 Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Thu, 8 Feb 2024 12:05:33 +0100 Subject: [PATCH 2/3] Include : - aggiunta intersezione tra linea e superficie di Bezier. --- EgkIntersLineSurfBez.h | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 EgkIntersLineSurfBez.h diff --git a/EgkIntersLineSurfBez.h b/EgkIntersLineSurfBez.h new file mode 100644 index 0000000..168ac9c --- /dev/null +++ b/EgkIntersLineSurfBez.h @@ -0,0 +1,66 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024 +//---------------------------------------------------------------------------- +// File : EGkIntersLineSurfBez.h Data : 06.02.24 Versione : 2.6b1 +// Contenuto : Dichiarazione della classe intersezione Linea/SurfTriMesh. +// +// +// +// Modifiche : 06.02.24 DB Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkSurfTriMesh.h" +#include "/EgtDev/Include/EGkIntersLineTria.h" +#include "/EgtDev/Include/EGkHashGrids2d.h" + +//----------------------- Macro per import/export ---------------------------- +#undef EGK_EXPORT +#if defined( I_AM_EGK) // da definirsi solo nella DLL +#define EGK_EXPORT __declspec( dllexport) +#else +#define EGK_EXPORT __declspec( dllimport) +#endif + +//----------------------------------------------------------------------------- +//! dati di intersezione linea - superficie trimesh +struct IntLinSbzInfo { + int nILTT ; //!< tipo di intersezione linea-triangolo + double dU ; //!< parametro sulla linea + double dU2 ; //!< secondo parametro sulla linea + int nT ; //!< indice del triangolo della superficie trimesh + double dCosDN ; //!< coseno dell'angolo tra la direzione della linea e la normale del triangolo + Point3d ptI ; //!< punto di intersezione + Point3d ptI2 ; //!< secondo punto di intersezione (termine di tratto sovrapposto) + Point3d ptUV ; //!< coordinate del punto nello spazio parametrico + Point3d ptUV2 ; //!< coordinate del secondo punto nello spazio parametrico + // costruttori + IntLinSbzInfo( void) : nILTT( ILTT_NO), dU( 0), dU2( 0), nT(0), dCosDN(0), ptI(), ptI2(), ptUV(), ptUV2(){} + IntLinSbzInfo( int nIL, double dUU, int nTT, double dCos, const Point3d& ptP, const Point3d ptSP) + : nILTT( nIL), dU( dUU), dU2( 0), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2(), ptUV( ptSP), ptUV2() {} + IntLinSbzInfo( int nIL, double dUU, double dUU2, int nTT, double dCos, const Point3d& ptP, const Point3d& ptP2, const Point3d& ptSP, const Point3d& ptSP2) + : nILTT( nIL), dU( dUU), dU2( dUU2), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2( ptP2), ptUV( ptSP), ptUV2( ptSP2) {} +} ; +//! vettore di IntLinSbzInfo +typedef std::vector ILSBIVECTOR ; + +//----------------------------------------------------------------------------- +EGK_EXPORT bool IntersLineSurfBz( const Point3d& ptL, const Vector3d& vtL, double dLen, const ISurfBezier& SBz, + ILSBIVECTOR& vInfo, bool bFinite = true) ; + +//----------------------------------------------------------------------------- +class IntersParLinesSurfBz +{ +public : + EGK_EXPORT IntersParLinesSurfBz( const Frame3d& frLines, const ISurfBezier& SBz) ; + EGK_EXPORT bool GetInters( const Point3d& ptL, double dLen, ILSBIVECTOR& vInfo, bool bFinite = true) const ; + +private : + bool m_bOk ; + const Frame3d m_frLines ; + const ISurfBezier* m_pSBz ; + HashGrids2d m_HGrids ; +} ; From 93b180b1293c0d641b0648f2f8a6e1ab6c23c11e Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Mon, 12 Feb 2024 12:55:59 +0100 Subject: [PATCH 3/3] Include : - aggiunti i comandi per la chiamata da CAM dell'intersezione linea sup. Bezier. --- EGkSurfTriMesh.h | 2 -- EXeExecutor.h | 2 ++ EgkIntersLineSurfBez.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/EGkSurfTriMesh.h b/EGkSurfTriMesh.h index 11744ea..3510e12 100644 --- a/EGkSurfTriMesh.h +++ b/EGkSurfTriMesh.h @@ -70,9 +70,7 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual bool GetVertex( int nId, Point3d& ptP) const = 0 ; virtual bool GetVertexParam( int nId, double& dU, double& dV) const = 0 ; virtual int GetFirstVertex( Point3d& ptP) const = 0 ; - virtual int GetFirstVertexParam( int nId, double& dU, double& dV) const = 0 ; virtual int GetNextVertex( int nId, Point3d& ptP) const = 0 ; - virtual int GetNextVertexParam( int nId, double& dU, double& dV) const = 0 ; virtual bool GetTriangle( int nId, int nIdVert[3]) const = 0 ; virtual int GetFirstTriangle( int nIdVert[3]) const = 0 ; virtual int GetNextTriangle( int nId, int nIdVert[3]) const = 0 ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 633161d..3338e72 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -807,6 +807,8 @@ EXE_EXPORT bool ExeLineBoxInters( const Point3d& ptP, const Vector3d& vtDir, con INTDBLVECTOR& vInters) ; EXE_EXPORT bool ExeLineSurfTmInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, INTDBLVECTOR& vInters) ; +EXE_EXPORT bool ExeLineSurfBzInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, + INTDBLVECTOR& vInters) ; EXE_EXPORT bool ExeLineVolZmapInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, INTDBLVECTOR& vInters) ; EXE_EXPORT int ExePlaneCurveInters( const Point3d& ptOn, const Vector3d& vtN, const int nId, const int nDestGrpId, const int nRefType, diff --git a/EgkIntersLineSurfBez.h b/EgkIntersLineSurfBez.h index 168ac9c..69ef158 100644 --- a/EgkIntersLineSurfBez.h +++ b/EgkIntersLineSurfBez.h @@ -16,6 +16,7 @@ #include "/EgtDev/Include/EGkSurfTriMesh.h" #include "/EgtDev/Include/EGkIntersLineTria.h" #include "/EgtDev/Include/EGkHashGrids2d.h" +#include "/EgtDev/Include/EGkSurfBezier.h" //----------------------- Macro per import/export ---------------------------- #undef EGK_EXPORT @@ -48,7 +49,7 @@ struct IntLinSbzInfo { typedef std::vector ILSBIVECTOR ; //----------------------------------------------------------------------------- -EGK_EXPORT bool IntersLineSurfBz( const Point3d& ptL, const Vector3d& vtL, double dLen, const ISurfBezier& SBz, +EGK_EXPORT bool IntersLineSurfBz( const Point3d& ptL, const Vector3d& vtL, double dLen, const ISurfBezier* pSBz, ILSBIVECTOR& vInfo, bool bFinite = true) ; //-----------------------------------------------------------------------------