diff --git a/CurveComposite.h b/CurveComposite.h index 3966b84..a9a27b8 100644 --- a/CurveComposite.h +++ b/CurveComposite.h @@ -132,7 +132,7 @@ class CurveComposite : public ICurveComposite, public IGeoObjRW bool PolygonCenterMidSide( int nSides, const Point3d& ptCen, const Point3d& ptMidSide, const Vector3d& vtN) override ; bool PolygonSide( int nSides, const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtN) override ; int GetCurveCount( void) const override - { return int( m_CrvSmplS.size()) ; } + { return ( ( m_nStatus != OK) ? 0 : int( m_CrvSmplS.size())) ; } const ICurve* GetCurve( int nCrv) const override ; const ICurve* GetFirstCurve( void) const override ; const ICurve* GetNextCurve( void) const override ; diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index a9ca0ce..f55c585 100644 Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ diff --git a/ExtText.cpp b/ExtText.cpp index fe4060e..9d2be8a 100644 --- a/ExtText.cpp +++ b/ExtText.cpp @@ -18,6 +18,7 @@ #include "NgeWriter.h" #include "NgeReader.h" #include "FontManager.h" +#include "FontAux.h" #include "/EgtDev/Include/EGkStringUtils3d.h" #include "/EgtDev/Include/EGkUiUnits.h" #include @@ -120,7 +121,7 @@ ExtText::Set( const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD, m_nWeight = nW ; m_bItalic = bItl ; m_dHeight = dH ; - m_dRatio = dRat ; + m_dRatio = AdjustFontRatio( dRat) ; m_dAddAdvance = dAddAdv ; m_nInsPos = (( nInsPos >= ETXT_IPTL && nInsPos <= ETXT_IPBR) ? nInsPos : ETXT_IPBL) ; diff --git a/FontAux.cpp b/FontAux.cpp index 906e1f8..46b059a 100644 --- a/FontAux.cpp +++ b/FontAux.cpp @@ -15,6 +15,20 @@ #include "stdafx.h" #include "FontAux.h" #include "/EgtDev/Include/EGkExtText.h" +#include "/EgtDev/Include/EgtNumUtils.h" + +//---------------------------------------------------------------------------- +double +AdjustFontRatio( double dRatio) +{ + // se nullo viene posto a 1 + if ( abs( dRatio) < EPS_SMALL) + return 1.0 ; + // altrimenti deve stare nei limiti + const double MIN_FONT_RATIO = 0.1 ; + const double MAX_FONT_RATIO = 10.0 ; + return Clamp( dRatio, MIN_FONT_RATIO, MAX_FONT_RATIO) ; +} //---------------------------------------------------------------------------- bool diff --git a/FontAux.h b/FontAux.h index 2b926d0..90cf5cd 100644 --- a/FontAux.h +++ b/FontAux.h @@ -17,5 +17,6 @@ #include "/EgtDev/Include/EGtNumCollection.h" //---------------------------------------------------------------------------- +double AdjustFontRatio( double dRatio) ; bool IsLineBreak( const UINTVECTOR& vCode, int nInd, int& nLen) ; Vector3d GetTextInsertPointMove( double dMaxW, double dAscent, double dMinH, int nInsPos) ; diff --git a/GeomDB.cpp b/GeomDB.cpp index fbf4e3d..3a6bd40 100644 --- a/GeomDB.cpp +++ b/GeomDB.cpp @@ -659,6 +659,19 @@ GeomDB::GetPrev( int nId) const return ( pGdbPrev->m_nId) ; } +//---------------------------------------------------------------------------- +static bool +AnalyzeName( string& sToFind) +{ + bool bRepl = ( ReplaceString( sToFind, "**", "\n") != 0) ; + bool bWild = ( sToFind.back() == '*') ; + if ( bWild) + sToFind.pop_back() ; + if ( bRepl) + ReplaceString( sToFind, "\n", "*") ; + return bWild ; +} + //---------------------------------------------------------------------------- int GeomDB::GetFirstNameInGroup( int nGroupId, const string& sName) const @@ -668,9 +681,7 @@ GeomDB::GetFirstNameInGroup( int nGroupId, const string& sName) const return GDB_ID_NULL ; // determinazione tipo di ricerca string sToFind = sName ; - bool bWild = ( sToFind.back() == '*') ; - if ( bWild) - sToFind.pop_back() ; + bool bWild = AnalyzeName( sToFind) ; // recupero il gruppo const GdbGroup* pGdbGroup = GetGdbGroup( nGroupId) ; if ( pGdbGroup == nullptr) @@ -698,9 +709,7 @@ GeomDB::GetNextName( int nId, const string& sName) const return GDB_ID_NULL ; // determinazione tipo di ricerca string sToFind = sName ; - bool bWild = ( sToFind.back() == '*') ; - if ( bWild) - sToFind.pop_back() ; + bool bWild = AnalyzeName( sToFind) ; // recupero l'oggetto const GdbObj* pGdbObj = GetGdbObj( nId) ; if ( pGdbObj == nullptr) @@ -728,9 +737,7 @@ GeomDB::GetLastNameInGroup( int nGroupId, const string& sName) const return GDB_ID_NULL ; // determinazione tipo di ricerca string sToFind = sName ; - bool bWild = ( sToFind.back() == '*') ; - if ( bWild) - sToFind.pop_back() ; + bool bWild = AnalyzeName( sToFind) ; // recupero il gruppo const GdbGroup* pGdbGroup = GetGdbGroup( nGroupId) ; if ( pGdbGroup == nullptr) @@ -758,9 +765,7 @@ GeomDB::GetPrevName( int nId, const string& sName) const return GDB_ID_NULL ; // determinazione tipo di ricerca string sToFind = sName ; - bool bWild = ( sToFind.back() == '*') ; - if ( bWild) - sToFind.pop_back() ; + bool bWild = AnalyzeName( sToFind) ; // recupero l'oggetto const GdbObj* pGdbObj = GetGdbObj( nId) ; if ( pGdbObj == nullptr) diff --git a/MC_Tables.h b/MC_Tables.h index 2980262..79bfb2e 100644 --- a/MC_Tables.h +++ b/MC_Tables.h @@ -40,801 +40,930 @@ static int EdgeTable[256] = { // Tabella triangoli Enhanced MC static int TriangleTableEn[256][2][17] = { - {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 0 0 0 {0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 0 0 1 Config 1 {1, 3, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 0 1 0 Config 1 {1, 3, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 0 1 1 Config 2 + /*{2, 3, 3, 1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1}*/ {1, 4, 1, 9, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 1 0 0 Config 1 {1, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 1 0 1 Config 3 + {2, 3, 3, 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 1 1 0 Config 2 {1, 4, 2, 10, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {{2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 0 1 1 1 Config 5 {1, 5, 10, 9, 8, 3, 2 , -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 0 0 0 Config 1 {1, 3, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 0 0 1 Config 2 {1, 4, 0, 8, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - // 10 ----------------------------------------------------------- - {{1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + // 10 ----------------------------------------------------------- + {{1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 0 1 0 Config 3 {2, 3, 3, 1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 0 1 1 Config 5 {1, 5, 9, 8, 11, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 1 0 0 Config 2 {1, 4, 3, 11,10, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 1 0 1 Config 5 {1, 5, 8, 11, 10, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 1 1 0 Config 5 {1, 5, 11, 10, 9, 0, 3, -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 0 1 1 1 1 Config 8 {1, 4, 8, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 0 0 0 0 Config 1 {1, 3, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 0 0 0 1 Config 2 {1, 4, 4, 7, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 0 0 1 0 Config 3 + {2, 3, 3, 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 0 0 1 1 Config 5 {1, 5, 7, 3, 1, 9, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - // 20 ----------------------------------------------------------- - {{1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + // 20 ----------------------------------------------------------- + {{1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 0 1 0 0 Config 4 + {2, 3, 3, 1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 3, 0, 4, 7, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1}}, + {{3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 0 1 0 1 Config 6 + {2, 4, 3, 3, 0, 4, 7, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 2, 10, 9, 0, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}}, + {{9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 0 1 1 0 Config 6 + {2, 4, 3, 2, 10, 9, 0, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1}, + {{2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1}, // 0 0 0 1 0 1 1 1 Config 11 + /*{4, 3, 3, 3, 3, 2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4}*/ {1, 6, 7, 3, 2, 10, 9, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 1 0 0 0 Config 3 + {2, 3, 3, 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + {{11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 1 0 0 1 {1, 5, 2, 0, 4, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1}}, + {{9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 1 0 1 0 Config 7 + {3, 3, 3, 3, 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1}}, - {{4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 1, 9, 11, 11,9,4,7, -1, -1, -1, -1, -1 ,-1}}, + {/*{9, 11, 2, 9, 2, 1, 4, 7, 11, 9, 4, 11, -1, -1, -1, -1, -1}, // 0 0 0 1 1 0 1 1 Config 9 + {2, 4, 4, 2, 1, 9, 11, 11, 9, 4, 7, -1, -1, -1, -1, -1 ,-1}*/ + {4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, -1}, + {1, 6, 2, 1, 9, 4, 7,11,-1,-1, -1, -1, -1, -1, -1 ,-1}}, - {{3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 3, 11, 10, 1, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1}}, + {{3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 1 1 0 0 Config 6 + {2, 4, 3, 3, 11, 10, 1, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, -1}, + {{1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, -1}, // 0 0 0 1 1 1 0 1 Config 11 Da testare + /*{4, 3, 3, 3, 3,1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4}*/ {1, 6, 1, 0, 4, 7, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 30 ---------------------------------------------------------- - {{4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1}, - {2, 3, 5, 4, 7, 8, 0, 3, 11, 10, 9, -1, -1, -1, -1, -1, -1}}, + {{4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1}, // 0 0 0 1 1 1 1 0 Config 12 + {2, 3, 5, 4, 7, 8, 0, 3, 11, 10, 9, -1, -1, -1, -1, -1, -1}}, - {{4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 0 1 1 1 1 1 {1, 5, 4, 7, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 0 0 0 0 Config 1 {1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 0 0 0 1 Config 3 {2, 3, 3, 9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 0 0 1 0 Config 2 {1, 4, 0, 1, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {{8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 0 0 1 1 {1, 5, 3, 1, 5, 4, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 0 1 0 0 Config 3 + {2, 3, 3, 1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1}}, + {{3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 0 1 0 1 Config 7 + {3, 3, 3, 3, 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1}}, - {{5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {{5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 0 1 1 0 Config 5 {1, 5, 4, 0, 2, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - - {{2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 10, 5, 3, 4, 8, 3, 5, -1, -1, -1, -1, -1, -1}}, + + {/*{2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, -1}, // 0 0 1 0 0 1 1 1 Config 9 + {2, 4, 4, 2, 10, 5, 3, 4, 8, 3, 5, -1, -1, -1, -1, -1, -1}*/ + {2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, -1}, /////////<-> Questo è stato modificato rispetto alla tabella originale, è da testare + {1, 6, 5, 4, 8, 3, 2, 10, -1, -1, -1, -1, -1, -1}}, // 40 ------------------------------------------------------------ - {{9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 1 0 0 0 Config 4 + {2, 3, 3, 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 0, 8, 11, 2, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 1 0 0 1 Config 6 + {2, 4, 3, 0, 8, 11, 2, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 0, 1, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 1 0 1 0 Config 6 + {2, 4, 3, 0, 1, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, -1}, + {{2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, -1}, // 0 0 1 0 1 0 1 1 Config 11 + /*{4, 3, 3, 3, 3, 2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5}*/ {1, 6, 2, 1, 5, 4, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 3, 11, 10, 1, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1}}, + {{10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 1 1 0 0 Config 6 + {2, 4, 3, 3, 11, 10, 1, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, -1}, - {2, 3, 5, 4, 9, 5, 1, 0, 8, 11, 10, -1, -1, -1, -1, -1, -1}}, + {{4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, -1}, // 0 0 1 0 1 1 0 1 Config 12 + {2, 3, 5, 4, 9, 5, 1, 0, 8, 11, 10, -1, -1, -1, -1, -1, -1}}, - {{5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1}, + {{5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1}, // 0 0 1 0 1 1 1 0 Config 11 + /*{4, 3, 3, 3, 3, 5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3}*/ {1, 6, 5, 4, 0, 3, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {{5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 0 1 1 1 1 {1, 5, 5, 4, 8, 11, 10,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 0 0 0 0 Config 2 {1, 4, 7, 8, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 0 0 0 1 {1, 5, 5, 7, 3, 0, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 50 ---------------------------------------------------------- - {{0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 0 0 1 0 {1, 5, 1, 5, 7, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 0 0 1 1 Config 8 {1, 4, 3, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 7, 8, 9, 5, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1}}, + {{9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 0 1 0 0 Config 6 + {2, 4, 3, 7, 8, 9, 5, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, -1}, - {2, 3, 5, 10, 1, 2, 0, 9, 5, 7, 3, -1, -1, -1, -1, -1, -1}}, + {{10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, -1}, // 0 0 1 1 0 1 0 1 Config 12 + {2, 3, 5, 10, 1, 2, 0, 9, 5, 7, 3, -1, -1, -1, -1, -1, -1}}, - {{8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, -1}, + {{8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, -1}, // 0 0 1 1 0 1 1 0 Config 11 + /*{4, 3, 3, 3, 3, 8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2}*/ {1, 6, 2, 10, 5, 7, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1}, - {1, 5, 2, 10, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 0 1 1 1 Config 5 + {3, 3, 3, 3, 2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1} + /*{1, 5, 2, 10, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 7, 8, 9, 5, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1}}, + {{7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 1 0 0 0 Config 6 + {2, 4, 3, 7, 8, 9, 5, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1}, + {{9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1}, // 0 0 1 1 1 0 0 1 Config 11 + /*{4, 3, 3, 3, 3, 9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11} */ {1, 6, 2, 0, 9, 5, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, -1}, - {2, 3, 5, 2, 3, 11, 8, 0, 1, 5, 7, -1, -1, -1, -1, -1, -1}}, + {{2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, -1}, // 0 0 1 1 1 0 1 0 Config 12 + {2, 3, 5, 2, 3, 11, 8, 0, 1, 5, 7, -1, -1, -1, -1, -1, -1}}, - {{11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {{11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 1 0 1 1 Config 5 + /*{3, 3, 3, 3, 11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1}*/ {1, 5, 11, 2, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 60 -------------------------------------------------------- - {{9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, -1}, - {2, 4, 4, 3, 11, 10, 1, 5, 7, 8, 9, -1, -1, -1, -1, -1, -1}}, + {{9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, -1}, // 0 0 1 1 1 1 0 0 Config 10 + {2, 4, 4, 3, 11, 10, 1, 5, 7, 8, 9, -1, -1, -1, -1, -1, -1}}, + + {{5, 10, 11, 7, 5, 11, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 1 1 0 1 Config 6 cambiato deve essere testato + {2, 4, 3, 5, 7, 10, 11, 9, 1, 0, -1, -1, -1, -1 , -1, -1, -1} + /*{5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, -1}, + {1, 7, 5, 7, 11, 10, 1, 0, 9, -1, -1, -1, -1, -1, -1, -1, -1}*/}, + + {{5, 10, 11, 7, 5, 11, 3, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 1 1 1 0 Config 6 cambiato deve essere testato + {2, 4, 3, 5, 7, 10, 11, 3, 8, 0, -1, -1, -1, -1 , -1, -1, -1} + /*{11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, -1}, + {1, 7, 11, 10, 5, 7, 8, 0, 3, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, -1}, - {1, 7, 5, 7, 11, 10, 1, 0, 9, -1, -1, -1, -1, -1, -1, -1, -1}}, - - {{11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, -1}, - {1, 7, 11, 10, 5, 7, 8, 0, 3, -1, -1, -1, -1, -1, -1, -1, -1}}, - - {{11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 0 1 1 1 1 1 1 Config 2 {1, 4, 5, 7, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 0 0 0 0 {1, 3, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 0 0 0 1 Config 4 + {2, 3, 3, 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 0 0 1 0 Config 3 + {2, 3, 3, 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 0 0 1 1 Config 6 {2, 4, 3, 1, 9, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 0 1 0 0 Config 2 {1, 4, 1, 2, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 1, 2, 6, 5, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1}}, + {{1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 0 1 0 1 Config 6 + {2, 4, 3, 1, 2, 6, 5, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1}}, // 70 ---------------------------------------------------------- - {{9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 0 1 1 0 {1, 5, 0, 2, 6, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, -1}, + {{5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, -1}, // 0 1 0 0 0 1 1 1 Config 11 + /*{4, 3, 3, 3, 3, 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8}*/ {1, 6, 2, 6, 5, 9, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 1 0 0 0 Config 3 {2, 3, 3, 2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 0, 8, 11, 2, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}}, + {{11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 1 0 0 1 Config 6 + {2, 4, 3, 0, 8, 11, 2, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1}}, + {{0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 1 0 1 0 Config 7 + {3, 3, 3, 3, 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1}}, - {{5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, -1}, - {2, 3, 5, 5, 10, 6, 2, 1, 9, 8, 11, -1, -1, -1, -1, -1, -1}}, + {{5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, -1}, // 0 1 0 0 1 0 1 1 Config 12 + {2, 3, 5, 5, 10, 6, 2, 1, 9, 8, 11, -1, -1, -1, -1, -1, -1}}, - {{6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {{6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 1 1 0 0 {1, 5, 5, 1, 3, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1}, - {1, 6, 5, 1, 0, 8,11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1}, // 0 1 0 0 1 1 0 1 Config 11 + /*{4, 3, 3, 3, 3, 0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11}*/ + {1, 6, 5, 1, 0, 8,11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, -1}, - {2, 4, 4, 3, 11, 6, 0, 5, 9, 0, 6, -1, -1, -1, -1}}, + {/*{3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, -1}, // 0 1 0 0 1 1 1 0 Config 9 + {2, 4, 4, 3, 11, 6, 0, 5, 9, 0, 6, -1, -1, -1, -1}*/ + {3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, -1}, ///<-> Cambiato da testare + {1, 6, 0, 3, 11, 6, 5, 9, -1, -1, -1, -1, -1, -1, -1}}, - {{6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {{6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 0 1 1 1 1 {1, 5, 6, 5, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 80 ----------------------------------------------------------- - {{5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 0 0 0 0 Config 3 + {2, 3, 3, 5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 4, 7, 3, 0, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1}}, + {{4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 0 0 0 1 Config 6 + {2, 4, 3, 4, 7, 3, 0, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1}}, + {{1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 0 0 1 0 Config 7 + {3, 3, 3, 3, 1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1}}, - {{10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1}, - { 2, 3, 5,10, 6, 5, 9, 4, 7, 3, 1,-1, -1, -1, -1, -1, -1}}, + {{10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1}, // 0 1 0 1 0 0 1 1 Config 12 + { 2, 3, 5,10, 6, 5, 9, 4, 7, 3, 1,-1, -1, -1, -1, -1, -1}}, - {{6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 1, 2, 6, 5, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1}}, + {{6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 0 1 0 0 Config 6 + {2, 4, 3, 1, 2, 6, 5, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 6, 5, 1, 3, 0, 4, 7, -1, -1, -1, -1, -1, -1}}, + {{1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, -1}, // 0 1 0 1 0 1 0 1 Config 10 + {2, 4, 4, 2, 6, 5, 1, 3, 0, 4, 7, -1, -1, -1, -1, -1, -1}}, - {{8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, -1}, - {2, 3, 5, 8, 4, 7, 5, 9, 0, 2, 6, -1, -1, -1, -1, -1, -1}}, + {{8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, -1}, // 0 1 0 1 0 1 1 0 Config 12 + {2, 3, 5, 8, 4, 7, 5, 9, 0, 2, 6, -1, -1, -1, -1, -1, -1}}, + + {{3, 6, 7, 6, 3, 2, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 0 1 1 1 Config 6 + {2, 4, 3, 3, 2, 6, 7, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1} + /*{7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, -1}, + {1, 7, 7, 3, 2, 6, 5, 9, 4,-1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, -1}, - {1, 7, 7, 3, 2, 6, 5, 9, 4,-1, -1, -1, -1, -1, -1, -1, -1}}, + {{3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 1 0 0 0 Config 7 + {3, 3, 3, 3, 3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1}}, - {{3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1}}, - - {{5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1}, - {2, 3, 5, 5, 10, 6, 7, 11, 2, 0, 4, -1, -1, -1, -1, -1, -1}}, + {{5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1}, // 0 1 0 1 1 0 0 1 Config 12 + {2, 3, 5, 5, 10, 6, 7, 11, 2, 0, 4, -1, -1, -1, -1, -1, -1}}, // 90 ------------------------------------------------------ - {{0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1}, - {4, 3, 3, 3, 3, 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6}}, + {{0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1}, // 0 1 0 1 1 0 1 0 Config 13 + {4, 3, 3, 3, 3, 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6}}, - {{9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, -1}, - {3, 4, 4, 3, 2, 1, 9, 11, 4, 7, 11, 9, 5, 10, 6, -1, -1}}, + {{10, 2, 1, 11, 6, 7, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 1 0 1 1 Config 7 + {3, 3, 3, 3, 10, 2, 1, 11, 6, 7, 9, 4, 5, -1, -1, -1, -1} + /*{9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, -1}, + {3, 4, 4, 3, 2, 1, 9, 11, 4, 7, 11, 9, 5, 10, 6, -1, -1}*/}, - {{8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1}, - {2, 3, 5, 8, 4, 7, 11, 6, 5, 1, 3, -1, -1, -1, -1, -1, -1}}, + {{8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1}, // 0 1 0 1 1 1 0 0 Config 12 + {2, 3, 5, 8, 4, 7, 11, 6, 5, 1, 3, -1, -1, -1, -1, -1, -1}}, - {{5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, -1}, - {1, 7, 5, 1, 0, 4, 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 5, 1, 5, 0, 4, 6, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 1 1 0 1 Config 6 + {2, 4, 3, 4, 5, 1, 0, 6, 7, 11, -1, -1, -1, -1, -1, -1, -1} + /*{5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, -1}, + {1, 7, 5, 1, 0, 4, 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, -1}, - {3, 4, 4, 3, 0, 6, 5, 9, 3, 11, 6, 0, 8, 4, 7, -1, -1}}, + {{8, 0, 3, 9, 4, 5, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 1 1 1 0 Config 7 + {3, 3, 3, 3, 8, 0, 3, 9, 4, 5, 11, 6, 7, -1, -1, -1, -1} + /*{0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, -1}, + {3, 4, 4, 3, 0, 6, 5, 9, 3, 11, 6, 0, 8, 4, 7, -1, -1}*/}, + + {{5, 9, 4, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 0 1 1 1 1 1 Config 3 + {2, 3, 3, 5, 9, 4, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1} + /*{6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, -1}, + {2, 4, 4, 9, 4, 7, 11, 6, 5, 9, 11,-1, -1, -1, -1, -1, -1}*/}, - {{6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, -1}, - {2, 4, 4, 9, 4, 7, 11, 6, 5, 9, 11,-1, -1, -1, -1, -1, -1}}, - - {{10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 0 0 0 0 Config 2 {1, 4, 4, 9, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 4, 9, 10, 6, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1}}, + {{4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 0 0 0 1 Config 6 + {2, 4, 3, 4, 9, 10, 6, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 0 0 1 0 {1, 5, 6, 4, 0, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1}, + {{8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1}, // 0 1 1 0 0 0 1 1 Config 11 + /*{4, 3, 3, 3, 3, 8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10}*/ {1, 6, 1, 10, 6, 4, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 100 --------------------------------------------------------- - {{1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 0 1 0 0 {1, 5, 2, 6, 4, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, -1}, - {2, 3, 5, 3, 0, 8, 9, 1, 2, 6, 4, -1, -1, -1, -1, -1, -1}}, + {{3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, -1}, // 0 1 1 0 0 1 0 1 Config 12 + {2, 3, 5, 3, 0, 8, 9, 1, 2, 6, 4, -1, -1, -1, -1, -1, -1}}, - {{0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 0 1 1 0 Config 8 {1, 4, 2, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {{8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 0 1 1 1 {1, 5, 8, 3, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 10, 6, 4, 9, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1}}, + {{10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 1 0 0 0 Config 6 + {2, 4, 3, 10, 6, 4, 9, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 11, 8, 0, 10, 6, 4, 9, -1, -1, -1, -1, -1, -1}}, + {{0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, -1}, // 0 1 1 0 1 0 0 1 Config 10 + {2, 4, 4, 2, 11, 8, 0, 10, 6, 4, 9, -1, -1, -1, -1, -1, -1}}, - {{3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1}, - {2, 3, 5, 3, 11, 2, 1, 10, 6, 4, 0, -1, -1, -1, -1, -1, -1}}, + {{3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1}, // 0 1 1 0 1 0 1 0 Config 12 + {2, 3, 5, 3, 11, 2, 1, 10, 6, 4, 0, -1, -1, -1, -1, -1, -1}}, + + {{10, 2, 1, 8, 6, 4, 6, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 1 0 1 1 Config 6 + {2, 4, 3, 6, 4, 8, 11, 10, 2, 1, -1, -1, -1, -1, -1, -1, -1} + /*{6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, -1}, + {1, 7, 6, 4, 8, 11, 2, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, -1}, - {1, 7, 6, 4, 8, 11, 2, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1}}, - - {{9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, -1}, + {{9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, -1}, // 0 1 1 0 1 1 0 0 Config 11 {1, 6, 3, 11, 6, 4, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, -1}, - {1, 7, 8, 11, 6, 4, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{6, 4, 11, 8, 11, 4, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 1 1 0 1 Config 6 + {2, 4, 3, 6, 4, 8, 11, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1} + /*{8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, -1}, + {1, 7, 8, 11, 6, 4, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1}*/}, // 110 ---------------------------------------------------------- - {{3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 1 1 1 0 {1, 5, 3, 11, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 0 1 1 1 1 Config 2 {1, 4, 8, 11, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 0 0 0 0 {1, 5, 8, 9, 10, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, -1}, + {{0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, -1}, // 0 1 1 1 0 0 0 1 Config 11 + /*{4, 3, 3, 3, 3, 0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10}*/ {1, 6, 0, 9, 10, 6, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, -1}, - {2, 4, 4, 8, 0, 1, 7, 10, 6, 7, 1, -1, -1, -1, -1, -1, -1}}, + {{10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, -1}, + {1, 6, 7, 8, 0, 1, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1} + /*{10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, -1}, // 0 1 1 1 0 0 1 0 Config 9 + {2, 4, 4, 10, 6, 7, 1, 1, 7, 8, 0, -1, -1, -1, -1, -1, -1}*/}, - {{10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 0 0 1 1 {1, 5, 10, 6, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1}, + {{1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1}, // 0 1 1 1 0 1 0 0 Config 11 + /*{4, 3, 3, 3, 3, 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7}*/ {1, 6, 1, 2, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, -1}, - {1, 7, 2, 6, 7, 3, 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{7, 3, 6, 2, 6, 3, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 0 1 0 1 Config 6 + {2, 4, 3, 3, 2, 6, 7, 9, 1, 0, -1, -1, -1, -1 , -1, -1, -1} + /*{2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, -1}, + {1, 7, 2, 6, 7, 3, 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 0 1 1 0 {1, 5, 7, 8, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 0 1 1 1 Config 2 {1, 4, 7, 3, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 120 ------------------------------------------------------- - {{2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1}, - {2, 3, 5, 2, 3, 11, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1}}, + {{2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1}, // 0 1 1 1 1 0 0 0 Config 12 + {2, 3, 5, 2, 3, 11, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1}}, - {{2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, -1}, - {1, 7, 2, 0, 9, 10, 6, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{11, 6, 7, 9, 2, 0, 2, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 1 0 0 1 Config 6 + {2, 4, 3, 9, 10, 2, 0, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1} + /*{2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, -1}, + {1, 7, 2, 0, 9, 10, 6, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, -1}, - {3, 4, 4, 3, 8, 0, 1, 7, 10, 6, 7, 1, 11, 2, 3, -1, -1}}, + {{6, 7, 11, 0, 3, 8, 2, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 1 0 1 0 Config 7 + {3, 3, 3, 3, 6, 7, 11, 0, 3, 8, 2, 1, 10, -1, -1, -1, -1} + /*{1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, -1}, + {3, 4, 4, 3, 8, 0, 1, 7, 10, 6, 7, 1, 11, 2, 3, -1, -1}*/}, - {{11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, -1}, - {2, 4, 4, 11, 2, 1, 7, 1, 10, 6, 7, -1, -1, -1, -1, -1, -1}}, + {{1, 10, 2, 11, 6, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 1 0 1 1 Config 3 + {2, 3, 3, 1, 10, 2, 11, 6, 3, -1, -1, -1, -1, -1, -1, -1, -1} + /*{11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, -1}, + {2, 4, 4, 11, 2, 1, 7, 1, 10, 6, 7, -1, -1, -1, -1, -1, -1}*/}, - {{8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, -1}, - {1, 7, 8, 9, 1, 3, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{6, 7, 11, 1, 3, 9, 8, 9, 3, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 1 1 0 0 Config 6 + {2, 4, 3, 1, 3, 8, 9, 6, 7, 11, -1, -1, -1, -1, -1, -1, -1} + /*{8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, -1}, + {1, 7, 8, 9, 1, 3, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 1 1 0 1 Config 4 + {2, 3, 3, 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, -1}, - {2, 4, 4, 0, 3, 11, 6, 7, 8, 0, 6, -1, -1, -1, -1, -1, -1}}, + {{8, 0, 3, 6, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 1 1 1 0 Config 3 + {2, 3, 3, 8, 0, 3, 6, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1} + /*{7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, -1}, + {2, 4, 4, 0, 3, 11, 6, 7, 8, 0, 6, -1, -1, -1, -1, -1, -1}*/}, - {{7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 0 1 1 1 1 1 1 1 {1, 3, 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 0 0 0 0 {1, 3, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 0 0 0 1 Config 3 {2, 3, 3, 3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, // 130 ---------------------------------------------------------- - {{0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 0 0 1 0 Config 4 + {2, 3, 3, 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 1, 9, 8, 3, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}}, + {{8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 0 0 1 1 Config 6 + {2, 4, 3, 1, 9, 8, 3, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}}, + {{10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 0 1 0 0 Config 3 + {2, 3, 3, 10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 0 1 0 1 Config 7 + {3, 3, 3, 3, 1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1}}, - {{1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1}}, - - {{2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 2, 10, 9, 0, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}}, + {{2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 0 1 1 0 Config 6 + {2, 4, 3, 2, 10, 9, 0, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}}, - {{6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, -1}, - {2, 3, 5, 6, 11, 7, 3, 2, 10, 9, 8, -1, -1, -1, -1, -1, -1}}, + {{6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, -1}, // 1 0 0 0 0 1 1 1 Config 12 + {2, 3, 5, 6, 11, 7, 3, 2, 10, 9, 8, -1, -1, -1, -1, -1, -1}}, - {{7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 1 0 0 0 Config 2 {1, 4, 2, 3, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 1 0 0 1 {1, 5, 6, 2, 0, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 2, 3, 7, 6, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1}}, + {{2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 1 0 1 0 Config 6 + {2, 4, 3, 2, 3, 7, 6, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, -1}, + {{1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, -1}, // 1 0 0 0 1 0 1 1 Config 11 + /*{4, 3, 3, 3, 3, 1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6}*/ {1, 6, 6, 2, 1, 9, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 140 ---------------------------------------------------------- - {{10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 1 1 0 0 {1, 5, 1, 3, 7, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, -1}, - {2, 4, 4, 10, 1, 7, 6, 8, 7, 1, 0, -1, -1, -1, -1, -1, -1}}, + {/*{10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, -1}, // 1 0 0 0 1 1 0 1 Config 9 + {2, 4, 4, 10, 1, 7, 6, 8, 7, 1, 0, -1, -1, -1, -1, -1, -1}*/ + {10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, -1}, + {1, 6, 1, 0, 8, 7, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, -1}, + {{0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, -1}, // 1 0 0 0 1 1 1 0 Config 11 + /*{4, 3, 3, 3, 3, 0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7}*/ {1, 6, 10, 9, 0, 3, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {{7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 0 1 1 1 1 {1, 5, 7, 6, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 0 0 0 0 Config 2 {1, 4, 6, 11, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 0 0 0 1 {1, 5, 0, 4, 6, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 6, 11, 8, 4, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1}}, + {{8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 0 0 1 0 Config 6 + {2, 4, 3, 6, 11, 8, 4, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, -1}, + {{9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, -1}, // 1 0 0 1 0 0 1 1 Config 11 + /*{4, 3, 3, 3, 3, 9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6}*/ {1, 6, 6, 11, 3, 1, 9, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 6, 11, 8, 4, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1}}, + {{6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 0 1 0 0 Config 6 + {2, 4, 3, 6, 11, 8, 4, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, -1}, - {2, 3, 5, 1, 2, 10, 11, 3, 0, 4, 6, -1, -1, -1, -1, -1, -1}}, + {{1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, -1}, // 1 0 0 1 0 1 0 1 Config 13 + {2, 3, 5, 1, 2, 10, 11, 3, 0, 4, 6, -1, -1, -1, -1, -1, -1}}, // 150 ------------------------------------------------------- - {{4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, -1}, - {2, 4, 4, 4, 6, 11, 8, 2, 10, 9, 0, -1, -1, -1, -1, -1, -1}}, + {{4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, -1}, // 1 0 0 1 0 1 1 0 Config 10 + {2, 4, 4, 4, 6, 11, 8, 2, 10, 9, 0, -1, -1, -1, -1, -1, -1}}, - {{10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, -1}, - {1, 7, 10, 9, 4, 6, 11, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{3, 2, 11, 4, 6, 9, 10, 9, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 0 1 1 1 Config 6 + {2, 4, 3, 4, 6, 10, 9, 3, 2, 11, -1, -1, -1, -1, -1, -1, -1} + /*{10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, -1}, + {1, 7, 10, 9, 4, 6, 11, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {{8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 1 0 0 0 {1, 5, 4, 6, 2, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 1 0 0 1 Config 8 {1, 4, 4, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, -1}, - {2, 3, 5, 1, 9, 0, 3, 8, 4, 6, 2, -1, -1, -1, -1, -1, -1}}, + {{1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, -1}, // 1 0 0 1 1 0 1 0 Config 12 + {2, 3, 5, 1, 9, 0, 3, 8, 4, 6, 2, -1, -1, -1, -1, -1, -1}}, - {{1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 1 0 1 1 {1, 5, 1, 9, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, -1}, + {{8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, -1}, // 1 0 0 1 1 1 0 0 Config 11 + /*{4, 3, 3, 3, 3, 8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1}*/ {1, 6, 1, 3, 8, 4, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 1 1 0 1 {1, 5, 10, 1, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, -1}, - {1, 7, 4, 6, 10, 9, 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{8, 0, 3, 10, 4, 6, 4, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 1 1 1 0 Config 6 + {2, 4, 3, 6, 10, 9, 4, 8, 0, 3,-1, -1, -1, -1, -1, -1, -1} + /*{4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, -1}, + {1, 7, 4, 6, 10, 9, 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 0 1 1 1 1 1 Config 2 {1, 4, 4, 6, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 160 ---------------------------------------------------------- - {{4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 3, 3, 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 0 0 0 0 Config 3 + {2, 3, 3, 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1}}, + {{0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 0 0 0 1 Config 7 + {3, 3, 3, 3, 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1}}, - {{5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 0, 1, 5, 4, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}}, + {{5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 0 0 1 0 Config 6 + {2, 4, 3, 0, 1, 5, 4, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}}, - {{11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, -1}, - {2, 3, 5, 11, 7, 6, 4, 8, 3, 1, 5, -1, -1, -1, -1, -1, -1}}, + {{11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, -1}, // 1 0 1 0 0 0 1 1 Config 12 + {2, 3, 5, 11, 7, 6, 4, 8, 3, 1, 5, -1, -1, -1, -1, -1, -1}}, - {{9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}, - {3, 3, 3, 3, 9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1}}, + {{9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 0 1 0 0 Config 7 + {3, 3, 3, 3, 9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1}}, - {{6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, -1}, - {4, 3, 3, 3, 3, 6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5}}, + {{6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, -1}, // 1 0 1 0 0 1 0 1 Config 13 + {4, 3, 3, 3, 3, 6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5}}, - {{7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, -1}, - {2, 3, 5, 7, 6, 11, 10, 5, 4, 0, 2,-1, -1, -1, -1, -1, -1}}, + {{7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, -1}, // 1 0 1 0 0 1 1 0 Config 12 + {2, 3, 5, 7, 6, 11, 10, 5, 4, 0, 2,-1, -1, -1, -1, -1, -1}}, - {{3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, -1}, - {3, 4, 4, 3, 5, 3, 2, 10, 4, 8, 3, 5, 6, 11, 7, 6, -1}}, + {{11, 3, 2, 8, 7, 4, 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 0 1 1 1 Config 7 + {3, 3, 3, 3, 11, 3, 2, 8, 7, 4, 10, 5, 6, -1, -1, -1, -1} + /*{3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, -1}, + {3, 4, 4, 3, 5, 3, 2, 10, 4, 8, 3, 5, 6, 11, 7, 6, -1}*/}, - {{7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, -1}, - {2, 4, 3, 2, 3, 7, 6, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1}}, + {{7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 1 0 0 0 Config 6 + {2, 4, 3, 2, 3, 7, 6, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, -1}, - {2, 3, 5, 9, 5, 4, 8, 7, 6, 2, 0, -1, -1, -1, -1, -1, -1}}, + {{9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, -1}, // 1 0 1 0 1 0 0 1 Config 12 + {2, 3, 5, 9, 5, 4, 8, 7, 6, 2, 0, -1, -1, -1, -1, -1, -1}}, // 170 ----------------------------------------------------- - {{3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, -1}, - {2, 4, 4, 3, 7, 6, 2, 0, 1, 5, 4, -1, -1, -1, -1, -1, -1}}, + {{3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, -1}, // 1 0 1 0 1 0 1 0 Config 10 + {2, 4, 4, 3, 7, 6, 2, 0, 1, 5, 4, -1, -1, -1, -1, -1, -1}}, - {{6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, -1}, - {1, 7, 6, 2, 1, 5, 4, 8, 7,-1, -1, -1, -1, -1, -1, -1, -1}}, + {{7, 4, 8, 1, 6, 2, 6, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 1 0 1 1 Config 6 + {2, 4, 3, 5, 6, 2, 1, 7, 4, 8, -1, -1, -1, -1, -1, -1, -1} + /*{6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, -1}, + {1, 7, 6, 2, 1, 5, 4, 8, 7,-1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, -1}, - {2, 3, 5, 9, 5, 4, 6, 10, 1, 3, 7,-1, -1, -1, -1, -1, -1}}, + {{9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, -1}, // 1 0 1 0 1 1 0 0 Config 12 + {2, 3, 5, 9, 5, 4, 6, 10, 1, 3, 7,-1, -1, -1, -1, -1, -1}}, - {{1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, -1}, - {3, 4, 4, 3, 0, 8, 7, 1, 6, 10, 1, 7, 9, 5, 4, -1, -1}}, + {{9, 1, 0, 10, 5, 6, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 1 1 0 1 Config 7 + {3, 3, 3, 3, 9, 1, 0, 10, 5, 6, 8, 7, 4, -1, -1, -1, -1} + /*{1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, -1}, + {3, 4, 4, 3, 0, 8, 7, 1, 6, 10, 1, 7, 9, 5, 4, -1, -1}*/}, - {{4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, -1}, - {1, 7, 4, 0, 3, 7, 6, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1}}, + /*{{4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, -1}, + {1, 7, 4, 0, 3, 7, 6, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1}}*/ + {{3, 4, 0, 4, 3, 7, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 1 1 1 0 Config 6 + {2, 4, 3, 3, 7, 4, 0, 10, 5, 6, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, -1}, - {2, 4, 4, 4, 8, 10, 5, 7, 6, 10, 8, -1, -1, -1, -1, -1, -1}}, + {{6, 10, 5, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 0 1 1 1 1 Config 3 + {2, 3, 3, 6, 10, 5, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1} + /*{7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, -1}, + {2, 4, 4, 7, 6, 10, 8, 4, 8, 10, 5, -1, -1, -1, -1, -1, -1}*/}, - {{6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {{6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 0 0 0 0 {1, 5,11, 8, 9, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, -1}, + {/*{3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, -1}, // 1 0 1 1 0 0 0 1 Config 9 + {2, 4, 4, 0, 9, 5, 6, 6, 11, 3, 0, -1, -1, -1, -1, -1, -1}*/ + {3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, -1}, {2, 4, 4, 0, 9, 5, 6, 6, 11, 3, 0, -1, -1, -1, -1, -1, -1}}, - {{0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, -1}, + {{0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, -1}, // 1 0 1 1 0 0 1 0 Config 11 + /*{4, 3, 3, 3, 3, 0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11}*/ {1, 6, 0, 1, 5, 6, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 0 0 1 1 {1, 5, 6, 11, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 180 ------------------------------------------------------- - {{1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, -1}, + {{1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, -1}, // 1 0 1 1 0 1 0 0 Config 12 {2, 3, 5, 1, 2, 10, 5, 6, 11, 8, 9, -1, -1, -1, -1, -1, -1}}, + + {{5, 6, 10, 3, 2, 11, 1, 0, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 0 1 0 1 Config 7 + {3, 3, 3, 3, 5, 6, 10, 3, 2, 11, 1, 0, 9, -1, -1, -1, -1} + /*{0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, -1}, + {3, 4, 4, 3, 11, 3, 0, 6, 9, 5, 6, 0, 2, 10, 1, 2, 10}*/}, - {{0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, -1}, - {3, 4, 4, 3, 11, 3, 0, 6, 9, 5, 6, 0, 2, 10, 1, 2, 10}}, + {{5, 6, 10, 0, 2, 8, 11, 8, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 0 1 1 0 Config 6 + {2, 4, 3, 11, 8, 3, 0, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1} + /*{11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, -1}, + {1, 7,11, 8, 0, 2, 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, -1}, - {1, 7,11, 8, 0, 2, 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{11, 3, 2, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 0 1 1 1 Config 3 + {2, 3, 3, 11, 3, 2, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1} + /*{6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, -1}, + {2, 4, 4, 6, 11, 3, 5, 10, 5, 3, 2, -1, -1, -1, -1, -1, -1}*/}, - {{6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, -1}, - {2, 4, 4, 6, 11, 3, 5, 10, 5, 3, 2, -1, -1, -1, -1, -1, -1}}, - - {{5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, -1}, + {{5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, -1}, // 1 0 1 1 1 0 0 0 Config 11 + /*{4, 3, 3, 3, 3, 5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2}*/ {1, 6, 2, 3, 8, 9, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 1 0 0 1 {1, 5, 9, 5, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + + {{8, 0, 3, 6, 2, 5, 1, 5, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 1 0 1 0 Config 6 + {2, 4, 3, 5, 6, 2, 1, 8, 0, 3, -1, -1, -1, -1, -1, -1, -1} + /*{1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, -1}, + {1, 7, 1, 5, 6, 2, 3, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, -1}, - {1, 7, 1, 5, 6, 2, 3, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1}}, - - {{1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 1 0 1 1 Config 2 {1, 4, 1, 5, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, -1}, - {1, 7, 1, 3, 8, 9, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{10, 5, 6, 8, 1, 3, 1, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 1 1 0 0 Config 6 + {2, 4, 3, 8, 9, 1, 3, 10, 5, 6, -1, -1, -1, -1, -1, -1, -1} + /*{1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, -1}, + {1, 7, 1, 3, 8, 9, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, -1}, - {2, 4, 4, 5, 6, 0, 9, 10, 1, 0, 6, -1, -1, -1, -1, -1, -1}}, + {{1, 0, 9, 6, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 1 1 0 1 Config 3 + {2, 3, 3, 1, 0, 9, 6, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1} + /*{10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, -1}, + {2, 4, 4, 5, 6, 0, 9, 10, 1, 0, 6, -1, -1, -1, -1, -1, -1}*/}, // 190 ---------------------------------------------------------- - {{0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 1 1 1 0 Config 4 {2, 3, 3, 0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 0 1 1 1 1 1 1 {1, 3, 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 0 0 0 0 Config 2 {1, 4, 5, 10, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {{11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 0 0 0 1 Config 6 {2, 4, 3, 5, 10, 11, 7, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1}}, - {{5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {{5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 0 0 1 0 Config 6 {2, 4, 3, 5, 10, 11, 7, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1}}, - {{10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, -1}, + {{10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, -1}, // 1 1 0 0 0 0 1 1 Config 10 {2, 4, 4, 10, 11, 7, 5, 1, 9, 8, 3, -1, -1, -1, -1, -1, -1}}, - {{11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 0 1 0 0 {1, 5, 7, 5, 1, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, -1}, + {{0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, -1}, // 1 1 0 0 0 1 0 1 Config 12 {2, 3, 5, 0, 8, 3, 2, 11, 7, 5, 1, -1, -1, -1, -1, -1, -1}}, - {{9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, -1}, + {{9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, -1}, // 1 1 0 0 0 1 1 0 Config 11 + /*{4, 3, 3, 3, 3, 9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11}*/ {1, 6, 2, 11, 7, 5, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, -1}, - {1, 7, 7, 5, 9, 8, 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{11, 3, 2, 9, 7, 5, 7, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 0 1 1 1 Config 6 + {2, 4, 3, 7, 5, 9, 8, 11, 3, 2, - 1, -1, -1, -1, -1, -1, -1} + /*{7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, -1}, + {1, 7, 7, 5, 9, 8, 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1}*/}, // 200 ---------------------------------------------------------- - {{2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {{2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 1 0 0 0 {1, 5, 3, 7, 5, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, -1}, + {{8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, -1}, // 1 1 0 0 1 0 0 1 Config 11 + /*{4, 3, 3, 3, 3, 8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5}*/ {1, 6, 5, 10, 2, 0, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, -1}, + {{9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, -1}, // 1 1 0 0 1 0 1 0 Config 12 {2, 3, 5, 9, 0, 1, 10, 2, 3, 7, 5, -1, -1, -1, -1, -1, -1}}, - {{9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, -1}, - {1, 7, 9, 8, 7, 5, 10, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{2, 1, 10, 7, 5, 8, 9, 8, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 1 0 1 1 Config 6 + {2, 4, 3, 5, 9, 8, 7, 2, 1, 10, -1, -1, -1, -1, -1, -1, -1} + /*{9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, -1}, + {1, 7, 9, 8, 7, 5, 10, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 1 1 0 0 Config 8 {1, 4, 3, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 1 1 0 1 {1, 5, 0, 8, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 1 1 1 0 {1, 5, 9, 0, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 0 1 1 1 1 Config 2 {1, 4, 7, 5, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {{5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 0 0 0 0 {1, 5, 10, 11, 8, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, -1}, + {{5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, -1}, // 1 1 0 1 0 0 0 1 Config 11 + /*{4, 3, 3, 3, 3,5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0}*/ {1, 6, 0, 4, 5, 10, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 210 ------------------------------------------------------ - {{0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, -1}, + {{0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, -1}, // 1 1 0 1 0 0 1 0 Config 12 {2, 3, 5, 0, 1, 9, 4, 5, 10, 11, 8, -1, -1, -1, -1, -1, -1}}, - {{10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, -1}, - {1, 7, 10, 11, 3, 1, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1}}, + {{4, 5, 9, 3, 1, 11, 10, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 0 0 1 1 Config 6 + {2, 4, 3, 3, 1, 10, 11, 4, 5, 9, -1, -1, -1, -1, -1, -1, -1} + /*{10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, -1}, + {1, 7, 10, 11, 3, 1, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1}*/}, - {{2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, -1}, + {{2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, -1}, // 1 1 0 1 0 1 0 0 Config 11 + /*{4, 3, 3, 3, 3, 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8}*/ {1, 6, 2, 11, 8, 4, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, -1}, - {1, 7, 0, 4, 5, 1, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{11, 3, 2, 5, 1, 4, 0, 4, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 0 1 0 1 Config 6 + {2, 4, 3, 0, 4, 5, 1, 11, 3, 2, -1, -1, -1, -1, -1, -1, -1} + /*{0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, -1}, + {1, 7, 0, 4, 5, 1, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, -1}, - {1, 7, 0, 2, 11, 8, 4, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{9, 4, 5, 11, 0, 2, 0, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 0 1 1 0 Config 6 + {2, 4, 3, 0, 2, 11, 8, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1} + /*{0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, -1}, + {1, 7, 0, 2, 11, 8, 4, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 0 1 1 1 Config 4 {2, 3, 3, 9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 3, 5, 10, 4, 5, 3, 8, -1, -1, -1, -1, -1, -1}}, + {/*{2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, -1}, // 1 1 0 1 1 0 0 0 Config 9 + {2, 4, 4, 2, 3, 5, 10, 4, 5, 3, 8, -1, -1, -1, -1, -1, -1}*/ + {2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, -1}, + {1, 6, 2, 3, 8, 4, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {{5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 1 0 0 1 {1, 5, 5, 10, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, -1}, - {3, 4, 4, 3, 3, 5, 10, 2, 8, 4, 5, 3, 0, 1, 9, -1, -1}}, + {{4, 5, 9, 2, 1, 10, 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 1 0 1 0 Config 7 + {3, 3, 3, 3, 4, 5, 9, 2, 1, 10, 0, 3, 8, -1, -1, -1, -1} + /*{3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, -1}, + {3, 4, 4, 3, 3, 5, 10, 2, 8, 4, 5, 3, 0, 1, 9, -1, -1}*/}, - {{5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, -1}, - {1, 6, 10, 2, 1, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{10, 2, 1, 4, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 1 0 1 1 Config 3 + {2, 3, 3, 10, 2, 1, 4, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1} + /*{5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, -1}, + {1, 6, 10, 2, 1, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1}*/}, // 220 ---------------------------------------------------------- - {{8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 1 1 0 0 {1, 5, 8, 4, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 1 1 0 1 Config 2 {1, 4, 0, 4, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, -1}, - {2, 4, 4, 0, 3, 5, 9, 8, 4, 5, 3, -1, -1, -1, -1, -1, -1}}, + {{4, 5, 9, 3, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 1 1 1 0 Config 3 ha medesimo discorso della nove per caso connesso + {2, 3, 3, 4, 5, 9, 3, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1} + /*{8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, -1}, + {2, 4, 4, 0, 3, 5, 9, 8, 4, 5, 3, -1, -1, -1, -1, -1, -1}*/}, - {{9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 0 1 1 1 1 1 {1, 3, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 0 0 0 0 {1, 5, 9, 10, 11, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, -1}, + {{0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, -1}, // 1 1 1 0 0 0 0 1 Config 12 {2, 3, 5, 0, 8, 3, 7, 4, 9, 10, 11, -1, -1, -1, -1, -1, -1}}, - {{1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, -1}, + {{1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, -1}, // 1 1 1 0 0 0 1 0 Config 11 + /*{4, 3, 3, 3, 3, 1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11}*/ {1, 6, 1, 10, 11, 7, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, -1}, - {1, 7, 3, 1, 10, 11, 7, 4, 8, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{ 10, 3, 1, 3, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 0 0 1 1 Config 6 + {2, 4, 3, 3, 4, 10, 1, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1} + /*{3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, -1}, + {1, 7, 3, 1, 10, 11, 7, 4, 8, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 11, 9, 1, 4, 9, 11, 7, -1, -1, -1, -1, -1, -1}}, + {/*{4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, -1}, // 1 1 1 0 0 1 0 0 Config 9 + {2, 4, 4, 2, 11, 9, 1, 4, 9, 11, 7, -1, -1, -1, -1, -1, -1}*/ + {4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, -1}, + {1, 6, 11, 7, 4, 9, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, -1}, - {3, 4, 4, 3, 1, 2, 11, 9, 7, 4, 9, 11, 8, 3, 0, 8, 3}}, + {{7, 4, 8, 1, 0, 9, 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 0 1 0 1 Config 7 + {3, 3, 3, 3, 7, 4, 8, 1, 0, 9, 3, 2, 11, -1, -1, -1, -1} + /*{9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, -1}, + {3, 4, 4, 3, 1, 2, 11, 9, 7, 4, 9, 11, 8, 3, 0, 8, 3}*/}, // 230 ---------------------------------------------------------- - {{11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1}, + {{11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 0 1 1 0 {1, 5, 11, 7, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, -1}, - {2, 4, 4, 11, 7, 4, 2, 3, 2, 4, 8, -1, -1, -1, -1, -1, -1}}, + {{7, 4, 8, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 0 1 1 1 Config 3 + {2, 3, 3, 7, 4, 8, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1} + /*{11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, -1}, + {2, 4, 4, 11, 7, 4, 2, 3, 2, 4, 8, -1, -1, -1, -1, -1, -1}*/}, - {{2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, -1}, + {{2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, -1}, // 1 1 1 0 1 0 0 0 Config 11 + /*{4, 3, 3, 3, 3, 2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9}*/ {1, 6, 2, 3, 7, 4, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, -1}, - {1, 7, 9, 10, 2, 0, 8, 7, 4,-1, -1, -1, -1, -1, -1, -1, -1}}, + {{7, 4, 8, 2, 0, 10, 9, 10, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 1 0 0 1 Config 6 + {2, 4, 3, 9, 10, 2, 0, 7, 4, 8, -1, -1, -1, -1, -1, -1, -1} + /*{9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, -1}, + {1, 7, 9, 10, 2, 0, 8, 7, 4,-1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, -1}, - {1, 7, 3, 7, 4, 0, 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1}}, + {{10, 2, 1, 4, 0, 7, 3, 7, 0, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 1 0 1 0 Config 6 + {2, 4, 3, 7, 4, 0, 3, 10, 2, 1, -1, -1, -1, -1, -1, -1} + /*{3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, -1}, + {1, 7, 3, 7, 4, 0, 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1}*/}, - {{1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 1 0 1 1 Config 4 {2, 3, 3, 1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 1 1 0 0 {1, 5, 4, 9, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, -1}, - {2, 4, 4, 8, 7, 1, 0, 4, 9, 1, 7, -1, -1, -1, -1, -1, -1}}, + {{9, 1, 0, 7, 4, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 1 1 0 1 Config 3 + {2, 3, 3, 9, 1, 0, 7, 4, 8, -1, -1, -1, -1, -1, -1, -1, -1} + /*{4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, -1}, + {2, 4, 4, 8, 7, 1, 0, 4, 9, 1, 7, -1, -1, -1, -1, -1, -1}*/}, - {{4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 1 1 1 0 Config 2 {1, 4, 3, 7, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 0 1 1 1 1 {1, 3, 4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 240 ------------------------------------------------------------ - {{9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 0 0 0 Config 8 {1, 4, 8, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 0 0 1 {1, 5, 3, 0, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 0 1 0 {1, 5, 0, 1, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 0 1 1 Config 2 {1, 4, 3, 1, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 1 0 0 {1, 5, 1, 2, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 11, 9, 1, 3, 0, 9, 11, -1, -1, -1, -1, -1,-1}}, + {{0, 9, 1, 11, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 1 0 1 Config 3 + {2, 3, 3, 0, 9, 1, 11, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1} + /*{3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 11, 9, 1, 3, 0, 9, 11, -1, -1, -1, -1, -1,-1}*/}, - {{0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 1 1 0 Config 2 {1, 4, 0, 2, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 0 1 1 1 {1, 3, 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1}, + {{2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 1 0 0 0 {1, 5, 2, 3, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 1 0 0 1 Config 2 {1, 4, 2, 0, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, // 250 ------------------------------------------------------- - {{2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, -1}, - {2, 4, 4, 2, 3, 8, 10, 1, 10, 8, 0, -1, -1, -1, -1, -1, -1}}, + {{3, 8, 0, 10, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 1 0 1 0 Config 3 + {2, 3, 3, 3, 8, 0, 10, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1} + /*{2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, -1}, + {2, 4, 4, 2, 3, 8, 10, 1, 10, 8, 0, -1, -1, -1, -1, -1, -1}*/}, - {{1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 1 0 1 1 {1, 3, 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 1 1 0 0 Config 2 {1, 4, 1, 3, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 1 1 0 1 {1, 3, 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 1 1 1 1 1 1 0 {1, 3, 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, - {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},// 1 1 1 1 1 1 1 1 {0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}} } ; -#if 0 +//#if 0 //---------------------------------------------------------------------------- // Tabella triangoli MC static int TriangleTable[256][16] = { @@ -1096,4 +1225,543 @@ static int TriangleTable[256][16] = { {0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} } ; -#endif \ No newline at end of file +//#endif + +// Vettore configurazioni: l'indice del vettore è la configurazione dei vertici, +// il valore corrispondente è la tipologia di configurazione. In questo modo si +// può velocemente risalire al tipo di configurazione + +static int nAllConfig[256] = {/* 0 */ 0, + /* 1 */ 1, + /* 2 */ 1, + /* 3 */ 2, + /* 4 */ -1, + /* 5 */ 3, + /* 6 */ 2, + /* 7 */ -1, + /* 8 */ -1, + /* 9 */ 2, + /* 10 */ 3, + /* 11 */ -1, + /* 12 */ 2, + /* 13 */ -1, + /* 14 */ -1, + /* 15 */ -1, + /* 16 */ -1, + /* 17 */ 2, + /* 18 */ 3, + /* 19 */ -1, + /* 20 */ -1, + /* 21 */ 6, + /* 22 */ 6, + /* 23 */ -1, + /* 24 */ 3, + /* 25 */ -1, + /* 26 */ 7, + /* 27 */ -1, + /* 28 */ 6, + /* 29 */ -1, + /* 30 */ -1, + /* 31 */ -1, + /* 32 */ -1, + /* 33 */ 3, + /* 34 */ 2, + /* 35 */ -1, + /* 36 */ 3, + /* 37 */ 7, + /* 38 */ -1, + /* 39 */ -1, + /* 40 */ -1, + /* 41 */ 6, + /* 42 */ 6, + /* 43 */ -1, + /* 44 */ 6, + /* 45 */ -1, + /* 46 */ -1, + /* 47 */ -1, + /* 48 */ 2, + /* 49 */ -1, + /* 50 */ -1, + /* 51 */ -1, + /* 52 */ 6, + /* 53 */ -1, + /* 54 */ -1, + /* 55 */ -1, + /* 56 */ 6, + /* 57 */ -1, + /* 58 */ -1, + /* 59 */ -1, + /* 60 */ 10, + /* 61 */ 6, + /* 62 */ 6, + /* 63 */ 2, + /* 64 */ -1, + /* 65 */ -1, + /* 66 */ 3, + /* 67 */ 6, + /* 68 */ 2, + /* 69 */ 6, + /* 70 */ -1, + /* 71 */ -1, + /* 72 */ 3, + /* 73 */ 6, + /* 74 */ 7, + /* 75 */ -1, + /* 76 */ -1, + /* 77 */ -1, + /* 78 */ -1, + /* 79 */ -1, + /* 80 */ 3, + /* 81 */ 6, + /* 82 */ 7, + /* 83 */ -1, + /* 84 */ 6, + /* 85 */ 10, + /* 86 */ -1, + /* 87 */ 6, + /* 88 */ 7, + /* 89 */ -1, + /* 90 */ -1, + /* 91 */ 7, + /* 92 */ -1, + /* 93 */ 6, + /* 94 */ 7, + /* 95 */ 3, + /* 96 */ 2, + /* 97 */ 6, + /* 98 */ -1, + /* 99 */ -1, + /* 100 */ -1, + /* 101 */ -1, + /* 102 */ -1, + /* 103 */ -1, + /* 104 */ 6, + /* 105 */ 10, + /* 106 */ -1, + /* 107 */ 6, + /* 108 */ -1, + /* 109 */ 6, + /* 110 */ -1, + /* 111 */ 2, + /* 112 */ -1, + /* 113 */ -1, + /* 114 */ -1, + /* 115 */ -1, + /* 116 */ -1, + /* 117 */ 6, + /* 118 */ -1, + /* 119 */ 2, + /* 120 */ -1, + /* 121 */ 6, + /* 122 */ 7, + /* 123 */ 3, + /* 124 */ 6, + /* 125 */ -1, + /* 126 */ 3, + /* 127 */ -1, + /* 128 */ -1, + /* 129 */ 3, + /* 130 */ -1, + /* 131 */ 6, + /* 132 */ 3, + /* 133 */ 7, + /* 134 */ 6, + /* 135 */ -1, + /* 136 */ 2, + /* 137 */ -1, + /* 138 */ 6, + /* 139 */ -1, + /* 140 */ -1, + /* 141 */ -1, + /* 142 */ -1, + /* 143 */ -1, + /* 144 */ 2, + /* 145 */ -1, + /* 146 */ 6, + /* 147 */ -1, + /* 148 */ 6, + /* 149 */ -1, + /* 150 */ 10, + /* 151 */ 6, + /* 152 */ -1, + /* 153 */ -1, + /* 154 */ -1, + /* 155 */ -1, + /* 156 */ -1, + /* 157 */ -1, + /* 158 */ 6, + /* 159 */ 2, + /* 160 */ 3, + /* 161 */ 7, + /* 162 */ 6, + /* 163 */ -1, + /* 164 */ 7, + /* 165 */ -1, + /* 166 */ -1, + /* 167 */ 7, + /* 168 */ 6, + /* 169 */ -1, + /* 170 */ 10, + /* 171 */ 6, + /* 172 */ -1, + /* 173 */ 7, + /* 174 */ 6, + /* 175 */ 3, + /* 176 */ -1, + /* 177 */ -1, + /* 178 */ -1, + /* 179 */ -1, + /* 180 */ -1, + /* 181 */ 7, + /* 182 */ 6, + /* 183 */ 3, + /* 184 */ -1, + /* 185 */ -1, + /* 186 */ 6, + /* 187 */ 2, + /* 188 */ 6, + /* 189 */ 3, + /* 190 */ -1, + /* 191 */ -1, + /* 192 */ 2, + /* 193 */ 6, + /* 194 */ 6, + /* 195 */ 10, + /* 196 */ -1, + /* 197 */ -1, + /* 198 */ -1, + /* 199 */ 6, + /* 200 */ -1, + /* 201 */ -1, + /* 202 */ -1, + /* 203 */ 6, + /* 204 */ -1, + /* 205 */ -1, + /* 206 */ -1, + /* 207 */ 2, + /* 208 */ -1, + /* 209 */ -1, + /* 210 */ -1, + /* 211 */ 6, + /* 212 */ -1, + /* 213 */ 6, + /* 214 */ 6, + /* 215 */ -1, + /* 216 */ -1, + /* 217 */ -1, + /* 218 */ 7, + /* 219 */ 3, + /* 220 */ -1, + /* 221 */ 2, + /* 222 */ 3, + /* 223 */ -1, + /* 224 */ -1, + /* 225 */ -1, + /* 226 */ -1, + /* 227 */ 6, + /* 228 */ -1, + /* 229 */ 7, + /* 230 */ -1, + /* 231 */ 3, + /* 232 */ -1, + /* 233 */ 6, + /* 234 */ 6, + /* 235 */ -1, + /* 236 */ -1, + /* 237 */ 3, + /* 238 */ 2, + /* 239 */ -1, + /* 240 */ -1, + /* 241 */ -1, + /* 242 */ -1, + /* 243 */ 2, + /* 244 */ -1, + /* 245 */ 3, + /* 246 */ 2, + /* 247 */ -1, + /* 248 */ -1, + /* 249 */ 2, + /* 250 */ 3, + /* 251 */ -1, + /* 252 */ 2, + /* 253 */ -1, + /* 254 */ -1, + /* 255 */ -1, +}; + + + + + +// Gestione dei casi in configurazione 3 + +// Matrice [indici in configurazione 3, indice del caso Plus corrispondente] + +static int nIndexVsIndex3[24][2] = { { 5, 0 }, + { 10, 3 }, + { 18, 4 }, + { 24, 8 }, + { 33, 1 }, + { 36, 6 }, + { 66, 5 }, + { 72, 9 }, + { 80, 10 }, + { 95, 12 }, + { 123, 16 }, + { 126, 21 }, + { 129, 2 }, + { 132, 7 }, + { 160, 11 }, + { 175, 13 }, + { 183, 14 }, + { 189, 18 }, + { 219, 17 }, + { 222, 22 }, + { 231, 15 }, + { 237, 19 }, + { 245, 20 }, + { 250, 23 } + } ; + + +static int Cases3Plus[24][2][12] = { +/* 5: 0, 2, */ {{ 10, 3, 2, 10, 8, 3, 10, 1, 0, 8, 10, 0 }, // 0 + { 1, 6, 0, 8, 3, 2, 10, 1, -1, -1, -1, -1 } + /*{ 2, 4, 4, 10, 8, 3, 2, 8, 10, 1, 0, -1}*/}, + +/* 33: 0, 5, */ {{ 3, 4, 8, 3, 5, 4, 3, 0, 9, 5, 3, 9 }, // 1 + { 1, 6, 0, 9, 5, 4, 8, 3, -1, -1, -1, -1 } + /*{ 2, 4, 4, 3, 5, 4, 8, 5, 3, 0, 9, -1 }*/}, + +/* 129: 0, 7, */ {{ 6, 8, 7, 6, 0, 8, 6, 11, 3, 0, 6, 3 }, // 2 + { 1, 6, 6, 11, 3, 0, 8, 7, -1, -1, -1, -1 } + /*{ 2, 4, 4, 6, 0, 8, 7, 0, 6, 11, 3, -1 }*/}, + +/* 10: 1, 3, */ {{ 11, 0, 3, 11, 9, 0, 11, 2, 1, 9, 11, 1 }, // 3 + { 1, 6, 0, 3, 11, 2, 1, 9, -1, -1, -1, -1 } + /*{ 2, 4, 4, 11, 9, 0, 3, 9, 11, 2, 1, -1}*/}, + +/* 18: 1, 4, */ {{ 7, 9, 4, 7, 1, 9, 7, 8, 0, 1, 7, 0 }, // 4 + { 1, 6, 0, 1, 9, 4, 7, 8, -1, -1, -1, -1 } + /*{ 2, 4, 4, 7, 1, 9, 4, 1, 7, 8, 0, -1}*/}, + +/* 66: 1, 6, */ {{ 6, 1, 10, 6, 0, 1, 9, 0, 6, 9, 6, 5 }, // 5 + { 1, 6, 0, 1, 10, 6, 5, 9, -1, -1, -1, -1 } + /*{ 2, 4, 4, 6, 0, 1, 10, 0, 6, 5, 9, -1}*/}, + +/* 36: 2, 5, */ {{ 4, 10, 5, 4, 2, 10, 4, 9, 1, 2, 4, 1 }, // 6 + { 1, 6, 1, 2, 10, 5, 4, 9, -1, -1, -1, -1 } + /*{ 2, 4, 4, 4, 2, 10, 5, 2, 4, 9, 1, -1 }*/}, + +/* 132: 2, 7, */ {{ 7, 2, 11, 7, 1, 2, 7, 6, 10, 1, 7, 10 }, // 7 + { 1, 6, 1, 2, 11, 7, 6, 10, -1, -1, -1, -1 } + /*{ 2, 4, 4, 7, 1, 2, 11, 1, 7, 6, 10, -1 }*/}, + +/* 24: 3, 4, */ {{ 2, 7, 11, 2, 4, 7, 2, 3, 8, 4, 2, 8 }, // 8 + { 1, 6, 2, 3, 8, 4, 7, 11, -1, -1, -1, -1 } + /*{ 2, 4, 4, 2, 4, 7, 11, 4, 2, 3, 8, -1}*/}, + +/* 72: 3, 6, */ {{ 5, 11, 6, 5, 3, 11, 5, 10, 2, 3, 5, 2 }, // 9 + { 1, 6, 2, 3, 11, 6, 5, 10, -1, -1, -1, -1 } + /*{ 2, 4, 4, 5, 3, 11, 6, 3, 5, 10, 2, -1}*/}, + +/* 80: 4, 6, */ {{ 8, 6, 7, 8, 10, 6, 8, 4, 5, 10, 8, 5 }, // 10 + { 1, 6, 4, 5, 10, 6, 7, 8, -1, -1, -1, -1 } + /*{ 2, 4, 4, 8, 10, 6, 7, 10, 8, 4, 5, -1 }*/}, + +/* 160: 5, 7, */ {{ 11, 5, 6, 11, 9, 5, 11, 7, 4, 9, 11, 4 }, // 11 + { 1, 6, 4, 9, 5, 6, 11, 7, -1, -1, -1, -1 } + /*{ 2, 4, 4, 11, 9, 5, 6, 9, 11, 7, 4, -1 }*/}, + +/* 95: 0, 1, 2, 3, 4, 6, */ {{ 6, 5, 11, 5, 9, 11, 4, 7, 11, 4, 11, 9 }, // 12 + { 1, 6, 7, 11, 6, 5, 9, 4, -1, -1, -1, -1 } + /*{ 2, 4, 4, 9, 4, 7, 11, 6, 5, 9, 11, -1}*/}, + +/* 175: 0, 1, 2, 3, 5, 7, */ {{ 7, 6, 8, 6, 10, 8, 5, 4, 8, 5, 8, 10 }, // 13 + { 1, 6, 8, 7, 6, 10, 5, 4, -1, -1, -1, -1 } + /*{ 2, 4, 4, 7, 6, 10, 8, 4, 8, 10, 5, -1}*/}, + +/* 183: 0, 1, 2, 4, 5, 7, */ {{ 6, 11, 5, 11, 3, 5, 2, 10, 5, 2, 5, 3 }, // 14 + { 1, 6, 10, 5, 6, 11, 3, 2, -1, -1, -1, -1 } + /*{ 2, 4, 4, 6, 11, 3, 5, 10, 5, 3, 2, -1}*/}, + +/* 231: 0, 1, 2, 5, 6, 7, */ {{ 11, 7, 2, 7, 4, 2, 8, 3, 2, 8, 2, 4 }, // 15 + { 1, 6, 7, 11, 4, 8, 3, 2, -1, -1, -1, -1 } + /*{ 2, 4, 4, 11, 7, 4, 2, 3, 2, 4, 8, -1}*/}, + +/* 123: 0, 1, 3, 4, 5, 6, */ {{ 11, 2, 7, 2, 1, 7, 10, 6, 7, 10, 7, 1 }, // 16 + { 1, 6, 10, 6, 7, 11, 2, 1, -1, -1, -1, -1 } + /*{ 2, 4, 4, 11, 2, 1, 7, 1, 10, 6, 7, -1}*/}, + +/* 219: 0, 1, 3, 4, 6, 7, */ {{ 5, 10, 4, 10, 2, 4, 1, 9, 4, 1, 4, 2 }, // 17 + { 1, 6, 9, 4, 5, 10, 2, 1, -1, -1, -1, -1 } + /*{ 2, 4, 4, 2, 4, 5, 10, 4, 2, 1, 9, -1}*/}, + +/* 189: 0, 2, 3, 4, 5, 7, */ {{ 10, 1, 6, 1, 0, 6, 6, 0, 9, 5, 6, 9 }, // 18 + { 1, 6, 9, 5, 6, 10, 1, 0, -1, -1, -1, -1 } + /*{ 2, 4, 4, 5, 6, 0, 9, 10, 1, 0, 6, -1}*/}, + +/* 237: 0, 2, 3, 5, 6, 7, */ {{ 4, 9, 7, 9, 1, 7, 0, 8, 7, 0, 7, 1 }, // 19 + { 1, 6, 8, 7, 4, 9, 1, 0, -1, -1, -1, -1 } + /*{ 2, 4, 4, 8, 7, 1, 0, 4, 9, 1, 7, -1}*/}, + +/* 245: 0, 2, 4, 5, 6, 7, */ {{ 3, 0, 11, 0, 9, 11, 1, 2, 11, 1, 11, 9 }, // 20 + { 1, 6, 9, 1, 2, 11, 3, 0, -1, -1, -1, -1 } + /*{ 2, 4, 4, 2, 11, 9, 1, 3, 0, 9, 11, -1}*/}, + +/* 126: 1, 2, 3, 4, 5, 6, */ {{ 7, 8, 6, 8, 0, 6, 3, 11, 6, 3, 6, 0 }, // 21 + { 1, 6, 0, 3, 11, 6, 7, 8, -1, -1, -1, -1 } + /*{ 2, 4, 4, 0, 3, 11, 6, 7, 8, 0, 6, -1}*/}, + +/* 222: 1, 2, 3, 4, 6, 7, */ {{ 8, 4, 3, 4, 5, 3, 9, 0, 3, 9, 3, 5 }, // 22 + { 1, 6, 3, 8, 4, 5, 9, 0, -1, -1, -1, -1 } + /*{ 2, 4, 4, 0, 3, 5, 9, 8, 4, 5, 3, -1}*/}, + +/* 250: 1, 3, 4, 5, 6, 7, */ {{ 2, 3, 10, 3, 8, 10, 0, 1, 10, 0, 10, 8 }, // 23 + { 1, 6, 1, 10, 2, 3, 8, 0, -1, -1, -1, -1 } + /*{ 2, 4, 4, 2, 3, 8, 10, 1, 10, 8, 0, -1}*/}, +}; + + +// Gestione dei casi in configurazione 6 + +// Matrice [indici in configurazione 6, indice del caso Plus corrispondente] + +static int nIndexVsIndex6[48][2] = { { 21 , 2 }, + { 22 , 9 }, + { 28 , 16 }, + { 41 , 4 }, + { 42 , 11 }, + { 44 , 17 }, + { 52 , 18 }, + { 56 , 21 }, + { 61 , 32 }, + { 62 , 39 }, + { 67 , 0 }, + { 69 , 3 }, + { 73 , 5 }, + { 81 , 6 }, + { 84 , 19 }, + { 87 , 24 }, + { 93 , 33 }, + { 97 , 7 }, + { 104, 22 }, + { 107, 27 }, + { 109, 34 }, + { 117, 35 }, + { 121, 37 }, + { 124, 46 }, + { 131, 1 }, + { 134, 10 }, + { 138, 12 }, + { 146, 13 }, + { 148, 20 }, + { 151, 25 }, + { 158, 40 }, + { 162, 14 }, + { 168, 23 }, + { 171, 28 }, + { 174, 41 }, + { 182, 42 }, + { 186, 44 }, + { 188, 47 }, + { 193, 8 }, + { 194, 15 }, + { 199, 26 }, + { 203, 29 }, + { 211, 30 }, + { 213, 36 }, + { 214, 43 }, + { 227, 31 }, + { 233, 38 }, + { 234, 45 }, + } ; + + +static int Cases6Plus[48][15] = { +/* 67: 0, 1, 6, */ { 1, 10, 3, 6, 3, 10, 3, 6, 8, 5, 8, 6, 8, 5, 9 },// 0 +/* 131: 0, 1, 7, */ { 1, 11, 3, 11, 1, 6, 9, 6, 1, 6, 9, 7, 8, 7, 9 },// 1 +/* 21: 0, 2, 4, */ { 4, 1, 0, 1, 4, 10, 7, 10, 4, 10, 7, 2, 3, 2, 7 },// 2 +/* 69: 0, 2, 6, */ { 6, 3, 2, 3, 6, 8, 5, 8, 6, 8, 5, 0, 1, 0, 5 },// 3 +/* 41: 0, 3, 5, */ { 0, 9, 2, 5, 2, 9, 2, 5, 11, 4, 11, 5, 11, 4, 8 },// 4 +/* 73: 0, 3, 6, */ { 0, 10, 2, 10, 0, 5, 8, 5, 0, 5, 8, 6, 11, 6, 8 },// 5 +/* 81: 0, 4, 6, */ { 4, 5, 0, 10, 0, 5, 0, 10, 3, 6, 3, 10, 3, 6, 7 },// 6 +/* 97: 0, 5, 6, */ { 4, 8, 6, 3, 6, 8, 6, 3, 10, 0, 10, 3, 10, 0, 9 },// 7 +/* 193: 0, 6, 7, */ { 5, 8, 7, 8, 5, 0, 10, 0, 5, 0, 10, 3, 11, 3, 10 },// 8 +/* 22: 1, 2, 4, */ { 2, 8, 0, 8, 2, 7, 10, 7, 2, 7, 10, 4, 9, 4, 10 },// 9 +/* 134: 1, 2, 7, */ { 2, 11, 0, 7, 0, 11, 0, 7, 9, 6, 9, 7, 9, 6, 10 },// 10 +/* 42: 1, 3, 5, */ { 5, 2, 1, 2, 5, 11, 4, 11, 5, 11, 4, 3, 0, 3, 4 },// 11 +/* 138: 1, 3, 7, */ { 7, 0, 3, 0, 7, 9, 6, 9, 7, 9, 6, 1, 2, 1, 6 },// 12 +/* 146: 1, 4, 7, */ { 6, 9, 4, 9, 6, 1, 11, 1, 6, 1, 11, 0, 8, 0, 11 },// 13 +/* 162: 1, 5, 7, */ { 5, 6, 1, 11, 1, 6, 1, 11, 0, 7, 0, 11, 0, 7, 4 },// 14 +/* 194: 1, 6, 7, */ { 5, 9, 7, 0, 7, 9, 7, 0, 11, 1, 11, 0, 11, 1, 10 },// 15 +/* 28: 2, 3, 4, */ { 3, 8, 1, 4, 1, 8, 1, 4, 10, 7, 10, 4, 10, 7, 11 },// 16 +/* 44: 2, 3, 5, */ { 3, 9, 1, 9, 3, 4, 11, 4, 3, 4, 11, 5, 10, 5, 11 },// 17 +/* 52: 2, 4, 5, */ { 7, 10, 5, 10, 7, 2, 8, 2, 7, 2, 8, 1, 9, 1, 8 },// 18 +/* 84: 2, 4, 6, */ { 6, 7, 2, 8, 2, 7, 2, 8, 1, 4, 1, 8, 1, 4, 5 },// 19 +/* 148: 2, 4, 7, */ { 6, 10, 4, 1, 4, 10, 4, 1, 8, 2, 8, 1, 8, 2, 11 },// 20 +/* 56: 3, 4, 5, */ { 7, 11, 5, 2, 5, 11, 5, 2, 9, 3, 9, 2, 9, 3, 8 },// 21 +/* 104: 3, 5, 6, */ { 4, 11, 6, 11, 4, 3, 9, 3, 4, 3, 9, 2, 10, 2, 9 },// 22 +/* 168: 3, 5, 7, */ { 7, 4, 3, 9, 3, 4, 3, 9, 2, 5, 2, 9, 2, 5, 6 },// 23 +/* 87: 0, 1, 2, 4, 6, */ { 3, 4, 7, 4, 3, 9, 2, 9, 3, 9, 2, 5, 6, 5, 2 },// 24 +/* 151: 0, 1, 2, 4, 7, */ { 6, 11, 4, 3, 4, 11, 4, 3, 9, 2, 9, 3, 9, 2, 10 },// 25 +/* 199: 0, 1, 2, 6, 7, */ { 5, 11, 7, 11, 5, 2, 9, 2, 5, 2, 9, 3, 8, 3, 9 },// 26 +/* 107: 0, 1, 3, 5, 6, */ { 4, 10, 6, 10, 4, 1, 8, 1, 4, 1, 8, 2, 11, 2, 8 },// 27 +/* 171: 0, 1, 3, 5, 7, */ { 2, 7, 6, 7, 2, 8, 1, 8, 2, 8, 1, 4, 5, 4, 1 },// 28 +/* 203: 0, 1, 3, 6, 7, */ { 5, 10, 7, 2, 7, 10, 7, 2, 8, 1, 8, 2, 8, 1, 9 },// 29 +/* 211: 0, 1, 4, 6, 7, */ { 1, 9, 3, 4, 3, 9, 3, 4, 11, 5, 11, 4, 11, 5, 10 },// 30 +/* 227: 0, 1, 5, 6, 7, */ { 1, 8, 3, 8, 1, 4, 10, 4, 1, 4, 10, 7, 11, 7, 10 },// 31 +/* 61: 0, 2, 3, 4, 5, */ { 7, 9, 5, 9, 7, 0, 11, 0, 7, 0, 11, 1, 10, 1, 11 },// 32 +/* 93: 0, 2, 3, 4, 6, */ { 1, 6, 5, 6, 1, 11, 0, 11, 1, 11, 0, 7, 4, 7, 0 },// 33 +/* 109: 0, 2, 3, 5, 6, */ { 4, 9, 6, 1, 6, 9, 6, 1, 11, 0, 11, 1, 11, 0, 8 },// 34 +/* 117: 0, 2, 4, 5, 6, */ { 3, 0, 7, 9, 7, 0, 7, 9, 6, 1, 6, 9, 6, 1, 2 },// 35 +/* 213: 0, 2, 4, 6, 7, */ { 1, 2, 5, 11, 5, 2, 5, 11, 4, 3, 4, 11, 4, 3, 0 },// 36 +/* 121: 0, 3, 4, 5, 6, */ { 0, 11, 2, 11, 0, 7, 9, 7, 0, 7, 9, 6, 10, 6, 9 },// 37 +/* 233: 0, 3, 5, 6, 7, */ { 0, 8, 2, 7, 2, 8, 2, 7, 10, 4, 10, 7, 10, 4, 9 },// 38 +/* 62: 1, 2, 3, 4, 5, */ { 7, 8, 5, 0, 5, 8, 5, 0, 10, 3, 10, 0, 10, 3, 11 },// 39 +/* 158: 1, 2, 3, 4, 7, */ { 6, 8, 4, 8, 6, 3, 10, 3, 6, 3, 10, 0, 9, 0, 10 },// 40 +/* 174: 1, 2, 3, 5, 7, */ { 0, 5, 4, 5, 0, 10, 3, 10, 0, 10, 3, 6, 7, 6, 3 },// 41 +/* 182: 1, 2, 4, 5, 7, */ { 2, 10, 0, 5, 0, 10, 0, 5, 8, 6, 8, 5, 8, 6, 11 },// 42 +/* 214: 1, 2, 4, 6, 7, */ { 2, 9, 0, 9, 2, 5, 11, 5, 2, 5, 11, 4, 8, 4, 11 },// 43 +/* 186: 1, 3, 4, 5, 7, */ { 2, 3, 6, 8, 6, 3, 6, 8, 5, 0, 5, 8, 5, 0, 1 },// 44 +/* 234: 1, 3, 5, 6, 7, */ { 0, 1, 4, 10, 4, 1, 4, 10, 7, 2, 7, 10, 7, 2, 3 },// 45 +/* 124: 2, 3, 4, 5, 6, */ { 3, 11, 1, 6, 1, 11, 1, 6, 9, 7, 9, 6, 9, 7, 8 },// 46 +/* 188: 2, 3, 4, 5, 7, */ { 3, 10, 1, 10, 3, 6, 8, 6, 3, 6, 8, 5, 9, 5, 8 } // 47 +}; + + + + + +// Gestione dei casi in configurazione 10 + +// Matrice [indici in configurazione 10, indice del caso Plus corrispondente] + +static int nIndexVsIndex10[6][2] = { { 60 , 5 }, + { 85 , 1 }, + { 105 , 2 }, + { 150 , 3 }, + { 170 , 4 }, + { 195 , 0 } + } ; + + +static int Cases10Plus[6][2][12] = { +/* 195: 0, 1, 6, 7, */ {{ 7, 5, 9, 9, 8, 7, 1, 0, 11, 11, 3, 1 },// 0 + { 2, 4, 4, 7, 5, 9, 8, 1, 10, 11, 3, -1}}, + +/* 85: 0, 2, 4, 6, */ {{ 0, 4, 1, 4, 5, 1, 3, 2, 6, 3, 6, 7 },// 1 + { 2, 4, 4, 0, 4, 5, 1, 3, 2, 6, 7, -1 }}, + +/* 105: 0, 3, 5, 6, */ {{ 0, 9, 2, 2, 9, 10, 8, 11, 4, 4, 11, 6 },// 2 + { 2, 4, 4, 0, 9, 10, 2, 8, 11, 6, 4, -1 }}, + +/* 150: 1, 2, 4, 7, */ {{ 0, 2, 8, 8, 2, 11, 4, 10, 9, 4, 6, 10 },// 3 + { 2, 4, 4, 0, 2, 11, 8, 9, 4, 6, 10, -1}}, + +/* 170: 1, 3, 5, 7, */ {{ 0, 7, 4, 0, 3, 7, 1, 5, 6, 6, 2, 1 },// 4 + { 2, 4, 4, 0, 3, 7, 4, 1, 5, 6, 2, -1}}, + +/* 60: 2, 3, 4, 5, */ {{ 9, 1, 3, 3, 8, 9, 10, 5, 11, 11, 5, 7 },// 5 + { 2, 4, 4, 1, 3, 8, 9, 5, 7, 11, 10, -1 }} +}; \ No newline at end of file diff --git a/VolTriZmapGraphics.cpp b/VolTriZmapGraphics.cpp index 20c4e0a..75ef4c8 100644 --- a/VolTriZmapGraphics.cpp +++ b/VolTriZmapGraphics.cpp @@ -47,70 +47,78 @@ static int NeighbourTable[8][4] = { } ; // ------------------------- FUNZIONE TEST SULLE NORMALI -------------------------------------------------------------------------- -enum FatureType { NoFeature = 0, Corner = 1, Edge = 2} ; +enum FatureType { NO_FEATURE = 0, CORNER = 1, EDGE = 2} ; //---------------------------------------------------------------------------- -bool -TestOnNormal( const VectorField CompoVert[], int nCompoElem, int& FeatureType, Vector3d& vtFeature, int& nMin1, int& nMin2) +int +TestOnNormal( const VectorField CompoVert[], int nCompoElem) { + // Cerco la massima deviazione tra le normali nei punti della parte connessa int nI, nJ ; - double dMinCosTheta = 1.001 ; - const double dCosThetaSharp = 0.8; - + double dMinCosTheta = 2 ; for ( int i = 0 ; i < nCompoElem ; ++ i) { - for ( int j = i + 1 ; j < nCompoElem ; ++ j) { - - double dCurrentCos = CompoVert[i].vtNorm * CompoVert[j].vtNorm ; - - if ( dCurrentCos < dMinCosTheta) { - + double dCurrCos = CompoVert[i].vtNorm * CompoVert[j].vtNorm ; + if ( dCurrCos < dMinCosTheta) { + dMinCosTheta = dCurrCos ; nI = i ; nJ = j ; - dMinCosTheta = dCurrentCos ; } } } - - if ( dMinCosTheta >= dCosThetaSharp) { - - FeatureType = NoFeature ; - return false ; - } + + // Se la massima deviazione non supera il limite non è feature + const double SHARP_COS = 0.9 ; // 0.8 ; + if ( dMinCosTheta >= SHARP_COS) + return NO_FEATURE ; + // Verifico se Edge o Corner + // direzione perpendicolare alle normali con massima differenza (potenziale edge) Vector3d vtK = CompoVert[nI].vtNorm ^ CompoVert[nJ].vtNorm ; - double dDotTest1 = CompoVert[nI].vtNorm * vtK ; - double dDotTest2 = CompoVert[nJ].vtNorm * vtK ; - - nMin1 = nI ; - nMin2 = nJ ; - - const double dCosPhiCorner = 0.5 ; + // cerco normale con massima vicinanza al potenziale edge double dMaxAbsCos = 0 ; - for ( int i = 0 ; i < nCompoElem ; ++ i) { - double dAbsCurrentCos = abs( CompoVert[i].vtNorm * vtK) ; - if ( dAbsCurrentCos > dMaxAbsCos) - dMaxAbsCos = dAbsCurrentCos ; } - - if ( dMaxAbsCos > dCosPhiCorner) - - FeatureType = Corner ; - + // se esiste normale diretta quasi come potenziale edge, allora corner + const double CORNER_COS = 0.7 ; // 0.7 ; // 0.5 ; + if ( dMaxAbsCos > CORNER_COS) + return CORNER ; else + return EDGE ; +} + +//---------------------------------------------------------------------------- +bool +DotTest( const VectorField CompoVert[], int nCompoElem, Vector3d& vtAvg, double dThreshold = 0) +{ + // Cerco la massima deviazione tra le normali nei punti della parte connessa + double dMinCosTheta = 2 ; + for ( int i = 0 ; i < nCompoElem ; ++ i) { + for ( int j = i + 1 ; j < nCompoElem ; ++ j) { + double dCurrCos = CompoVert[i].vtNorm * CompoVert[j].vtNorm ; + if ( dCurrCos < dMinCosTheta) { + dMinCosTheta = dCurrCos ; + } + } + } - FeatureType = Edge ; - - vtFeature = vtK ; - + // se normali sparpagliate oltre limite + if ( dMinCosTheta < dThreshold) + return false ; + + // determino media delle normali + vtAvg = V_NULL ; + for ( int i = 0 ; i < nCompoElem ; ++ i) + vtAvg += CompoVert[i].vtNorm ; + vtAvg /= nCompoElem ; + return true ; } - + // ------------------------- VISUALIZZAZIONE -------------------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -303,7 +311,7 @@ VolZmap::GetTriangles( bool bAllBlocks, INTVECTOR& nModifiedBlocks, TRIA3DLISTVE m_InterBlockTria[t].clear() ; #if 1 ExtMarchingCubes( int( t), vLstTria.back(), VecTriHold[t]) ; - // Flipping fra voxel interni + // Flipping fra voxel interni FlipEdgesII( VecTriHold[t]) ; bCalcInterBlock = true ; #else @@ -688,7 +696,7 @@ VolZmap::MarchingCubes( int nBlock, TRIA3DLIST& lstTria) const //---------------------------------------------------------------------------- bool VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) const -{ +{ if ( nBlock < 0 || nBlock >= int( m_nNumBlock)) return false ; @@ -704,7 +712,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) for ( int i = nLimits[0] ; i < nLimits[1] ; ++ i) { for ( int j = nLimits[2] ; j < nLimits[3] ; ++ j) { for ( int k = nLimits[4] ; k < nLimits[5] ; ++ k) { - + // Riconoscimento dei voxel di frontiera int nVoxIndexes[3] = { i, j, k} ; bool bBoundary = IsAVoxelOnBoundary( nLimits, nVoxIndexes, true) ; @@ -738,7 +746,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) if ( IsThereMat( i + 1, j + 1, k + 1)) nIndex |= ( 1 << 6) ; if ( IsThereMat( i, j + 1, k + 1)) - nIndex |= ( 1 << 7) ; + nIndex |= ( 1 << 7) ; // Se vi è qualche intersezione fra segmenti e superficie // continuo altrimenti passo al prossimo voxel. @@ -750,10 +758,9 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) { 7, 6 }, { 4, 7 }, { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 } } ; - // Arrey di strutture punto di intersezione - // e normale alla superficie in esso. + // Array di strutture punto di intersezione e normale alla superficie in esso. VectorField VecField[12] ; - + // Flag sulla regolatrità dei campi scalare e vettoriale: // se i campi sono regolari esso resta vero, altrimenti // assume il valore falso. @@ -775,7 +782,6 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) if ( ! IntersPos( IndexCorner[n1], IndexCorner[n2], bN1, VecField[EdgeIndex].ptInt, VecField[EdgeIndex].vtNorm)) - bReg = false ; // Riporto punti e normali nel sistema locale in cui @@ -785,88 +791,282 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) } // Determino il numero di componenti connesse nel voxel + // in caso di configurazione standard. int nComponents = TriangleTableEn[nIndex][1][0] ; - // Serve nel ciclo che salva i punti e vettori di - // una componente nell'arrey di compentenza: La tabella - // fornisce numero di componenti, numero di vertici per - // componenti per OGNUNA delle componenti e in fine - // elenca i vertici della prima componente, seguiti da quelli - // della seconda e così via. - int nTableOffset = nComponents ; + // Matrici di campi vettoriali: + // CompoVert[i] ha i vertici della base del triangle fan + // della (i+1)-esima componente connessa; + // CompoTriVert[i] ha i vertici di tutti i triangoli, nel + // nel caso di assenza di sharp feature, della (i+1)-esima + // componente connessa. + VectorField CompoVert[6][12] ; + VectorField CompoTriVert[6][17] ; - // Numero di feature nel voxel: al più vi è - // una feature per componente connessa. + // Arrey numero di vertici della base del fan per componente + // connessa: nVertComp[i] contiene il numero di vertici + // della base del fan della (i+1)-esima componente connessa. + int nVertComp[6] ; + + // Matrice di indici dei punti: serve per + // la gestione del caso + int nIndArrey[6][4] ; + + int nExtTabOff = nComponents ; + int nStdTabOff = 0 ; + + // Carico le matrici CompoVert e CompoTriVert + for ( int nCompCount = 1 ; nCompCount <= nComponents ; ++ nCompCount) { + + // Numero vertici per componenti + nVertComp[nCompCount - 1] = TriangleTableEn[nIndex][1][nCompCount] ; + + // Riempio il nCompCount-esimo vettore di vertici della base del fan + for ( int nVertCount = 0 ; nVertCount < nVertComp[nCompCount - 1] ; ++ nVertCount) + + CompoVert[nCompCount - 1][nVertCount] = VecField[TriangleTableEn[nIndex][1][nVertCount + nExtTabOff + 1]] ; + + // Serve per la gestione del caso ... + if ( nVertComp[nCompCount - 1] == 4) { + + for ( int nVertCount = 0 ; nVertCount < nVertComp[nCompCount - 1] ; ++ nVertCount) + + nIndArrey[nCompCount - 1][nVertCount] = TriangleTableEn[nIndex][1][nVertCount + nExtTabOff + 1] ; + } + + + // Riempio il nCompCount-esimo vettore di vertici dei triangoli in assenza di + // sharp feature: in una mesh di triangoli con n vertici vi sono n - 2 triangoli. + for ( int nVertCount = 0 ; nVertCount < 3 * ( nVertComp[nCompCount - 1] - 2) ; nVertCount += 3) { + + CompoTriVert[nCompCount - 1][nVertCount] = VecField[TriangleTableEn[nIndex][0][nStdTabOff + nVertCount+2]] ; + CompoTriVert[nCompCount - 1][nVertCount+1] = VecField[TriangleTableEn[nIndex][0][nStdTabOff + nVertCount+1]] ; + CompoTriVert[nCompCount - 1][nVertCount+2] = VecField[TriangleTableEn[nIndex][0][nStdTabOff + nVertCount]] ; + } + + // Aggiorno gli offsets per raggiungere i + // vertici della componente successiva. + nExtTabOff += nVertComp[nCompCount - 1] ; + nStdTabOff += 3 * ( nVertComp[nCompCount - 1] - 2) ; + } + + // Test sulla topologia + if ( nAllConfig[nIndex] == 3) { + + Vector3d vtCmpAvg0, vtCmpAvg1 ; + + // Verifico se i versori delle componenti sono tutti + // più o meno concordi (per esserlo non devono esserci + // due vettori di una medesima componente con prodotto + // scalare inferiore a 0.7). + bool bTest0 = DotTest( CompoVert[0], 3, vtCmpAvg0, 0.7) ; + bool bTest1 = DotTest( CompoVert[1], 3, vtCmpAvg1, 0.7) ; + + // Se i versori di entrambe le componenti sono concordi + // ha senso parlare di vettori medi, altrimenti non ha + // senso. Se non ha senso parlare di vettori medi non + // ha senso parlare di prodotti scalari fra loro, + // quindi pongo il loro prodotto a un valore assurdo -2 + // (il prodotto scalare fra versori ha modulo non superiore + // a uno). + double dScProd = - 2 ; + + if ( bTest0 && bTest1) + dScProd = vtCmpAvg0 * vtCmpAvg1 ; + + double dThreshold = 0.7 ; + + if ( ( ! ( bTest0 && bTest1)) || ( bTest0 && bTest1 && dScProd > dThreshold)) { + + int nt = 0 ; + + while ( nIndexVsIndex3[nt][0] != nIndex) + ++ nt ; + + int nRotCase = nIndexVsIndex3[nt][1] ; + + nComponents = Cases3Plus[nRotCase][1][0] ; + + // Riaggiorno gli offsets + nExtTabOff = nComponents ; + nStdTabOff = 0 ; + + // Modifico le matrici + for ( int nC = 1 ; nC <= nComponents ; ++ nC) { + + // Numero vertici per componenti + nVertComp[nC - 1] = Cases3Plus[nRotCase][1][nC] ; + + // Matrice dei vertici della base del fan + for ( int nFanVert = 0 ; nFanVert < nVertComp[nC - 1] ; ++ nFanVert) + + CompoVert[nC - 1][nFanVert] = VecField[Cases3Plus[nRotCase][1][nFanVert + nExtTabOff + 1]] ; + + // Matrici dei vertici dei triangoli in assenza di sharp feature + for ( int nTriVert = 0 ; nTriVert < 3 * ( nVertComp[nC - 1] - 2) ; nTriVert += 3) { + + CompoTriVert[nC - 1][nTriVert] = VecField[Cases3Plus[nRotCase][0][nStdTabOff + nTriVert+2]] ; + CompoTriVert[nC - 1][nTriVert+1] = VecField[Cases3Plus[nRotCase][0][nStdTabOff + nTriVert+1]] ; + CompoTriVert[nC - 1][nTriVert+2] = VecField[Cases3Plus[nRotCase][0][nStdTabOff + nTriVert]] ; + } + + // Aggiorno gli offsets per raggiungere i + // vertici della componente successiva. + nExtTabOff += nVertComp[nC - 1] ; + nStdTabOff += 3 * ( nVertComp[nC - 1] - 2) ; + } + + + } + } + else if ( nAllConfig[nIndex] == 6) { + + // Procedura analoga a quella della configurazione 3 + Vector3d vtCmpAvg0, vtCmpAvg1 ; + + bool bTest0 = DotTest( CompoVert[0], 4, vtCmpAvg0, 0.7) ; + bool bTest1 = DotTest( CompoVert[1], 3, vtCmpAvg1, 0.7) ; + + double dScProd = - 2 ; + + if ( bTest0 && bTest1) + dScProd = vtCmpAvg0 * vtCmpAvg1 ; + + double dThreshold = 0.7 ; + + if ( ( ! ( bTest0 && bTest1)) || ( bTest0 && bTest1 && dScProd > dThreshold)) { + + int nt = 0 ; + + while ( nIndexVsIndex6[nt][0] != nIndex) + ++ nt ; + + int nRotCase = nIndexVsIndex6[nt][1] ; + + + // Costruzione dei triangoli + for ( int TriIndex = 0 ; TriIndex < 15 ; TriIndex += 3) { + + // Costruzione triangolo + int i0 = Cases6Plus[nRotCase][TriIndex + 2] ; + int i1 = Cases6Plus[nRotCase][TriIndex + 1] ; + int i2 = Cases6Plus[nRotCase][TriIndex] ; + + Triangle3d CurrentTriangle ; + + // Il triangolo è pronto + CurrentTriangle.Set( VecField[i0].ptInt, VecField[i1].ptInt, VecField[i2].ptInt) ; + bool bV = CurrentTriangle.Validate( true) ; + + // Aggiungo alla lista + lstTria.emplace_back( CurrentTriangle) ; + } + continue ; + } + } + else if ( nAllConfig[nIndex] == 10) { + + Vector3d vtCmpAvg0, vtCmpAvg1 ; + + // Verifico se i versori delle componenti sono tutti + // più o meno concordi (per esserlo non devono esserci + // due vettori di una medesima componente con prodotto + // scalare inferiore a 0). decidere se 0.0 o 0.7 + bool bTest0 = DotTest( CompoVert[0], 4, vtCmpAvg0) ; + bool bTest1 = DotTest( CompoVert[1], 4, vtCmpAvg1) ; + + if ( ! ( bTest0 && bTest1)) { + + int nt = 0 ; + + while ( nIndexVsIndex10[nt][0] != nIndex) + ++ nt ; + + int nRotCase = nIndexVsIndex10[nt][1] ; + + // Riaggiorno gli offsets + nExtTabOff = 2 ; + nStdTabOff = 0 ; + + // Modifico le matrici + for ( int nC = 1 ; nC <= 2 ; ++ nC) { + + // Numero vertici per componenti + nVertComp[nC - 1] = Cases10Plus[nRotCase][1][nC] ; + + // Matrice dei vertici della base del fan + for ( int nFanVert = 0 ; nFanVert < 4 ; ++ nFanVert) + + CompoVert[nC - 1][nFanVert] = VecField[Cases10Plus[nRotCase][1][nFanVert + nExtTabOff + 1]] ; + + // Matrici dei vertici dei triangoli in assenza di sharp feature + for ( int nTriVert = 0 ; nTriVert < 6 ; nTriVert += 3) { + + CompoTriVert[nC - 1][nTriVert] = VecField[Cases10Plus[nRotCase][0][nStdTabOff + nTriVert+2]] ; + CompoTriVert[nC - 1][nTriVert+1] = VecField[Cases10Plus[nRotCase][0][nStdTabOff + nTriVert+1]] ; + CompoTriVert[nC - 1][nTriVert+2] = VecField[Cases10Plus[nRotCase][0][nStdTabOff + nTriVert]] ; + } + + // Aggiorno gli offsets per raggiungere i + // vertici della componente successiva. + nExtTabOff += nVertComp[nC - 1] ; + nStdTabOff += 3 * ( nVertComp[nC - 1] - 2) ; + } + } + } + + + // Numero di feature nel voxel: al più vi è una feature per componente connessa. int nInnerFeatureInVoxel = 0 ; int nBorderFeatureInVoxel = 0 ; // Ciclo sulle componenti for ( int nCompCount = 1 ; nCompCount <= nComponents ; ++ nCompCount) { - - // Numero vertici per componenti - int nVertComp = TriangleTableEn[nIndex][1][nCompCount] ; - - // Vettore di Vector3d - VectorField CompoVert[12] ; - - // Riempio il vettore - for ( int nVertCount = 0 ; nVertCount < nVertComp ; ++ nVertCount) - // Nota che il primo elemento dell'array (0-esimo) non viene inizializzato - CompoVert[nVertCount] = VecField[TriangleTableEn[nIndex][1][nVertCount + nTableOffset + 1]] ; - - int nFeatureType ; - - // Valuto le relazioni reciproche fra le normali e - // se i punti sono su un piano di griglia. - Vector3d vtFeatureAxis ; - bool bNormal = false ; - - // Indici dei punti ove le normali - // formano il massimo angolo - int nMin1, nMin2 ; - - // Se i campi sono regolari valuto le normali - // per stabilire se eseguire ExtMC o MC, - // altrimenti eseguo MC. + + int nFeatureType = NO_FEATURE ; + // Se i componenti sono regolari valuto le normali per stabilire se eseguire ExtMC o MC if ( bReg) - - bNormal = TestOnNormal( CompoVert, nVertComp, nFeatureType, vtFeatureAxis, nMin1, nMin2) ; + nFeatureType = TestOnNormal( CompoVert[nCompCount - 1], nVertComp[nCompCount - 1]) ; // Controllo per il caso piano su una griglia // con versori normali a due a due paralleli. bool bGridControl = true ; - if ( bNormal) { + if ( nFeatureType != NO_FEATURE) { - if ( nVertComp == 4) { - - int nIndArrey[4] ; - // Riempio un vettore con gli indici dei punti - for ( int nCpInd = 0 ; nCpInd < nVertComp ; ++ nCpInd) - nIndArrey[nCpInd] = TriangleTableEn[nIndex][1][nCpInd + nTableOffset + 1] ; + if ( nVertComp[nCompCount - 1] == 4) { + // Ordino i 4 indici in senso crescente - for ( int nSrtInd1 = 0 ; nSrtInd1 < nVertComp - 1 ; ++ nSrtInd1) { - for ( int nSrtInd2 = nSrtInd1 + 1 ; nSrtInd2 < nVertComp ; ++ nSrtInd2) { - if ( nIndArrey[nSrtInd1] > nIndArrey[nSrtInd2]) - swap( nIndArrey[nSrtInd1], nIndArrey[nSrtInd2]) ; + for ( int nSrtInd1 = 0 ; nSrtInd1 < nVertComp[nCompCount - 1] - 1 ; ++ nSrtInd1) { + for ( int nSrtInd2 = nSrtInd1 + 1 ; nSrtInd2 < nVertComp[nCompCount - 1] ; ++ nSrtInd2) { + if ( nIndArrey[nCompCount - 1][nSrtInd1] > nIndArrey[nCompCount - 1][nSrtInd2]) + swap( nIndArrey[nCompCount - 1][nSrtInd1], nIndArrey[nCompCount - 1][nSrtInd2]) ; } } - if ( ( nIndArrey[0] == 0 && nIndArrey[1] == 2 && nIndArrey[2] == 9 && nIndArrey[3] == 10) || - ( nIndArrey[0] == 4 && nIndArrey[1] == 6 && nIndArrey[2] == 9 && nIndArrey[3] == 10) || - ( nIndArrey[0] == 4 && nIndArrey[1] == 6 && nIndArrey[2] == 8 && nIndArrey[3] == 11) || - ( nIndArrey[0] == 0 && nIndArrey[1] == 2 && nIndArrey[2] == 8 && nIndArrey[3] == 11) || - ( nIndArrey[0] == 1 && nIndArrey[1] == 3 && nIndArrey[2] == 8 && nIndArrey[3] == 9 ) || - ( nIndArrey[0] == 1 && nIndArrey[1] == 3 && nIndArrey[2] == 10 && nIndArrey[3] == 11) || - ( nIndArrey[0] == 5 && nIndArrey[1] == 7 && nIndArrey[2] == 10 && nIndArrey[3] == 11) || - ( nIndArrey[0] == 5 && nIndArrey[1] == 7 && nIndArrey[2] == 8 && nIndArrey[3] == 9 )) { + if ( ( nIndArrey[nCompCount - 1][0] == 0 && nIndArrey[nCompCount - 1][1] == 2 && + nIndArrey[nCompCount - 1][2] == 9 && nIndArrey[nCompCount - 1][3] == 10) || + ( nIndArrey[nCompCount - 1][0] == 4 && nIndArrey[nCompCount - 1][1] == 6 && + nIndArrey[nCompCount - 1][2] == 9 && nIndArrey[nCompCount - 1][3] == 10) || + ( nIndArrey[nCompCount - 1][0] == 4 && nIndArrey[nCompCount - 1][1] == 6 && + nIndArrey[nCompCount - 1][2] == 8 && nIndArrey[nCompCount - 1][3] == 11) || + ( nIndArrey[nCompCount - 1][0] == 0 && nIndArrey[nCompCount - 1][1] == 2 && + nIndArrey[nCompCount - 1][2] == 8 && nIndArrey[nCompCount - 1][3] == 11) || + ( nIndArrey[nCompCount - 1][0] == 1 && nIndArrey[nCompCount - 1][1] == 3 && + nIndArrey[nCompCount - 1][2] == 8 && nIndArrey[nCompCount - 1][3] == 9 ) || + ( nIndArrey[nCompCount - 1][0] == 1 && nIndArrey[nCompCount - 1][1] == 3 && + nIndArrey[nCompCount - 1][2] == 10 && nIndArrey[nCompCount - 1][3] == 11) || + ( nIndArrey[nCompCount - 1][0] == 5 && nIndArrey[nCompCount - 1][1] == 7 && + nIndArrey[nCompCount - 1][2] == 10 && nIndArrey[nCompCount - 1][3] == 11) || + ( nIndArrey[nCompCount - 1][0] == 5 && nIndArrey[nCompCount - 1][1] == 7 && + nIndArrey[nCompCount - 1][2] == 8 && nIndArrey[nCompCount - 1][3] == 9 )) { VectorField LocVecF[12], LocCompV[12] ; for ( int LocInd = 0 ; LocInd < 12 ; ++ LocInd) { LocVecF[LocInd] = VecField[LocInd] ; - LocCompV[LocInd] = CompoVert[LocInd] ; + LocCompV[LocInd] = CompoVert[nCompCount - 1][LocInd] ; LocVecF[LocInd].ptInt.ToLoc( m_MapFrame[0]) ; LocVecF[LocInd].vtNorm.ToLoc( m_MapFrame[0]) ; @@ -874,12 +1074,12 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) LocCompV[LocInd].vtNorm.ToLoc( m_MapFrame[0]) ; } - if ( ( AreSameVectorApprox( LocVecF[nIndArrey[0]].vtNorm, LocVecF[nIndArrey[1]].vtNorm) && - abs( LocVecF[nIndArrey[0]].vtNorm *LocVecF[nIndArrey[2]].vtNorm) < EPS_SMALL && - abs( LocVecF[nIndArrey[0]].vtNorm * LocVecF[nIndArrey[3]].vtNorm) < EPS_SMALL) || - ( AreSameVectorApprox( LocVecF[nIndArrey[2]].vtNorm, LocVecF[nIndArrey[3]].vtNorm) && - abs( LocVecF[nIndArrey[2]].vtNorm * LocVecF[nIndArrey[0]].vtNorm) < EPS_SMALL && - abs( LocVecF[nIndArrey[2]].vtNorm * LocVecF[nIndArrey[1]].vtNorm) < EPS_SMALL)) { + if ( ( AreSameVectorApprox( LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm, LocVecF[nIndArrey[nCompCount - 1][1]].vtNorm) && + abs( LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm *LocVecF[nIndArrey[nCompCount - 1][2]].vtNorm) < EPS_SMALL && + abs( LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm * LocVecF[nIndArrey[nCompCount - 1][3]].vtNorm) < EPS_SMALL) || + ( AreSameVectorApprox( LocVecF[nIndArrey[nCompCount - 1][2]].vtNorm, LocVecF[nIndArrey[nCompCount - 1][3]].vtNorm) && + abs( LocVecF[nIndArrey[nCompCount - 1][2]].vtNorm * LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm) < EPS_SMALL && + abs( LocVecF[nIndArrey[nCompCount - 1][2]].vtNorm * LocVecF[nIndArrey[nCompCount - 1][1]].vtNorm) < EPS_SMALL)) { Point3d ptBarycenter = ( LocCompV[0].ptInt + LocCompV[1].ptInt + LocCompV[2].ptInt + LocCompV[3].ptInt) / 4 ; @@ -949,17 +1149,21 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) } } } - else if ( ( nIndArrey[0] == 0 && nIndArrey[1] == 1 && nIndArrey[2] == 4 && nIndArrey[3] == 5) || - ( nIndArrey[0] == 1 && nIndArrey[1] == 2 && nIndArrey[2] == 5 && nIndArrey[3] == 6) || - ( nIndArrey[0] == 2 && nIndArrey[1] == 3 && nIndArrey[2] == 6 && nIndArrey[3] == 7) || - ( nIndArrey[0] == 0 && nIndArrey[1] == 3 && nIndArrey[2] == 4 && nIndArrey[3] == 7)) { + else if ( ( nIndArrey[nCompCount - 1][0] == 0 && nIndArrey[nCompCount - 1][1] == 1 && + nIndArrey[nCompCount - 1][2] == 4 && nIndArrey[nCompCount - 1][3] == 5) || + ( nIndArrey[nCompCount - 1][0] == 1 && nIndArrey[nCompCount - 1][1] == 2 && + nIndArrey[nCompCount - 1][2] == 5 && nIndArrey[nCompCount - 1][3] == 6) || + ( nIndArrey[nCompCount - 1][0] == 2 && nIndArrey[nCompCount - 1][1] == 3 && + nIndArrey[nCompCount - 1][2] == 6 && nIndArrey[nCompCount - 1][3] == 7) || + ( nIndArrey[nCompCount - 1][0] == 0 && nIndArrey[nCompCount - 1][1] == 3 && + nIndArrey[nCompCount - 1][2] == 4 && nIndArrey[nCompCount - 1][3] == 7)) { VectorField LocVecF[12], LocCompV[12] ; for ( int LocInd = 0 ; LocInd < 12 ; ++ LocInd) { LocVecF[LocInd] = VecField[LocInd] ; - LocCompV[LocInd] = CompoVert[LocInd] ; + LocCompV[LocInd] = CompoVert[nCompCount - 1][LocInd] ; LocVecF[LocInd].ptInt.ToLoc( m_MapFrame[0]) ; LocVecF[LocInd].vtNorm.ToLoc( m_MapFrame[0]) ; @@ -967,12 +1171,12 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) LocCompV[LocInd].vtNorm.ToLoc( m_MapFrame[0]) ; } - if ( ( AreSameVectorApprox( LocVecF[nIndArrey[0]].vtNorm, LocVecF[nIndArrey[2]].vtNorm) && - abs( LocVecF[nIndArrey[0]].vtNorm * LocVecF[nIndArrey[1]].vtNorm) < EPS_SMALL && - abs( LocVecF[nIndArrey[0]].vtNorm * LocVecF[nIndArrey[3]].vtNorm) < EPS_SMALL) || - ( AreSameVectorApprox( LocVecF[nIndArrey[1]].vtNorm, LocVecF[nIndArrey[3]].vtNorm) && - abs( LocVecF[nIndArrey[1]].vtNorm * LocVecF[nIndArrey[0]].vtNorm) < EPS_SMALL && - abs( LocVecF[nIndArrey[1]].vtNorm * LocVecF[nIndArrey[2]].vtNorm) < EPS_SMALL)) { + if ( ( AreSameVectorApprox( LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm, LocVecF[nIndArrey[nCompCount - 1][2]].vtNorm) && + abs( LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm * LocVecF[nIndArrey[nCompCount - 1][1]].vtNorm) < EPS_SMALL && + abs( LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm * LocVecF[nIndArrey[nCompCount - 1][3]].vtNorm) < EPS_SMALL) || + ( AreSameVectorApprox( LocVecF[nIndArrey[nCompCount - 1][1]].vtNorm, LocVecF[nIndArrey[nCompCount - 1][3]].vtNorm) && + abs( LocVecF[nIndArrey[nCompCount - 1][1]].vtNorm * LocVecF[nIndArrey[nCompCount - 1][0]].vtNorm) < EPS_SMALL && + abs( LocVecF[nIndArrey[nCompCount - 1][1]].vtNorm * LocVecF[nIndArrey[nCompCount - 1][2]].vtNorm) < EPS_SMALL)) { Point3d ptBarycenter = ( LocCompV[0].ptInt + LocCompV[1].ptInt + LocCompV[2].ptInt + LocCompV[3].ptInt) / 4 ; @@ -1046,25 +1250,25 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) } // Flag ExtMC - bool bExtMC = bNormal && bGridControl ; + bool bExtMC = ( nFeatureType != NO_FEATURE) && bGridControl ; // Extended MC - if ( bExtMC) { + if ( bExtMC) { // Passo al sistema di riferimento del baricentro Point3d ptGravityCenter( 0, 0, 0) ; - for ( int ni = 0 ; ni < nVertComp ; ++ ni) - ptGravityCenter = ptGravityCenter + CompoVert[ni].ptInt ; + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) + ptGravityCenter = ptGravityCenter + CompoVert[nCompCount - 1][ni].ptInt ; - ptGravityCenter = ptGravityCenter / nVertComp ; + ptGravityCenter = ptGravityCenter / nVertComp[nCompCount - 1] ; Vector3d vtO = ptGravityCenter - ORIG ; Point3d ptTrasf[12] ; - for ( int ni = 0 ; ni < nVertComp ; ++ ni) - ptTrasf[ni] = CompoVert[ni].ptInt - vtO ; + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) + ptTrasf[ni] = CompoVert[nCompCount - 1][ni].ptInt - vtO ; // Preparo le matrici per il sistema typedef Eigen::Matrix dSystemMatrix ; @@ -1074,8 +1278,8 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) dSystemMatrix dMatrixN, dMatrixU, dMatrixV ; dSystemVector dKnownVector, dUnknownVector, dSingularValue ; - dMatrixN.resize( nVertComp, 3) ; - dKnownVector.resize( nVertComp, 1) ; + dMatrixN.resize( nVertComp[nCompCount - 1], 3) ; + dKnownVector.resize( nVertComp[nCompCount - 1], 1) ; dUnknownVector.resize( 3, 1) ; // Studio del caso 4 punti su un piano @@ -1083,13 +1287,13 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) int nPosD ; Vector3d vtD, vtE ; - if ( nVertComp == 4 && nFeatureType == 2) { + if ( nVertComp[nCompCount - 1] == 4 && nFeatureType == 2) { int nPosEq ; for ( int ni = 0 ; ni < 2 ; ++ ni) { - for ( int nj = ni + 1 ; nj < nVertComp ; ++ nj) { + for ( int nj = ni + 1 ; nj < nVertComp[nCompCount - 1] ; ++ nj) { - if ( AreSameVectorApprox( CompoVert[ni].vtNorm, - CompoVert[nj].vtNorm)) { + if ( AreSameVectorApprox( CompoVert[nCompCount - 1][ni].vtNorm, + CompoVert[nCompCount - 1][nj].vtNorm)) { nEqual ++ ; nPosEq = ni ; } @@ -1101,30 +1305,30 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) } if ( nEqual == 2) { - for ( int ni = 0 ; ni < nVertComp ; ++ ni) + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) - if ( ! AreSameVectorApprox( CompoVert[ni].vtNorm, - CompoVert[nPosEq].vtNorm)) { + if ( ! AreSameVectorApprox( CompoVert[nCompCount - 1][ni].vtNorm, + CompoVert[nCompCount - 1][nPosEq].vtNorm)) { nPosD = ni ; - vtD = CompoVert[ni].vtNorm ; - vtE = CompoVert[nPosEq].vtNorm ; + vtD = CompoVert[nCompCount - 1][ni].vtNorm ; + vtE = CompoVert[nCompCount - 1][nPosEq].vtNorm ; } } } - double dDot = abs( ( CompoVert[1].ptInt - CompoVert[0].ptInt) * - ( ( CompoVert[2].ptInt - CompoVert[1].ptInt) ^ - ( CompoVert[3].ptInt - CompoVert[2].ptInt))) ; + double dDot = abs( ( CompoVert[nCompCount - 1][1].ptInt - CompoVert[nCompCount - 1][0].ptInt) * + ( ( CompoVert[nCompCount - 1][2].ptInt - CompoVert[nCompCount - 1][1].ptInt) ^ + ( CompoVert[nCompCount - 1][3].ptInt - CompoVert[nCompCount - 1][2].ptInt))) ; // Caso superficie piana - if ( nVertComp == 4 && nEqual == 2 && dDot < EPS_SMALL) { + if ( nVertComp[nCompCount - 1] == 4 && nEqual == 2 && dDot < EPS_SMALL) { - for ( int ni = 0 ; ni < nVertComp ; ++ ni) { + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) { if ( ni != nPosD) { - dMatrixN( ni, 0) = CompoVert[ni].vtNorm.x ; - dMatrixN( ni, 1) = CompoVert[ni].vtNorm.y ; - dMatrixN( ni, 2) = CompoVert[ni].vtNorm.z ; - dKnownVector( ni) = CompoVert[ni].vtNorm * ( ptTrasf[ni] - ORIG) ; + dMatrixN( ni, 0) = CompoVert[nCompCount - 1][ni].vtNorm.x ; + dMatrixN( ni, 1) = CompoVert[nCompCount - 1][ni].vtNorm.y ; + dMatrixN( ni, 2) = CompoVert[nCompCount - 1][ni].vtNorm.z ; + dKnownVector( ni) = CompoVert[nCompCount - 1][ni].vtNorm * ( ptTrasf[ni] - ORIG) ; } else { dMatrixN( ni, 0) = vtE.x ; @@ -1136,25 +1340,28 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) } // Caso generale else { - for ( int ni = 0 ; ni < nVertComp ; ++ ni) { - dMatrixN( ni, 0) = CompoVert[ni].vtNorm.x ; - dMatrixN( ni, 1) = CompoVert[ni].vtNorm.y ; - dMatrixN( ni, 2) = CompoVert[ni].vtNorm.z ; - dKnownVector( ni) = CompoVert[ni].vtNorm * ( ptTrasf[ni] - ORIG) ; + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) { + dMatrixN( ni, 0) = CompoVert[nCompCount - 1][ni].vtNorm.x ; + dMatrixN( ni, 1) = CompoVert[nCompCount - 1][ni].vtNorm.y ; + dMatrixN( ni, 2) = CompoVert[nCompCount - 1][ni].vtNorm.z ; + dKnownVector( ni) = CompoVert[nCompCount - 1][ni].vtNorm * ( ptTrasf[ni] - ORIG) ; } } - + DecomposerSVD svd( dMatrixN, Eigen::ComputeThinU | Eigen::ComputeThinV) ; dMatrixU = svd.matrixU() ; dMatrixV = svd.matrixV() ; dSingularValue = svd.singularValues() ; - // Se la feature è un edge annullo - // il valore singolare minore. - if ( nFeatureType == Edge) + double dS0 = dSingularValue( 0) ; + double dS1 = dSingularValue( 1) ; + double dS2 = dSingularValue( 2) ; - dSingularValue( 2) = 0 ; + // Se la feature è un edge annullo il valore singolare minore. + if ( nFeatureType == EDGE) { + dSingularValue( 2) = 0 ; + } // Back substitution: risolvo il sistema USV*x = b // Calcolo U^T b @@ -1163,10 +1370,10 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) for ( int ni = 0 ; ni < 3 ; ++ ni) { double s = 0 ; - + if ( dSingularValue( ni) > 0) { - for ( int nj = 0 ; nj < nVertComp ; ++ nj) + for ( int nj = 0 ; nj < nVertComp[nCompCount - 1] ; ++ nj) s += dMatrixU( nj, ni) * dKnownVector( nj) ; s /= dSingularValue( ni) ; @@ -1185,209 +1392,188 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) dUnknownVector( ni) = s ; } - // Limito la feature entro una distanza di 3 - // volte la diagonale del voxel dal baricentro. - Vector3d vtFeature( dUnknownVector( 0), - dUnknownVector( 1), - dUnknownVector( 2)) ; - - double dDistFeature = vtFeature.Len() ; - const double dMaxDist = sqrt( 3) * m_dStep ; + + // Esprimo la soluzione nel sistema di riferimento + // in cui è immerso quello dello dello z-map. + Point3d ptSol( dUnknownVector( 0) + vtO.x, + dUnknownVector( 1) + vtO.y, + dUnknownVector( 2) + vtO.z) ; // Flag sulla distanza del vertice dal // baricentro del sistema di punti bool bOutside = false ; + // Vettore Baricentro-Feature. + Vector3d vtFeature( dUnknownVector( 0), + dUnknownVector( 1), + dUnknownVector( 2)) ; + + double dDistFeature = vtFeature.Len() ; + const double dMaxDist = sqrt( 3) * m_dStep ; + + // Limito la feature a una distanza dal + // baricentro pari alla diagonale del voxel. if ( dDistFeature > dMaxDist) - bOutside = true ; - - // Esprimo la soluzione nel sistema di riferimento dello z-map. - Point3d ptSol( dUnknownVector( 0) + vtO.x, - dUnknownVector( 1) + vtO.y, - dUnknownVector( 2) + vtO.z) ; + bOutside = true ; Triangle3d CurrentTriangle ; TRIA3DVECTOR triContainer ; - // Flag sull'inversione delle normali - bool bInvNormB = false ; - - // Questo controllo viene eseguito solo se - // il vertice è distante dal baricentro - // entro la soglia stabilita. - if ( ! bOutside) { - for ( int ni = 0 ; ni < nVertComp ; ++ ni) { + + // Costruisco triangoli di prova + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) { - int nj = ( ni + 1 < nVertComp) ? ni + 1 : 0 ; - // Il triangolo è pronto - CurrentTriangle.Set( ptSol, CompoVert[nj].ptInt, CompoVert[ni].ptInt) ; - CurrentTriangle.Validate( true) ; + int nj = ( ni + 1 < nVertComp[nCompCount - 1]) ? ni + 1 : 0 ; + // Il triangolo è pronto + CurrentTriangle.Set( ptSol, CompoVert[nCompCount - 1][nj].ptInt, CompoVert[nCompCount - 1][ni].ptInt) ; + CurrentTriangle.Validate( true) ; - // Aggiungo triangolo al vettore temporaneo - triContainer.emplace_back( CurrentTriangle) ; + // Aggiungo triangolo al vettore temporaneo + triContainer.emplace_back( CurrentTriangle) ; + } + + // Controllo delle inversioni dei triangoli + bool bInversione = false ; + bool bDangerInversion = false ; - // Controllo sull'inversione delle normali - if ( ( CurrentTriangle.GetN() * CompoVert[nj].vtNorm < - 0.01 && // - 0.01 passando a - 0.002 si tolgono i 4 restanti - CurrentTriangle.GetN() * CompoVert[ni].vtNorm < - 0.01) && // - 0.01 passando a - 0.002 si tolgono i 4 restanti - ! bInvNormB) { - ptSol = ptGravityCenter ; - bInvNormB = true ; - triContainer.resize( 0) ; - ni = -1 ; - } - } + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) { + + int nj = ( ni + 1 < nVertComp[nCompCount - 1]) ? ni + 1 : 0 ; + + if ( triContainer[ni].GetN() * CompoVert[nCompCount - 1][ni].vtNorm < - EPS_SMALL || + triContainer[ni].GetN() * CompoVert[nCompCount - 1][nj].vtNorm < - EPS_SMALL) + bInversione = true ; } - // Questo flag esprime se il vertice è, entro la tolleranza, - // interno o esterno al voxel a cui appartiene. - bool bInsideVoxel = IsPointInsideVoxelApprox( i, j, k, ptSol) ; + if ( bInversione && + ( nVertComp[nCompCount - 1] == 3 || + nVertComp[nCompCount - 1] == 4)) { + + int nNegDot = 0 ; - // Proprietà geometriche locali - // del campo vettoriale: se vero - // procediamo con un ulteriore - // analisi per eliminare triangoli - // invertiti. - bool bLocProp = false ; - - if ( nVertComp == 4) { - - int nNegDotNum = 0 ; - - for ( int nLocIndI = 0 ; nLocIndI < 3 ; ++ nLocIndI) { - for ( int nLocIndJ = nLocIndI + 1 ; nLocIndJ < 4 ; ++ nLocIndJ) { - - if ( CompoVert[nLocIndI].vtNorm * CompoVert[nLocIndJ].vtNorm < 0) { - - nNegDotNum ++ ; - } + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] - 1 ; ++ ni) { + for ( int nj = ni + 1 ; nj < nVertComp[nCompCount - 1] ; ++ nj) { + if ( CompoVert[nCompCount - 1][ni].vtNorm * CompoVert[nCompCount - 1][nj].vtNorm < - EPS_SMALL) + nNegDot ++ ; } } - if ( nNegDotNum == 3) - - bLocProp = true ; - } - - // Se è necessario si effettua l'ulteriore analisi - // Questo controllo si effettua se la feature non - // esce dai limiti, non esce dal voxel e il primo - // controllo sull'inversione delle normali ha dato - // esito negativo. - if ( nFeatureType == 2 && bLocProp && - ! ( bOutside || bInsideVoxel || bInvNormB)) { - - if ( abs( nMin1 - nMin2) == 1 || - abs( nMin1 - nMin2) == 3) { + if ( nNegDot == nVertComp[nCompCount - 1] - 1) { - int nSum = nMin1 + nMin2 ; - int nTriNum = ( nSum == 3 && ( nMin1 == 3 || nMin2 == 3) ? - max( nMin1, nMin2) : min( nMin1, nMin2)) ; - - double dDot1 = triContainer[nTriNum].GetN() * CompoVert[nMin1].vtNorm ; - double dDot2 = triContainer[nTriNum].GetN() * CompoVert[nMin2].vtNorm ; - - if ( ( dDot1 < - 0.2 && dDot2 > - EPS_ZERO) || - ( dDot2 < - 0.2 && dDot1 > - EPS_ZERO)) { - - int nNm = dDot1 < - 0.2 ? nMin1 : nMin2 ; - int nNp = dDot1 < - 0.2 ? nMin2 : nMin1 ; - - Vector3d vtVV = CompoVert[nNp].ptInt - CompoVert[nNm].ptInt ; - Point3d ptSolZmFrame = ptSol ; - - double dLenVV = vtVV.Len() ; - - ptSolZmFrame.ToLoc( m_MapFrame[0]) ; - - if ( ! IsPointInsideVoxel( i, j, k, ptSol)) { - - Vector3d vtVS = ptSol - CompoVert[nNm].ptInt ; - - vtVV.Normalize() ; - - Vector3d vtVSNew = ( vtVS * vtVV) * vtVV ; + Point3d ptSolZMapFrame = ptSol ; + ptSolZMapFrame.ToLoc( m_MapFrame[0]) ; - ptSol = CompoVert[nNm].ptInt + vtVSNew ; - double dLNm = ( ptSol - CompoVert[nNm].ptInt).Len() ; - double dLNp = ( ptSol - CompoVert[nNp].ptInt).Len() ; + if ( ! IsPointInsideVoxelApprox( i, j, k, ptSolZMapFrame)) { - if ( dLNm > dLenVV || dLNp > dLenVV) { - - ptSol = dLNm < dLNp ? CompoVert[nNm].ptInt : CompoVert[nNp].ptInt ; - } + Vector3d vtNullSpace( dMatrixV( 0, 2), dMatrixV( 1, 2), dMatrixV( 2, 2)) ; + vtNullSpace.ToLoc( m_MapFrame[0]) ; + double dParInt1, dParInt2 ; + Point3d ptVoxMin( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, ( k + 0.5) * m_dStep) ; + Point3d ptVoxMax( ( i + 1.5) * m_dStep, ( j + 1.5) * m_dStep, ( k + 1.5) * m_dStep) ; + + if ( IntersLineBox( ptSolZMapFrame, vtNullSpace, ptVoxMin, ptVoxMax, dParInt1, dParInt2)) { triContainer.resize( 0) ; - for ( int nc = 0 ; nc < nVertComp ; ++ nc) { - - int nd = ( nc + 1 < nVertComp) ? nc + 1 : 0 ; - // Il triangolo è pronto - CurrentTriangle.Set( ptSol, CompoVert[nd].ptInt, CompoVert[nc].ptInt) ; + double dPar = abs( dParInt1) < abs( dParInt2) ? dParInt1 + ( dParInt2 - dParInt1) / 100 : + dParInt2 + ( dParInt1 - dParInt2) / 100 ; + + Point3d ptNewSol = ptSolZMapFrame + dPar * vtNullSpace ; + + ptNewSol.ToGlob( m_MapFrame[0]) ; + + ptSol = ptNewSol ; + + // Costruisco triangoli di prova + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) { + + int nj = ( ni + 1 < nVertComp[nCompCount - 1]) ? ni + 1 : 0 ; + // Il triangolo è pronto + CurrentTriangle.Set( ptSol, CompoVert[nCompCount - 1][nj].ptInt, CompoVert[nCompCount - 1][ni].ptInt) ; CurrentTriangle.Validate( true) ; + + // Aggiungo triangolo al vettore temporaneo + triContainer.emplace_back( CurrentTriangle) ; + } + } + else { - // Aggiungo triangolo al vettore temporaneo - triContainer.emplace_back( CurrentTriangle) ; - } + int nAdjVoxI, nAdjVoxJ, nAdjVoxK ; + if ( GetPointVoxel( ptSolZMapFrame, nAdjVoxI, nAdjVoxJ, nAdjVoxK)) { + + // Classificazione del voxel adiacente + int nAdjIndex = 0 ; + if ( IsThereMat( nAdjVoxI, nAdjVoxJ, nAdjVoxK)) + nAdjIndex |= ( 1 << 0) ; + if ( IsThereMat( nAdjVoxI + 1, nAdjVoxJ, nAdjVoxK)) + nAdjIndex |= ( 1 << 1) ; + if ( IsThereMat( nAdjVoxI + 1, nAdjVoxJ + 1, nAdjVoxK)) + nAdjIndex |= ( 1 << 2) ; + if ( IsThereMat( nAdjVoxI, nAdjVoxJ + 1, nAdjVoxK)) + nAdjIndex |= ( 1 << 3) ; + if ( IsThereMat( nAdjVoxI, nAdjVoxJ, nAdjVoxK + 1)) + nAdjIndex |= ( 1 << 4) ; + if ( IsThereMat( nAdjVoxI + 1, nAdjVoxJ, nAdjVoxK + 1)) + nAdjIndex |= ( 1 << 5) ; + if ( IsThereMat( nAdjVoxI + 1, nAdjVoxJ + 1, nAdjVoxK + 1)) + nAdjIndex |= ( 1 << 6) ; + if ( IsThereMat( nAdjVoxI, nAdjVoxJ + 1, nAdjVoxK + 1)) + nAdjIndex |= ( 1 << 7) ; + + // Se il voxel è pieno + if ( EdgeTable[nAdjIndex] != 0) + bDangerInversion = true ; + } + } + } + } + else { + + if ( nVertComp[nCompCount - 1] == 4) { + + Point3d ptSolZMapFrame = ptSol ; + ptSolZMapFrame.ToLoc( m_MapFrame[0]) ; + + + if ( ! IsPointInsideVoxelApprox( i, j, k, ptSolZMapFrame)) { + + Vector3d vtNullSpace( dMatrixV( 0, 2), dMatrixV( 1, 2), dMatrixV( 2, 2)) ; + vtNullSpace.ToLoc( m_MapFrame[0]) ; + double dParInt1, dParInt2 ; + Point3d ptVoxMin( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, ( k + 0.5) * m_dStep) ; + Point3d ptVoxMax( ( i + 1.5) * m_dStep, ( j + 1.5) * m_dStep, ( k + 1.5) * m_dStep) ; + + if ( IntersLineBox( ptSolZMapFrame, vtNullSpace, ptVoxMin, ptVoxMax, dParInt1, dParInt2)) { + + triContainer.resize( 0) ; + + double dPar = abs( dParInt1) < abs( dParInt2) ? dParInt1 + ( dParInt2 - dParInt1) / 100: + dParInt2 + ( dParInt1 - dParInt2) / 100 ; + + Point3d ptNewSol = ptSolZMapFrame + dPar * vtNullSpace ; + + ptNewSol.ToGlob( m_MapFrame[0]) ; + + ptSol = ptNewSol ; + + // Costruisco triangoli di prova + for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) { + + int nj = ( ni + 1 < nVertComp[nCompCount - 1]) ? ni + 1 : 0 ; + // Il triangolo è pronto + CurrentTriangle.Set( ptSol, CompoVert[nCompCount - 1][nj].ptInt, CompoVert[nCompCount - 1][ni].ptInt) ; + CurrentTriangle.Validate( true) ; + + // Aggiungo triangolo al vettore temporaneo + triContainer.emplace_back( CurrentTriangle) ; + } + } } } - } - else { - - int nPrev1 = nMin1 == 0 ? 3 : nMin1 - 1 ; - int nPrev2 = nMin2 == 0 ? 3 : nMin2 - 1 ; - int nNext1 = nMin1 == 3 ? 0 : nMin1 + 1 ; - int nNext2 = nMin2 == 3 ? 0 : nMin2 + 1 ; - - int nNeighbourIndex ; - int nStartIndex ; - - if ( CompoVert[nPrev1].vtNorm * CompoVert[nMin1].vtNorm > 0) { - - bool bTestOnVert = abs( nPrev1 - nMin2) == 1 || abs( nPrev1 - nMin2) == 3 ; - nNeighbourIndex = bTestOnVert ? nPrev1 : nNext1 ; - nStartIndex = nMin2 ; - } - else { - - bool bTestOnVert = abs( nPrev2 - nMin1) == 1 || abs( nPrev2 - nMin1) == 3 ; - nNeighbourIndex = bTestOnVert ? nPrev2 : nNext2 ; - nStartIndex = nMin1 ; - } - - Vector3d vtVV = CompoVert[nNeighbourIndex].ptInt - CompoVert[nStartIndex].ptInt ; - double dVVLen = vtVV.Len() ; - vtVV.Normalize() ; - - Vector3d vtVF = ptSol - CompoVert[nStartIndex].ptInt ; - Vector3d vtNewVF = ( vtVF * vtVV) * vtVV ; - - double dNewVFLen = vtNewVF.Len() ; - - if ( dNewVFLen > dVVLen || vtVV * vtNewVF < 0) { - - ptSol = CompoVert[nNeighbourIndex].ptInt ; - } - else { - - ptSol = CompoVert[nStartIndex].ptInt + vtNewVF ; - } - - triContainer.resize( 0) ; - - for ( int nc = 0 ; nc < nVertComp ; ++ nc) { - - int nd = ( nc + 1 < nVertComp) ? nc + 1 : 0 ; - // Il triangolo è pronto - CurrentTriangle.Set( ptSol, CompoVert[nd].ptInt, CompoVert[nc].ptInt) ; - CurrentTriangle.Validate( true) ; - - // Aggiungo triangolo al vettore temporaneo - triContainer.emplace_back( CurrentTriangle) ; - } - } + } } - + // Valuto normali: questo è ancora un controllo // sulle normali, se risultano in tutti i punti // approssimativamente uguali passiamo alla @@ -1415,7 +1601,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) // Se la feature non è fuori dai limiti // e i triangoli formano una superficie // non piana confermo ExtMC - if ( ! ( bOutside || bPlane)) { + if ( ( ! ( bOutside || bPlane)) && ( ! bDangerInversion)) { TRIA3DVECTOR vInnerTriaTemp, vBorderTriaTemp ; @@ -1481,7 +1667,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) triHold[nCurrent].vCompoTria.resize( nNewFeatureNum) ; for ( int ni = 0 ; ni < int( vInnerTriaTemp.size()) ; ++ ni) - + triHold[nCurrent].vCompoTria[nOldFeatureNum].emplace_back( vInnerTriaTemp[ni]) ; } @@ -1530,19 +1716,17 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) } // ExtMC non confermato, si passa a MC else { + // Costruzione dei triangoli - for ( int TriIndex = 0 ; TriangleTableEn[nIndex][0][TriIndex] != - 1 ; TriIndex += 3) { - - // Costruzione triangolo - int i0 = TriangleTableEn[nIndex][0][TriIndex + 2] ; - int i1 = TriangleTableEn[nIndex][0][TriIndex + 1] ; - int i2 = TriangleTableEn[nIndex][0][TriIndex] ; - + for ( int TriIndex = 0; TriIndex < ( nVertComp[nCompCount - 1] - 2) * 3 ; TriIndex += 3) { + Triangle3d CurrentTriangle ; // Il triangolo è pronto - CurrentTriangle.Set( VecField[i0].ptInt, VecField[i1].ptInt, VecField[i2].ptInt) ; - CurrentTriangle.Validate( true) ; + CurrentTriangle.Set( CompoTriVert[nCompCount - 1][TriIndex].ptInt, + CompoTriVert[nCompCount - 1][TriIndex+1].ptInt, + CompoTriVert[nCompCount - 1][TriIndex+2].ptInt) ; + bool bV = CurrentTriangle.Validate( true) ; // Aggiungo alla lista lstTria.emplace_back( CurrentTriangle) ; @@ -1550,27 +1734,24 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) } } // Standard MC - else { - + else { + // Costruzione dei triangoli - for ( int TriIndex = 0 ; TriangleTableEn[nIndex][0][TriIndex] != - 1 ; TriIndex += 3) { - - // Costruzione triangolo - int i0 = TriangleTableEn[nIndex][0][TriIndex + 2] ; - int i1 = TriangleTableEn[nIndex][0][TriIndex + 1] ; - int i2 = TriangleTableEn[nIndex][0][TriIndex] ; + for ( int TriIndex = 0; TriIndex < ( nVertComp[nCompCount - 1] - 2) * 3 ; TriIndex += 3) { + Triangle3d CurrentTriangle ; // Il triangolo è pronto - CurrentTriangle.Set( VecField[i0].ptInt, VecField[i1].ptInt, VecField[i2].ptInt) ; - CurrentTriangle.Validate( true) ; + CurrentTriangle.Set( CompoTriVert[nCompCount - 1][TriIndex].ptInt, + CompoTriVert[nCompCount - 1][TriIndex+1].ptInt, + CompoTriVert[nCompCount - 1][TriIndex+2].ptInt) ; + bool bV = CurrentTriangle.Validate( true) ; // Aggiungo alla lista lstTria.emplace_back( CurrentTriangle) ; } - } - nTableOffset += nVertComp ; + } } } } @@ -1578,6 +1759,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) return true ; } +// //---------------------------------------------------------------------------- bool @@ -1628,13 +1810,13 @@ VolZmap::FlipEdgesII( TriHolder& TriHold) const Point3d ptP1 = TriHold[n1].vCompoTria[nCompo1][nTri1].GetP( nVert1) ; Point3d ptP2 = TriHold[n2].vCompoTria[nCompo2][nTri2].GetP( nVert2) ; - if ( AreSamePointEpsilon( ptP1, ptP2, EPS_SMALL)) { + if ( AreSamePointEpsilon( ptP1, ptP2, EPS_ZERO)) { Point3d ptVert1 = TriHold[n1].ptCompoVert[nCompo1] ; Point3d ptVert2 = TriHold[n2].ptCompoVert[nCompo2] ; - if ( ! ( AreSamePointEpsilon( ptP1, ptVert1, EPS_SMALL) || - AreSamePointEpsilon( ptP2, ptVert2, EPS_SMALL))) { + if ( ! ( AreSamePointEpsilon( ptP1, ptVert1, EPS_ZERO) || + AreSamePointEpsilon( ptP2, ptVert2, EPS_ZERO))) { SharedIndex.emplace_back( nVert1) ; SharedIndex.emplace_back( nVert2) ; @@ -1652,9 +1834,9 @@ VolZmap::FlipEdgesII( TriHolder& TriHold) const // Si deve operare la modifica dei triangoli if ( SharedIndex.size() > 2) { - // verifico che i due lai adiacenti siano controversi + // verifico che i due lati adiacenti siano controversi int nProd = ( SharedIndex[2] - SharedIndex[0]) * ( SharedIndex[3] - SharedIndex[1]) ; - if ( nProd != 1 && nProd != - 2 && nProd != 4) { + if ( nProd != 1 && nProd != - 2 && nProd != 4 && nProd != 0) { TriHold[n1].vCompoTria[nCompo1][nTri1].SetP( SharedIndex[0], TriHold[n2].ptCompoVert[nCompo2]) ; @@ -1747,13 +1929,13 @@ VolZmap::FlipEdgesBB( TriaMatrix& InterTria) const Point3d ptPF = InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].GetP( nVertF) ; Point3d ptPL = InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].GetP( nVertL) ; - if ( AreSamePointEpsilon( ptPF, ptPL, EPS_SMALL)) { + if ( AreSamePointEpsilon( ptPF, ptPL, EPS_ZERO)) { Point3d ptVertF = InterTria[tFB][tVFB].ptCompoVert[tCmpF] ; Point3d ptVertL = InterTria[tLB][tVLB].ptCompoVert[tCmpL] ; - if ( ! ( AreSamePointEpsilon( ptPF, ptVertF, EPS_SMALL) || - AreSamePointEpsilon( ptPL, ptVertL, EPS_SMALL))) { + if ( ! ( AreSamePointEpsilon( ptPF, ptVertF, EPS_ZERO) || + AreSamePointEpsilon( ptPL, ptVertL, EPS_ZERO))) { SharedIndex.emplace_back( nVertF) ; SharedIndex.emplace_back( nVertL) ; @@ -1773,7 +1955,7 @@ VolZmap::FlipEdgesBB( TriaMatrix& InterTria) const // verifico che i due lai adiacenti siano controversi int nProd = ( SharedIndex[2] - SharedIndex[0]) * ( SharedIndex[3] - SharedIndex[1]) ; - if ( nProd != 1 && nProd != - 2 && nProd != 4) { + if ( nProd != 1 && nProd != - 2 && nProd != 4 && nProd != 0) { InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].SetP( SharedIndex[0], InterTria[tLB][tVLB].ptCompoVert[tCmpL]) ; @@ -2244,7 +2426,7 @@ VolZmap::IsPointInsideVoxel( int nI, int nJ, int nK, const Point3d& ptP) const //---------------------------------------------------------------------------- bool -VolZmap::IsPointInsideVoxelApprox( int nI, int nJ, int nK, const Point3d& ptP) const +VolZmap::IsPointInsideVoxelApprox( int nI, int nJ, int nK, const Point3d& ptP, double dPrec) const { // Controllo sull'ammissibilità del voxel if ( nI < - 1 || nI >= int( m_nNx[0]) || @@ -2252,22 +2434,25 @@ VolZmap::IsPointInsideVoxelApprox( int nI, int nJ, int nK, const Point3d& ptP) c nK < - 1 || nK >= int( m_nNy[1])) return false ; + if ( dPrec < EPS_ZERO) + dPrec = 0 ; + Point3d ptPZmap = ptP ; ptPZmap.ToLoc( m_MapFrame[0]) ; - bool bI = ptPZmap.x > ( nI + 0.5) * m_dStep - EPS_SMALL && - ptPZmap.x < ( nI + 1.5) * m_dStep + EPS_SMALL ; - bool bJ = ptPZmap.y > ( nJ + 0.5) * m_dStep - EPS_SMALL && - ptPZmap.y < ( nJ + 1.5) * m_dStep + EPS_SMALL ; - bool bK = ptPZmap.z > ( nK + 0.5) * m_dStep - EPS_SMALL && - ptPZmap.z < ( nK + 1.5) * m_dStep + EPS_SMALL ; + bool bI = ptPZmap.x > ( nI + 0.5) * m_dStep - dPrec && + ptPZmap.x < ( nI + 1.5) * m_dStep + dPrec ; + bool bJ = ptPZmap.y > ( nJ + 0.5) * m_dStep - dPrec && + ptPZmap.y < ( nJ + 1.5) * m_dStep + dPrec ; + bool bK = ptPZmap.z > ( nK + 0.5) * m_dStep - dPrec && + ptPZmap.z < ( nK + 1.5) * m_dStep + dPrec ; return ( bI && bJ && bK) ; } //---------------------------------------------------------------------------- bool -VolZmap::GetPointVoxel( Point3d& ptP, int& nVoxI, int& nVoxJ, int& nVoxK) const +VolZmap::GetPointVoxel( const Point3d& ptP, int& nVoxI, int& nVoxJ, int& nVoxK) const { nVoxI = int( floor( ( ptP.x - 0.5 * m_dStep) / m_dStep)) ; nVoxJ = int( floor( ( ptP.y - 0.5 * m_dStep) / m_dStep)) ; @@ -2612,5 +2797,3 @@ VolZmap::IsATriangleOnBorder( const Triangle3d& trTria, const Point3d& ptVert, } - - diff --git a/VolTriZmapVolume.cpp b/VolTriZmapVolume.cpp index 1f4c907..8c2cf4a 100644 --- a/VolTriZmapVolume.cpp +++ b/VolTriZmapVolume.cpp @@ -179,6 +179,15 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ if ( nGrid == 0) { + /*INTVECTOR nXBlock ; + INTVECTOR nYBlock ; + nXBlock.emplace_back( min( nI / m_nDexNumPBlock, m_nFracLin[0] - 1)) ; + nYBlock.emplace_back( min( nJ / m_nDexNumPBlock, m_nFracLin[1] - 1)) ; + if ( nI % N_DEXBLOCK == 0 && nXBlock[0] > 0) + nXBlock.emplace_back( nXBlock[0] - 1) ; + if ( nJ % N_DEXBLOCK == 0 && nYBlock[0] > 0) + nYBlock.emplace_back( nYBlock[0] - 1) ;*/ + int nXStop = 1 ; int nYStop = 1 ; @@ -216,6 +225,15 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ else if ( nGrid == 1) { + /*INTVECTOR nYBlock ; + INTVECTOR nZBlock ; + nYBlock.emplace_back( min( nI / m_nDexNumPBlock, m_nFracLin[1] - 1)) ; + nZBlock.emplace_back( min( nJ / m_nDexNumPBlock, m_nFracLin[2] - 1)) ; + if ( nI % N_DEXBLOCK == 0 && nYBlock[0] > 0) + nYBlock.emplace_back( nYBlock[0] - 1) ; + if ( nJ % N_DEXBLOCK == 0 && nZBlock[0] > 0) + nZBlock.emplace_back( nZBlock[0] - 1) ;*/ + int nYStop = 1 ; int nZStop = 1 ; @@ -253,6 +271,15 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ else if ( nGrid == 2) { + /*INTVECTOR nXBlock ; + INTVECTOR nZBlock ; + nXBlock.emplace_back( min( nJ / m_nDexNumPBlock, m_nFracLin[0] - 1)) ; + nZBlock.emplace_back( min( nI / m_nDexNumPBlock, m_nFracLin[2] - 1)) ; + if ( nJ % N_DEXBLOCK == 0 && nXBlock[0] > 0) + nXBlock.emplace_back( nXBlock[0] - 1) ; + if ( nI % N_DEXBLOCK == 0 && nZBlock[0] > 0) + nZBlock.emplace_back( nZBlock[0] - 1) ;*/ + int nXStop = 1 ; int nZStop = 1 ; @@ -4096,7 +4123,7 @@ VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) { for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) { - + Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ; Point3d ptInt1, ptInt2 ; @@ -4316,9 +4343,9 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d & ptS, const Point double dSqIndet = EPS_SMALL * EPS_SMALL ; - // Variabili booleane per i tappi Vector3d vtUmv = vtMove ; vtUmv.Normalize() ; + // Variabili booleane per i tappi bool bConeT = ( abs( vtToolDir * vtUmv) > EPS_SMALL ? true : bTapT) ; bool bConeB = ( abs( vtToolDir * vtUmv) > EPS_SMALL ? true : bTapB) ; bool bElpsB = ( abs( vtToolDir * vtUmv) > EPS_SMALL ? true : bTapB) ; @@ -4328,10 +4355,11 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d & ptS, const Point Vector3d vtNmin, vtNmax ; if ( dRatio * dTan <= 1) { - + for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) { for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) { + double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ; @@ -4407,7 +4435,7 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d & ptS, const Point // Intersezione con la prima faccia if ( abs( vtPoly * vtNs) > COS_ORTO_ANG_ZERO) { if ( dLenY * ptPoly1.x >= dLenX * ptPoly1.y && - dLenY * ( ptPoly1.x - dDeltaX) <= dLenX * ptPoly1.y && + dLenY * ( ptPoly1.x - dDeltaX) <= dLenX * ( ptPoly1.y - dDeltaY) && dDeltaX * ptPoly1.y >= dDeltaY * ptPoly1.x && dDeltaX * ( ptPoly1.y - dLenY) <= dDeltaY * ( ptPoly1.x - dLenX)) { @@ -4415,11 +4443,11 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d & ptS, const Point vtN1 = - vtNs ; ++ nIntNum ; } - } + } // Intersezione con la seconda faccia if ( abs( vtPoly * vtNd) > COS_ORTO_ANG_ZERO) { if ( dLenY * ptPoly2.x >= dLenX * ptPoly2.y && - dLenY * ( ptPoly2.x - dDeltaX) <= dLenX * ptPoly2.y && + dLenY * ( ptPoly2.x - dDeltaX) <= dLenX * ( ptPoly2.y - dDeltaY) && dDeltaX * ptPoly2.y >= dDeltaY * ptPoly2.x && dDeltaX * ( ptPoly2.y - dLenY) <= dDeltaY * ( ptPoly2.x - dLenX)) { @@ -4549,7 +4577,7 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d & ptS, const Point vtNmin = vtN2 ; vtNmax = vtN1 ; } - + SubtractIntervals( nGrid, i, j, dMin, dMax, vtNmin, vtNmax) ; } @@ -4605,7 +4633,7 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d & ptS, const Point for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) { for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) { - + double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ; diff --git a/VolZmap.h b/VolZmap.h index a823539..f4f94ce 100644 --- a/VolZmap.h +++ b/VolZmap.h @@ -123,7 +123,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW bool AddDexelSideFace( int nPos, int nPosAdj, const Point3d& ptP, const Point3d& ptQ, const Vector3d& vtZ, const Vector3d& vtNorm, TRIA3DLIST& lstTria) const ; bool MarchingCubes( int nBlock, TRIA3DLIST& lstTria) const ; - bool ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) const ; + bool ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) const ; bool FlipEdgesII( TriHolder& TriHold) const ; bool FlipEdgesBB( TriaMatrix& InterTria) const ; bool IsThereMat( int nI, int nJ, int nK) const ; @@ -131,8 +131,8 @@ class VolZmap : public IVolZmap, public IGeoObjRW bool IntersPos( int nVec1[], int nVec2[], Point3d & ptInt) const ; bool IntersPos( int nVec1[], int nVec2[], bool bFirstCorner, Point3d& ptInt, Vector3d& vtNormal) const ; bool IsPointInsideVoxel( int nI, int nJ, int nK, const Point3d& ptP) const ; - bool IsPointInsideVoxelApprox( int nI, int nJ, int nK, const Point3d& ptP) const ; - bool GetPointVoxel( Point3d& ptP, int& nVoxI, int& nVoxJ, int& nVoxK) const ; + bool IsPointInsideVoxelApprox( int nI, int nJ, int nK, const Point3d& ptP, double dPrec = EPS_SMALL) const ; + bool GetPointVoxel( const Point3d& ptP, int& nVoxI, int& nVoxJ, int& nVoxK) const ; // OPERAZIONI SU INTERVALLI bool SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ, diff --git a/VolZmapTool.cpp b/VolZmapTool.cpp index efd3317..426dbd4 100644 --- a/VolZmapTool.cpp +++ b/VolZmapTool.cpp @@ -19,6 +19,7 @@ #include "GeoConst.h" #include "/EgtDev/Include/EGKLinePntTgCurve.h" #include "/EgtDev/Include/EGKFilletChamfer.h" +#include "/EgtDev/Include/EGkDistPointCurve.h" using namespace std ; @@ -98,257 +99,195 @@ bool VolZmap::SetAdvTool( const string& sToolName, double dH, double dR, double dTipH, double dTipR, double dCornR) { - // reset nome + // Reset nome m_sToolName.clear() ; - // verifica dimensioni globali + + // Verifica dimensioni globali if ( dH < EPS_SMALL || dR < EPS_SMALL) - return false ; - // se altezza punta nulla, ricado nel caso standard - if ( dTipH < EPS_SMALL || abs( dTipR - dR) < EPS_SMALL) + return false ; + + // Se altezza punta nulla, ricado nel caso standard + if ( dTipH < EPS_SMALL || abs( dTipR - dR) < EPS_SMALL) return SetStdTool( sToolName, dH, dR, dCornR) ; - // caso avanzato - else { - - m_dHeight = dH ; - m_dRadius = dR ; - m_dTipHeight = dTipH ; - m_dTipRadius = max( dTipR, 0.) ; - if ( dCornR < EPS_SMALL) { + // Caso avanzato + m_dHeight = dH ; + m_dRadius = dR ; + m_dTipHeight = dTipH ; + m_dTipRadius = max( dTipR, 0.) ; - m_nToolType = ConusMill ; - m_dRCorner = 0 ; - } - // Se il raggio corner è non nullo - // l'utensile viene descritto da - // come utensile generico. - else { - - m_dRCorner = dCornR ; - m_nToolType = GenericTool ; - - // come profilo - m_nToolType = GenericTool ; - Point3d pt0( 0, 0, 0) ; - Point3d pt1( m_dRadius, 0, 0) ; - Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ; - - if ( m_dTipRadius < m_dRadius) { - - Point3d ptInt( dTipR, - dH, 0) ; - Point3d ptLast( 0, - dH, 0) ; - - CurveLine cLine1 ; cLine1.Set( pt2, ptInt) ; - CurveLine cLine2 ; cLine2.Set( ptInt, ptLast) ; - - double dTrim1, dTrim2 ; - - Point3d ptIn1 = ptInt + Y_AX * dCornR ; - Point3d ptIn2 = ptInt - X_AX * dCornR ; - - ICurveArc* pArc = CreateFillet( cLine1, ptIn1, cLine2, ptIn2, Z_AX, dCornR, dTrim1, dTrim2) ; - - cLine1.TrimEndAtParam( abs( dTrim1)) ; - cLine2.TrimStartAtParam( abs( dTrim2)) ; - - Point3d pt3, pt4 ; - - cLine1.GetEndPoint( pt3) ; - cLine2.GetStartPoint( pt4) ; - - Point3d ptC = pArc -> GetCenter() ; - - CurveArc cvArc ; cvArc.SetC2P( ptC, pt3, pt4) ; - - m_ToolOutline.Clear() ; - - CurveLine LineSt ; LineSt.Set( pt0, pt1) ; - - m_ToolOutline.AddCurve( LineSt) ; - m_ToolOutline.AddLine( pt2); - m_ToolOutline.AddLine( pt3); - m_ToolOutline.AddCurve( cvArc) ; - m_ToolOutline.AddLine( ptLast) ; - } - else { - - if ( dTipR - dCornR < 0) - return false ; - - Point3d ptC( dTipR - dCornR, - dH + dCornR, 0) ; - - CurveArc cvCirc ; cvCirc.SetXY( ptC, dCornR) ; - - Point3d ptNear( ptC.x + dCornR, ptC.y + dCornR, 0) ; - - ICurveLine* pLine = GetLinePointTgCurve( pt2, cvCirc, ptNear) ; - - Point3d pt3 ; - - pLine -> GetEndPoint( pt3) ; - - Point3d pt4( ptC.x, - dH, 0) ; - - CurveArc cvArc ; cvArc.SetC2P( ptC, pt3, pt4) ; - - Point3d pt5( 0, - dH, 0) ; - - m_ToolOutline.Clear() ; - - CurveLine Line ; Line.Set( pt0, pt1) ; - - m_ToolOutline.AddCurve( Line) ; - m_ToolOutline.AddLine( pt2); - m_ToolOutline.AddLine( pt3); - m_ToolOutline.AddCurve( cvArc) ; - m_ToolOutline.AddLine( pt5) ; - } - - return SetGenTool( sToolName, &m_ToolOutline) ; - } + // Se raggio corner nullo, allora utensile conico + if ( dCornR < EPS_SMALL) { + m_nToolType = ConusMill ; + m_dRCorner = 0 ; + // assegno nome e identificativo + m_sToolName = sToolName ; + m_nCurrentToolNum = 0 ; + return true ; } - // assegno il nome - m_sToolName = sToolName ; - // Aggiorno il numero dell'utensile corrente - m_nCurrentToolNum = 0 ; - return true ; + + // Altrimenti utensile generico. + m_nToolType = GenericTool ; + m_dRCorner = dCornR ; + m_ToolOutline.Clear() ; + + // Definisco il profilo + Point3d pt0( 0, 0, 0) ; + Point3d pt1( m_dRadius, 0, 0) ; + Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ; + + if ( m_dTipRadius < m_dRadius) { + + CurveLine LineSt ; + LineSt.Set( pt0, pt1) ; + + Point3d ptInt( dTipR, - dH, 0) ; + Point3d ptLast( 0, - dH, 0) ; + + CurveLine cLine1 ; + cLine1.Set( pt2, ptInt) ; + CurveLine cLine2 ; + cLine2.Set( ptInt, ptLast) ; + + Point3d ptIn1 = ptInt + Y_AX * dCornR ; + Point3d ptIn2 = ptInt - X_AX * dCornR ; + + double dTrim1, dTrim2 ; + PtrOwner< ICurveArc> pArc( CreateFillet( cLine1, ptIn1, cLine2, ptIn2, Z_AX, dCornR, dTrim1, dTrim2)) ; + if ( IsNull( pArc)) + return false ; + cLine1.TrimEndAtParam( abs( dTrim1)) ; + cLine2.TrimStartAtParam( abs( dTrim2)) ; + + Point3d pt3, pt4 ; + cLine1.GetEndPoint( pt3) ; + cLine2.GetStartPoint( pt4) ; + + Point3d ptC = pArc->GetCenter() ; + + CurveArc cvArc ; + cvArc.SetC2P( ptC, pt3, pt4) ; + + m_ToolOutline.AddCurve( LineSt) ; + m_ToolOutline.AddLine( pt2); + m_ToolOutline.AddLine( pt3); + m_ToolOutline.AddCurve( cvArc) ; + m_ToolOutline.AddLine( ptLast) ; + } + + else { + + if ( m_dTipRadius < m_dRCorner) + return false ; + + CurveLine LineSt ; + LineSt.Set( pt0, pt1) ; + + Point3d ptC( dTipR - dCornR, - dH + dCornR, 0) ; + + CurveArc cvCirc ; + cvCirc.SetXY( ptC, dCornR) ; + + Point3d ptNear( ptC.x + dCornR, ptC.y + dCornR, 0) ; + PtrOwner pLine( GetLinePointTgCurve( pt2, cvCirc, ptNear)) ; + if ( IsNull( pLine)) + return false ; + + Point3d pt3 ; + pLine->GetEndPoint( pt3) ; + + Point3d pt4( ptC.x, - dH, 0) ; + + CurveArc cvArc ; + cvArc.SetC2P( ptC, pt3, pt4) ; + + Point3d pt5( 0, - dH, 0) ; + + m_ToolOutline.AddCurve( LineSt) ; + m_ToolOutline.AddLine( pt2); + m_ToolOutline.AddLine( pt3); + m_ToolOutline.AddCurve( cvArc) ; + m_ToolOutline.AddLine( pt5) ; + } + + return SetGenTool( sToolName, &m_ToolOutline) ; } //---------------------------------------------------------------------------- bool VolZmap::SetGenTool( const string& sToolName, const ICurveComposite* pToolOutline) { - // Aggiorno il nome dell'utensile + // Assegno nome, tipo e id dell'utensile m_sToolName = sToolName ; - - // Aggiorno il tipo di utensile m_nToolType = GenericTool ; - - // Aggiorno il numero dell'utensile corrente m_nCurrentToolNum = 0 ; - // Copio il profilo - m_ToolOutline.CopyFrom( pToolOutline) ; + // Copio il profilo e garantisco sia di soli archi e rette (converto eventuali curve di Bezier) + if ( ! m_ToolOutline.CopyFrom( pToolOutline) || + ! m_ToolOutline.ArcsBezierCurvesToArcsPerpExtr( m_dLinTol, m_dAngTolDeg)) + return false ; - // Se ci fosse una Bézier la convertiamo in archi e rette - m_ToolOutline.ArcsBezierCurvesToArcsPerpExtr( m_dLinTol, m_dAngTolDeg) ; - - // Puntatore a curva costante - const ICurve* pCurve = m_ToolOutline.GetFirstCurve() ; + // Flag di avvenuta approssimazione + bool bApprox = false ; // Ciclo sulle curve componenti + const ICurve* pCurve = m_ToolOutline.GetFirstCurve() ; while ( pCurve != nullptr) { - // Se la curva è un arco valuto se approssimarlo + // Se la curva è un arco verifico se approssimarlo if ( pCurve->GetType() == CRV_ARC) { - // Centro e punti iniziale e finale dell'arco - Point3d ptStart, ptEnd, ptO ; - - pCurve->GetStartPoint( ptStart) ; - pCurve->GetEndPoint( ptEnd) ; - pCurve->GetCenterPoint( ptO) ; - - // Vettore congiungente il centro con i punti iniziale e finale - Vector3d vtStRad = ptStart - ptO ; - Vector3d vtEnRad = ptEnd - ptO ; - - // Calcolo del raggio dell'arco + // Centro e raggio dell'arco + Point3d ptO = GetBasicCurveArc( pCurve)->GetCenter() ; double dRadius = GetBasicCurveArc( pCurve)->GetRadius() ; - // Recupero la curva precedente e quella successiva - const ICurve* pPrev = m_ToolOutline.GetPrevCurve() ; - const ICurve* pNext = m_ToolOutline.GetNextCurve() ; - pNext = m_ToolOutline.GetNextCurve() ; + // Se il centro è fuori dall'asse devo approssimare + bool bCurrApprox = ( abs( ptO.x) > EPS_SMALL) ; - // Valuto la necessità di approssimare l'arco o meno - - // Punto Iniziale della curva precedente e finale della successiva - Point3d ptStartPrev, ptEndNext ; - - // Vettori tangenti alle curve precedente corrente e successiva - // rispettivamente nei punti finale, iniziale e finale e iniziale - // e prodotti vettore fra i suddetti - Vector3d vtPrevEndDir, vtCurrentStartDir, vtCurrentEndDir, vtNextStartDir ; - Vector3d vtIProd, vtFProd ; - - Point3d ptTopCurrent = ptO + Y_AX * dRadius ; - Point3d ptBottomCurrent = ptO - Y_AX * dRadius ; - - // Valuto le relazioni geometriche fra la - // curva corrente e quella precedente. - pPrev->GetStartPoint( ptStartPrev) ; - pPrev->GetEndDir( vtPrevEndDir) ; - pCurve->GetStartDir( vtCurrentStartDir) ; - vtIProd = vtPrevEndDir ^ vtCurrentStartDir ; - - // Se la curva successiva esiste valuto le - // medesime relazioni con la quest'ultima - if ( pNext != nullptr) { - - pNext->GetEndPoint( ptEndNext) ; - pCurve->GetEndDir( vtCurrentEndDir) ; - pNext->GetStartDir( vtNextStartDir) ; - vtFProd = vtCurrentEndDir ^ vtNextStartDir ; + // Se una delle altre curve dista dal centro meno del raggio, devo approssimare + for ( int nI = 0 ; ! bCurrApprox && nI < m_ToolOutline.GetCurveCount() ; ++ nI) { + const ICurve* pOtherCrv = m_ToolOutline.GetCurve( nI) ; + if ( pOtherCrv != pCurve) { + DistPointCurve CalcDist( ptO, *pOtherCrv) ; + double dCurrDist ; + if ( CalcDist.GetDist( dCurrDist) && dCurrDist < dRadius - EPS_SMALL) + bCurrApprox = true ; + } } // Se devo approssimare - if ( ! ( ( abs( ptO.x) < EPS_SMALL && vtIProd.z > 0 && ptStartPrev.y > ptTopCurrent.y) && - ( ( pNext == nullptr && abs( ptEnd.x) < EPS_SMALL) || - ( pNext != nullptr && vtFProd.z > 0 && ptBottomCurrent.y > ptEndNext.y)))) { - - // Copio la parte precedente - const ICurve* pAux = m_ToolOutline.GetFirstCurve() ; - - while ( pAux != pCurve) { - - m_ToolArcLineApprox.AddCurve( * pAux, true) ; - - pAux = m_ToolOutline.GetNextCurve() ; - } - + if ( bCurrApprox) { // Creo la polyline approssimante - PolyLine Polygonal ; - - pCurve->ApproxWithLines( m_dLinTol, m_dAngTolDeg, 10, Polygonal) ; - - // Definisco una curva composita a partire dalla polyline - CurveComposite cvTemp ; cvTemp.FromPolyLine( Polygonal) ; - - // Aggiungo la parte approssimata - pAux = cvTemp.GetFirstCurve() ; - - while ( pAux != nullptr) { - - m_ToolArcLineApprox.AddCurve( * pAux, true) ; - - pAux = cvTemp.GetNextCurve() ; + PolyLine plyApprox ; + pCurve->ApproxWithLines( m_dLinTol, m_dAngTolDeg, ICurve::APL_SPECIAL, plyApprox) ; + // Aggiungo i segmenti di retta alla approssimazione + Point3d ptEnd ; + plyApprox.GetFirstPoint( ptEnd) ; + while ( plyApprox.GetNextPoint( ptEnd)) { + m_ToolArcLineApprox.AddLine( ptEnd) ; } + bApprox = true ; } - // Se non deve essere approssimato - else { - // Se è già stato definito m_ToolArcLineApprox deve - // essere completo, aggiungo quindi l'arco corrente - if ( m_ToolArcLineApprox.GetCurveCount() != 0) - m_ToolArcLineApprox.AddCurve( * pCurve, true) ; - } + // altrimenti lo aggiungo semplicemente + else + m_ToolArcLineApprox.AddCurve( *pCurve, true) ; } - // Se è segmento - else { - // Se è già stato definito m_ToolArcLineApprox deve - // essere completo, aggiungo quindi il segmento corrente - if ( m_ToolArcLineApprox.GetCurveCount() != 0) - m_ToolArcLineApprox.AddCurve( * pCurve, true) ; - } + // altrimenti è segmento e lo aggiungo semplicemente + else + m_ToolArcLineApprox.AddCurve( *pCurve, true) ; pCurve = m_ToolOutline.GetNextCurve() ; } + // Se non ci sono state approssimazioni, cancello la curva approssimante + if ( ! bApprox) + m_ToolArcLineApprox.Clear() ; + // Dimensioni dell'utensile BBox3d Bounding ; m_ToolOutline.GetLocalBBox( Bounding) ; double m_dHeight = Bounding.GetMax().y - Bounding.GetMin().y ; - double m_dRadius = Bounding.GetMax().x - Bounding.GetMin().x ; + double m_dRadius = Bounding.GetMax().x - Bounding.GetMin().x ; return true ; -} \ No newline at end of file +}