EgtGeomKernel 2.3d2 :
- migliorato riconoscimento tipo intersezioni di curva aperta con chiusa in casi particolari molto vicini ad un vertice.
This commit is contained in:
Binary file not shown.
@@ -15,6 +15,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "IntersCrvCompoCrvCompo.h"
|
||||
#include "CurveAux.h"
|
||||
#include "/EgtDev/Include/EgkDistPointCurve.h"
|
||||
#include "/EgtDev/Include/EGkAngle.h"
|
||||
#include "/EgtDev/Include/EGkHashGrids2d.h"
|
||||
#include <algorithm>
|
||||
@@ -118,6 +119,72 @@ IntersCrvCompoCrvCompo::IntersCrvCompoCrvCompo( const ICurveComposite& CCompoA,
|
||||
}
|
||||
}
|
||||
|
||||
// se non autointersezione e curva B chiusa, verifico per curva A tipo prima della prima intersezione e dopo l'ultima
|
||||
if ( ! bAutoInters && bCrvBClosed && m_nNumInters > 0) {
|
||||
// ordino le intersezioni secondo l'ordine crescente del parametro della prima curva
|
||||
stable_sort( m_Info.begin(), m_Info.end(), SortGreaterA) ;
|
||||
// se punto iniziale della curva A con tipo precedente non definito
|
||||
Point3d ptStart ;
|
||||
if ( m_Info[0].IciA[0].nPrevTy == ICCT_NULL && CCompoA.GetStartPoint( ptStart)) {
|
||||
// posizione del punto iniziale di A rispetto alla curva B
|
||||
DistPointCurve dPCS( ptStart, CCompoB) ;
|
||||
int nSideStart ;
|
||||
if ( dPCS.GetSideAtMinDistPoint( 0, Z_AX, nSideStart)) {
|
||||
if ( nSideStart == MDS_RIGHT)
|
||||
m_Info[0].IciA[0].nPrevTy = ICCT_OUT ;
|
||||
else if ( nSideStart == MDS_LEFT)
|
||||
m_Info[0].IciA[0].nPrevTy = ICCT_IN ;
|
||||
}
|
||||
}
|
||||
// se punto finale della curva A con tipo successivo non definito
|
||||
Point3d ptEnd ;
|
||||
int nI = ( m_Info[m_nNumInters-1].bOverlap ? 1 : 0) ;
|
||||
if ( m_Info[m_nNumInters-1].IciA[nI].nNextTy == ICCT_NULL && CCompoA.GetEndPoint( ptEnd)) {
|
||||
// posizione del punto finale di A rispetto alla curva B
|
||||
DistPointCurve dPCE( ptEnd, CCompoB) ;
|
||||
int nSideEnd ;
|
||||
if ( dPCE.GetSideAtMinDistPoint( 0, Z_AX, nSideEnd)) {
|
||||
if ( nSideEnd == MDS_RIGHT)
|
||||
m_Info[m_nNumInters-1].IciA[nI].nNextTy = ICCT_OUT ;
|
||||
else if ( nSideEnd == MDS_LEFT)
|
||||
m_Info[m_nNumInters-1].IciA[nI].nNextTy = ICCT_IN ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// se non autointersezione e curva A chiusa, verifico per curva B tipo prima della prima intersezione e dopo l'ultima
|
||||
if ( ! bAutoInters && bCrvAClosed && m_nNumInters > 0) {
|
||||
// ordino le intersezioni secondo l'ordine crescente del parametro della seconda curva
|
||||
stable_sort( m_Info.begin(), m_Info.end(), SortGreaterB) ;
|
||||
// se punto iniziale della curva B con tipo precedente non definito
|
||||
Point3d ptStart ;
|
||||
if ( m_Info[0].IciB[0].nPrevTy == ICCT_NULL && CCompoB.GetStartPoint( ptStart)) {
|
||||
// posizione del punto iniziale di B rispetto alla curva A
|
||||
DistPointCurve dPCS( ptStart, CCompoA) ;
|
||||
int nSideStart ;
|
||||
if ( dPCS.GetSideAtMinDistPoint( 0, Z_AX, nSideStart)) {
|
||||
if ( nSideStart == MDS_RIGHT)
|
||||
m_Info[0].IciB[0].nPrevTy = ICCT_OUT ;
|
||||
else if ( nSideStart == MDS_LEFT)
|
||||
m_Info[0].IciB[0].nPrevTy = ICCT_IN ;
|
||||
}
|
||||
}
|
||||
// se punto finale della curva B con tipo successivo non definito
|
||||
Point3d ptEnd ;
|
||||
int nI = ( m_Info[m_nNumInters-1].bOverlap && m_Info[m_nNumInters-1].bCBOverEq ? 1 : 0) ;
|
||||
if ( m_Info[0].IciB[nI].nNextTy == ICCT_NULL && CCompoB.GetEndPoint( ptEnd)) {
|
||||
// posizione del punto finale di B rispetto alla curva A
|
||||
DistPointCurve dPCE( ptEnd, CCompoA) ;
|
||||
int nSideEnd ;
|
||||
if ( dPCE.GetSideAtMinDistPoint( 0, Z_AX, nSideEnd)) {
|
||||
if ( nSideEnd == MDS_RIGHT)
|
||||
m_Info[m_nNumInters-1].IciB[nI].nNextTy = ICCT_OUT ;
|
||||
else if ( nSideEnd == MDS_LEFT)
|
||||
m_Info[m_nNumInters-1].IciB[nI].nNextTy = ICCT_IN ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ordino le intersezioni secondo l'ordine crescente del parametro della prima curva
|
||||
stable_sort( m_Info.begin(), m_Info.end(), SortGreaterA) ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user