cee2ae0c77
- in CAvToolTriangle aggiunta gestione movimenti generici.
161 lines
13 KiB
C
161 lines
13 KiB
C
//----------------------------------------------------------------------------
|
|
// EgalTech 2018-2018
|
|
//----------------------------------------------------------------------------
|
|
// File : CAvToolTriangle.h Data : 27.04.18 Versione : 1.9e1
|
|
// Contenuto : Dichiarazione delle funzioni del modulo CAvToolTriangle.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 10.03.18 LM Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "Tool.h"
|
|
#include "/EgtDev/Include/EGkTriangle3d.h"
|
|
|
|
//-----------------------------------------------------------------------------
|
|
double CAvToolTriangle( const Tool& tlTool, const Point3d& ptToolOrig, const Vector3d& vtToolAx,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
|
|
// Componenti:
|
|
|
|
// Sfera
|
|
double CAvSphereTriangle( const Point3d& ptSpheCen, double dSpheRad, const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double SpherePlaneLeakDist( const Point3d& ptSpheCen, double dSpheRad,
|
|
const Point3d& ptPlane, const Vector3d& vtPlaneN, const Vector3d& vtMove) ;
|
|
double SphereSegmentLeakDist( const Point3d& ptSpheCen, double dSpheRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSegDir, double dSegLen,
|
|
const Vector3d& vtMove) ;
|
|
double SpherePointLeakDist( const Point3d& ptSpheCen, double dSpheRad, const Point3d ptP, const Vector3d& vtMove) ;
|
|
|
|
// Cilindro
|
|
double CAvCylinderTriangle( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dHeigth, double dRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double CylPointLeakDistOrtMotion( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dCylHei, double dCylRad,
|
|
const Point3d& ptP, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double CylSegmentLeakDistOrtMotion( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dCylHei, double dCylRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove,
|
|
bool bTop, bool bBot) ;
|
|
double CylPointLeakDistGenMot( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dHeigth, double dRad,
|
|
const Point3d& ptP, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double CylSegmentLeakDistGenMot( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dHeigth, double dRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen,
|
|
const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double CylTriaInteriorLeakDistGenMot( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dHeigth, double dRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
|
|
// Cono
|
|
double CAvTrConeTriangle( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Triangle3d& trTria, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double TrConePointLeakDistLongMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Point3d& ptP, const Vector3d& vtMove) ;
|
|
double TrConeSegmentLeakDistLongMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen,
|
|
const Vector3d& vtMove) ;
|
|
double TrConeTriangleInteriorLeakDistLongMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double TrConePointLeakDistOrtMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Point3d& ptP, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double TrConeSegmentLeakDistOrtMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen,
|
|
const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double TrConeTriangleInteriorLeakDistOrtMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double TrConePointLeakDistGenMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Point3d& ptP, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double TrConeSegmentLeakDistGenMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen,
|
|
const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double TrConeTriaInteriorLeakDistGenMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
|
|
double dTrConeH, const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
|
|
// Toro
|
|
double CAvTorusTriangle( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double TorusSegmentLeakDistLongMot( const Point3d& ptTorusCen, double dMaxRad, double dMinRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove) ;
|
|
double TorusTriangleInteriorLeakDistLongMot( const Point3d& ptTorusCen, double dMaxRad, double dMinRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double TorusSegmentLeakDistOrtMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove,
|
|
bool bTop, bool bBot) ;
|
|
double TorusTriangleInteriorLeakDistOrtMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double TorusSegmentLeakDistOrtMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove,
|
|
bool bTop, bool bBot) ;
|
|
double TorusPointLeakDistGenMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Point3d& ptP, const Vector3d& vtMove) ;
|
|
double TorusSegmentLeakDistGenMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove) ;
|
|
double TorusTriangleInteriorLeakDistGenMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
|
|
double CAvConcaveTorusTriangle( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove, bool bTop, bool bBot) ;
|
|
double ConcaveTorusSegmentLeakDistLongMot( const Point3d& ptTorusCen, double dMaxRad, double dMinRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove) ;
|
|
double ConcaveTorusTriangleInteriorLeakDistLongMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double ConcaveTorusSegmentLeakDistOrtMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove,
|
|
bool bTop, bool bBot) ;
|
|
double ConcaveTorusTriangleInteriorLeakDistOrtMot( const Point3d& ptTorusCen, const Vector3d& vtTorusAx, double dMaxRad, double dMinRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
|
|
// Dischi
|
|
double CAvDiskTriangle( const Point3d& ptDiskCen, const Vector3d& vtDiskAx, double dDiskRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double DiskPointLeakDistLongMot( const Point3d& ptDiskCen, double dDiskRad,
|
|
const Point3d& ptP, const Vector3d& vtMove) ;
|
|
double DiskSegmentLeakDistLongMot( const Point3d& ptDiskCen, double dDiskRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen,
|
|
const Vector3d& vtMove) ;
|
|
double DiskTriaInteriorLeakDistLongMot( const Point3d& ptDiskCen, double dDiskRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
double DiskPlaneLeakDistLongMot( const Point3d& ptDiskCen, double dDiskRad,
|
|
const Point3d& ptPlane, const Vector3d& vtPlane,
|
|
const Vector3d& vtMove, Point3d& ptTouch) ;
|
|
double DiskPointLeakDistOrtMot( const Point3d& ptDisc, const Vector3d& vtDiskAx, double dDiscRad,
|
|
const Point3d& ptP, const Vector3d& vtMove) ;
|
|
double DiskSegmentLeakDistOrtMot( const Point3d& ptDiskCen, const Vector3d& vtDiskAx, double dDiskRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove) ;
|
|
double DiskPlaneLeakDistOrtMot( const Point3d& ptDiskCen, const Vector3d& vtDiskAx, double dDiskRad,
|
|
const Point3d& ptPlane, const Vector3d& vtPlane,
|
|
const Vector3d& vtMove, Point3d& ptContact) ;
|
|
double DiskSegmentLeakDistGenMot( double dDiskRad, const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen,
|
|
const Vector3d& vtMove) ;
|
|
double DiskTriaInteriorLeakDistGenMot( const Point3d& ptDiskCen, const Vector3d& vtDiskAx, double dDiskRad,
|
|
const Triangle3d& trTria, const Vector3d& vtMove) ;
|
|
|
|
|
|
// Funzioni geometriche di base
|
|
double GetPointLineSqDist( const Point3d& ptP, const Point3d& ptLine, const Vector3d& vtLine) ;
|
|
double PointPlaneSignedDist( const Point3d& ptP, const Point3d& ptPlane, const Vector3d& vtNorm) ;
|
|
double ThreePointPlaneSignedDist( const Triangle3d& trTria, const Point3d& ptPlane, const Vector3d& vtNorm) ;
|
|
int LinePlaneDDistPar( const Point3d& ptPlane, const Vector3d& vtPlane, const Point3d& ptLine, const Vector3d& vtLine,
|
|
double dDist, double& dPar) ;
|
|
double LineLineSqDist( const Point3d& ptP1, const Vector3d& vtD1, const Point3d& ptP2, const Vector3d& vtD2) ;
|
|
double LineSegmentSqDist( const Point3d& ptPLn, const Vector3d& vtDLn,
|
|
const Point3d& ptPSg, const Vector3d& vtDSg, double dSgLen) ;
|
|
bool IsPointInsideTriangle( const Point3d& ptP, const Triangle3d& trTria) ;
|
|
bool IsPointInsideOpenTriangle( const Point3d& ptP, const Triangle3d& trTria) ;
|
|
bool CoplanarDiscTriangleInterferance( const Point3d& ptCen, double dRad, const Triangle3d& trTria) ;
|
|
bool FindLineLineMinDistPar( const Point3d& ptL1, const Vector3d& vtV1,
|
|
const Point3d& ptL2, const Vector3d& vtV2,
|
|
double& dU1, double& dU2) ;
|
|
int SphereLineTangentPoints( const Point3d& ptSpheCen, double dSpheRad,
|
|
const Point3d& ptSeg, const Vector3d& vtSegDir, double dSegLen,
|
|
const Vector3d& vtMove, double& dU1, double& dU2) ;
|
|
int DiskPlaneLastContactLongMot( const Point3d& ptDiskCen, double dDiskRad,
|
|
const Point3d& ptPlane, const Vector3d& vtPlane,
|
|
const Vector3d& vtMove, Point3d& ptTouch) ;
|
|
bool ClampSegmentOutPlane( const Plane3d& plPlane, Point3d& ptSegP, const Vector3d& vtSegV, double& dSegLen) ;
|
|
|
|
// Altre funzioni
|
|
inline double EvalSecondDegreePolynomial( double dCoeff0, double dCoeff1, double dCoeff2, double dVariable)
|
|
{ return (( dCoeff2 * dVariable + dCoeff1) * dVariable + dCoeff0) ; }
|