diff --git a/EGkCircle2P.h b/EGkCircle2P.h new file mode 100644 index 0000000..2aa1a85 --- /dev/null +++ b/EGkCircle2P.h @@ -0,0 +1,28 @@ +//---------------------------------------------------------------------------- +// EgalTech 2022-202 +//---------------------------------------------------------------------------- +// File : EGkCircle2Pe.h Data : 18.08.22 Versione : 2.4h2 +// Contenuto : Dichiarazione funzioni per calcolo circonferenze per 2 punti +// diametrali. +// +// +// Modifiche : 18.08.22 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurveArc.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 + +//---------------------------------------------------------------------------- +EGK_EXPORT ICurveArc* GetCircle2P( const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtN) ; diff --git a/EGkVector3d.h b/EGkVector3d.h index 2d04dba..1c32a40 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2019 +// EgalTech 2013-2022 //---------------------------------------------------------------------------- -// File : EGkVector3d.h Data : 14.12.19 Versione : 2.1l4 +// File : EGkVector3d.h Data : 18.082.22 Versione : 2.4h2 // Contenuto : Dichiarazione della classe Vettore 3d. // // @@ -287,7 +287,10 @@ Media( const Vector3d& vtV1, const Vector3d& vtV2, double dCoeff) inline Vector3d ParallCompo( const Vector3d& vtV, const Vector3d& vtRef) { - return ( ( vtV * vtRef) * vtRef) ; + if ( vtRef.IsNormalized()) + return ( ( vtV * vtRef) * vtRef) ; + else + return ( ( vtV * vtRef) * vtRef / vtRef.SqLen()) ; } //---------------------------------------------------------------------------- @@ -296,7 +299,10 @@ ParallCompo( const Vector3d& vtV, const Vector3d& vtRef) inline Vector3d OrthoCompo( const Vector3d& vtV, const Vector3d& vtRef) { - return ( vtV - ( vtV * vtRef) * vtRef) ; + if ( vtRef.IsNormalized()) + return ( vtV - ( vtV * vtRef) * vtRef) ; + else + return ( vtV - ( vtV * vtRef) * vtRef / vtRef.SqLen()) ; } //---------------------------------------------------------------------------- diff --git a/EInAPI.h b/EInAPI.h index c95d74d..5c7bc7b 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -218,6 +218,8 @@ EIN_EXPORT int __stdcall EgtCreateCircleCP( int nParentId, const double ptCen[3 const double ptOn[3], int nRefType) ; EIN_EXPORT int __stdcall EgtCreateCircleCPEx( int nParentId, const double ptCen[3], const double ptOn[3], int nSepO, int nIdO, int nRefType) ; +EIN_EXPORT int __stdcall EgtCreateCircle2P( int nParentId, const double ptP1[3], + const double ptP2[3], int nRefType) ; EIN_EXPORT int __stdcall EgtCreateCircle3P( int nParentId, const double ptP1[3], const double ptP2[3], const double ptP3[3], int nRefType) ; EIN_EXPORT int __stdcall EgtCreateArc( int nParentId, const double ptCen[3], double dRad, @@ -485,7 +487,7 @@ EIN_EXPORT int __stdcall EgtSplitCurve( int nId, int nParts) ; EIN_EXPORT int __stdcall EgtSplitCurveAtPoint( int nId, const double ptOn[3], int nRefType) ; EIN_EXPORT BOOL __stdcall EgtModifyCircleCP( int nId, const double ptOn[3], int nRefType) ; EIN_EXPORT BOOL __stdcall EgtModifyCircle3P( int nId, const double ptP1[3], const double ptP2[3], const double ptP3[3], int nRefType) ; -EIN_EXPORT BOOL __stdcall EgtModifyArcRadius( int nId, double dRad) ; +EIN_EXPORT BOOL __stdcall EgtModifyArcRadius( int nId, double dRad, BOOL bKeepCenter) ; EIN_EXPORT BOOL __stdcall EgtModifyArcC2P( int nId, const double ptEnd[3], int nRefType) ; EIN_EXPORT BOOL __stdcall EgtModifyArc3P( int nId, const double ptMid[3], int nRefType) ; EIN_EXPORT BOOL __stdcall EgtModifyArcByFlip( int nId) ; diff --git a/EXeExecutor.h b/EXeExecutor.h index a0542dd..1ea3964 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -235,6 +235,7 @@ EXE_EXPORT int ExeCreateCircleCP( int nParentId, const Point3d& ptCen, const Point3d& ptOn, int nRefType) ; EXE_EXPORT int ExeCreateCircleCPEx( int nParentId, const Point3d& ptCen, const Point3d& ptOn, int nSepO, int nIdO, int nRefType) ; +EXE_EXPORT int ExeCreateCircle2P( int nParentId, const Point3d& ptP1, const Point3d& ptP2, int nRefType) ; EXE_EXPORT int ExeCreateCircle3P( int nParentId, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3, int nRefType) ; EXE_EXPORT int ExeCreateArc( int nParentId, const Point3d& ptCen, double dRad, @@ -531,7 +532,7 @@ EXE_EXPORT int ExeSplitCurveAtSelfInters( int nId, int* pnCount) ; EXE_EXPORT int ExeGetCurveLinearConvexHullXY( int nId, double dLinTol, int nRefType) ; EXE_EXPORT bool ExeModifyCircleCP( int nId, const Point3d& ptOn, int nRefType) ; EXE_EXPORT bool ExeModifyCircle3P( int nId, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3, int nRefType) ; -EXE_EXPORT bool ExeModifyArcRadius( int nId, double dRad) ; +EXE_EXPORT bool ExeModifyArcRadius( int nId, double dRad, bool bKeepCenter = true) ; EXE_EXPORT bool ExeModifyArcC2P( int nId, const Point3d& ptEnd, int nRefType) ; EXE_EXPORT bool ExeModifyArc3P( int nId, const Point3d& ptMid, int nRefType) ; EXE_EXPORT bool ExeModifyArcToExplementary( int nId) ;