From 844a0277ffe265745127a1880847b1b59da4d723 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 23 May 2018 17:29:36 +0000 Subject: [PATCH] EgtGeomKernel 1.9e5 : - correzione calcolo triangoli di superficie Zmap (caso speciale 6 ExtMC). --- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes MC_Tables.h | 225 ++++++++++++++++++++++++-------------------- VolZmapGraphics.cpp | 117 ++++++++++++++--------- 3 files changed, 193 insertions(+), 149 deletions(-) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index ce86144703e8fec428ae299b16e2799c10d6a373..620ba6b506211f1fafc5d794c77af03494653a5e 100644 GIT binary patch delta 94 zcmdlNy)SyhFE&Qg&A-_cnHfzdD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-X4V@L delta 94 zcmdlNy)SyhFE&P#&A-_cnHfzcD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-WjGrO diff --git a/MC_Tables.h b/MC_Tables.h index c6f9b45..58709e7 100644 --- a/MC_Tables.h +++ b/MC_Tables.h @@ -1534,101 +1534,77 @@ static int nIndexVsIndex3[24][2] = { { 5, 0 }, 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}*/}, + { 1, 6, 0, 8, 3, 2, 10, 1, -1, -1, -1, -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 }*/}, + { 1, 6, 0, 9, 5, 4, 8, 3, -1, -1, -1, -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 }*/}, + { 1, 6, 6, 11, 3, 0, 8, 7, -1, -1, -1, -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}*/}, + { 1, 6, 0, 3, 11, 2, 1, 9, -1, -1, -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}*/}, + { 1, 6, 0, 1, 9, 4, 7, 8, -1, -1, -1, -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}*/}, + { 1, 6, 0, 1, 10, 6, 5, 9, -1, -1, -1, -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 }*/}, + { 1, 6, 1, 2, 10, 5, 4, 9, -1, -1, -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 }*/}, + { 1, 6, 1, 2, 11, 7, 6, 10, -1, -1, -1, -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}*/}, + { 1, 6, 2, 3, 8, 4, 7, 11, -1, -1, -1, -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}*/}, + { 1, 6, 2, 3, 11, 6, 5, 10, -1, -1, -1, -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 }*/}, + { 1, 6, 4, 5, 10, 6, 7, 8, -1, -1, -1, -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 }*/}, + { 1, 6, 4, 9, 5, 6, 11, 7, -1, -1, -1, -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}*/}, + { 1, 6, 7, 11, 6, 5, 9, 4, -1, -1, -1, -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}*/}, + { 1, 6, 8, 7, 6, 10, 5, 4, -1, -1, -1, -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}*/}, + { 1, 6, 10, 5, 6, 11, 3, 2, -1, -1, -1, -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}*/}, + { 1, 6, 7, 11, 4, 8, 3, 2, -1, -1, -1, -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}*/}, + { 1, 6, 10, 6, 7, 11, 2, 1, -1, -1, -1, -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}*/}, + { 1, 6, 9, 4, 5, 10, 2, 1, -1, -1, -1, -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}*/}, + { 1, 6, 9, 5, 6, 10, 1, 0, -1, -1, -1, -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}*/}, + { 1, 6, 8, 7, 4, 9, 1, 0, -1, -1, -1, -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}*/}, + { 1, 6, 9, 1, 2, 11, 3, 0, -1, -1, -1, -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}*/}, + { 1, 6, 0, 3, 11, 6, 7, 8, -1, -1, -1, -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}*/}, + { 1, 6, 3, 8, 4, 5, 9, 0, -1, -1, -1, -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}*/}, -}; + { 1, 6, 1, 10, 2, 3, 8, 0, -1, -1, -1, -1 }}, +} ; // Gestione dei casi in configurazione 6 @@ -1695,59 +1671,104 @@ static int nIndexVsIndex6[48][2] = { { 21 , 2 }, } ; -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 -}; - - - +static int Cases6Plus[48][2][15] = { +/* 67: 0, 1, 6, */ {{ 1, 10, 3, 6, 3, 10, 3, 6, 8, 5, 8, 6, 8, 5, 9 },// 0 + { 1, 7, 1, 10, 6, 5, 9, 8, 3, -1, -1, -1, -1, -1, -1}}, +/* 131: 0, 1, 7, */ {{ 1, 11, 3, 11, 1, 6, 9, 6, 1, 6, 9, 7, 8, 7, 9 },// 1 + { 1, 7, 1, 9, 8, 7, 6, 11, 3, -1, -1, -1, -1, -1, -1}}, +/* 21: 0, 2, 4, */ {{ 4, 1, 0, 1, 4, 10, 7, 10, 4, 10, 7, 2, 3, 2, 7 },// 2 + { 1, 7, 0, 4, 7, 3, 2, 10, 1, -1, -1, -1, -1, -1, -1}}, +/* 69: 0, 2, 6, */ {{ 6, 3, 2, 3, 6, 8, 5, 8, 6, 8, 5, 0, 1, 0, 5 },// 3 + { 1, 7, 0, 8, 3, 2, 6, 5, 1, -1, -1, -1, -1, -1, -1}}, +/* 41: 0, 3, 5, */ {{ 0, 9, 2, 5, 2, 9, 2, 5, 11, 4, 11, 5, 11, 4, 8 },// 4 + { 1, 7, 0, 9, 5, 4, 8, 11, 2, -1, -1, -1, -1, -1, -1}}, +/* 73: 0, 3, 6, */ {{ 0, 10, 2, 10, 0, 5, 8, 5, 0, 5, 8, 6, 11, 6, 8 },// 5 + { 1, 7, 0, 8, 11, 6, 5, 10, 2, -1, -1, -1, -1, -1, -1}}, +/* 81: 0, 4, 6, */ {{ 4, 5, 0, 10, 0, 5, 0, 10, 3, 6, 3, 10, 3, 6, 7 },// 6 + { 1, 7, 0, 4, 5, 10, 6, 7, 3, -1, -1, -1, -1, -1, -1}}, +/* 97: 0, 5, 6, */ {{ 4, 8, 6, 3, 6, 8, 6, 3, 10, 0, 10, 3, 10, 0, 9 },// 7 + { 1, 7, 0, 9, 10, 6, 4, 8, 3, -1, -1, -1, -1, -1, -1}}, +/* 193: 0, 6, 7, */ {{ 5, 8, 7, 8, 5, 0, 10, 0, 5, 0, 10, 3, 11, 3, 10 },// 8 + { 1, 7, 0, 8, 7, 5, 10, 11, 3, -1, -1, -1, -1, -1, -1}}, +/* 22: 1, 2, 4, */ {{ 2, 8, 0, 8, 2, 7, 10, 7, 2, 7, 10, 4, 9, 4, 10 },// 9 + { 1, 7, 0, 2, 10, 9, 4, 7, 8, -1, -1, -1, -1, -1, -1}}, +/* 134: 1, 2, 7, */ {{ 2, 11, 0, 7, 0, 11, 0, 7, 9, 6, 9, 7, 9, 6, 10 },// 10 + { 1, 7, 0, 2, 11, 7, 6, 10, 9, -1, -1, -1, -1, -1, -1}}, +/* 42: 1, 3, 5, */ {{ 5, 2, 1, 2, 5, 11, 4, 11, 5, 11, 4, 3, 0, 3, 4 },// 11 + { 1, 7, 0, 3, 11, 2, 1, 5, 4, -1, -1, -1, -1, -1, -1}}, +/* 138: 1, 3, 7, */ {{ 7, 0, 3, 0, 7, 9, 6, 9, 7, 9, 6, 1, 2, 1, 6 },// 12 + { 1, 7, 0, 3, 7, 6, 2, 1, 9, -1, -1, -1, -1, -1, -1}}, +/* 146: 1, 4, 7, */ {{ 6, 9, 4, 9, 6, 1, 11, 1, 6, 1, 11, 0, 8, 0, 11 },// 13 + { 1, 7, 0, 1, 9, 4, 6, 11, 8, -1, -1, -1, -1, -1, -1}}, +/* 162: 1, 5, 7, */ {{ 5, 6, 1, 11, 1, 6, 1, 11, 0, 7, 0, 11, 0, 7, 4 },// 14 + { 1, 7, 0, 1, 5, 6, 11, 7, 4, -1, -1, -1, -1, -1, -1}}, +/* 194: 1, 6, 7, */ {{ 5, 9, 7, 0, 7, 9, 7, 0, 11, 1, 11, 0, 11, 1, 10 },// 15 + { 1, 7, 0, 1, 10, 11, 7, 5, 9, -1, -1, -1, -1, -1, -1}}, +/* 28: 2, 3, 4, */ {{ 3, 8, 1, 4, 1, 8, 1, 4, 10, 7, 10, 4, 10, 7, 11 },// 16 + { 1, 7, 1, 3, 8, 4, 7, 11, 10, -1, -1, -1, -1, -1, -1}}, +/* 44: 2, 3, 5, */ {{ 3, 9, 1, 9, 3, 4, 11, 4, 3, 4, 11, 5, 10, 5, 11 },// 17 + { 1, 7, 1, 3, 11, 10, 5, 4, 9, -1, -1, -1, -1, -1, -1}}, +/* 52: 2, 4, 5, */ {{ 7, 10, 5, 10, 7, 2, 8, 2, 7, 2, 8, 1, 9, 1, 8 },// 18 + { 1, 7, 1, 2, 10, 5, 7, 8, 9, -1, -1, -1, -1, -1, -1}}, +/* 84: 2, 4, 6, */ {{ 6, 7, 2, 8, 2, 7, 2, 8, 1, 4, 1, 8, 1, 4, 5 },// 19 + { 1, 7, 1, 2, 6, 7, 8, 4, 5, -1, -1, -1, -1, -1, -1}}, +/* 148: 2, 4, 7, */ {{ 6, 10, 4, 1, 4, 10, 4, 1, 8, 2, 8, 1, 8, 2, 11 },// 20 + { 1, 7, 1, 2, 11, 8, 4, 6, 10, -1, -1, -1, -1, -1, -1}}, +/* 56: 3, 4, 5, */ {{ 7, 11, 5, 2, 5, 11, 5, 2, 9, 3, 9, 2, 9, 3, 8 },// 21 + { 1, 7, 2, 3, 8, 9, 5, 7, 11, -1, -1, -1, -1, -1, -1}}, +/* 104: 3, 5, 6, */ {{ 4, 11, 6, 11, 4, 3, 9, 3, 4, 3, 9, 2, 10, 2, 9 },// 22 + { 1, 7, 2, 3, 11, 6, 4, 9, 10, -1, -1, -1, -1, -1, -1}}, +/* 168: 3, 5, 7, */ {{ 7, 4, 3, 9, 3, 4, 3, 9, 2, 5, 2, 9, 2, 5, 6 },// 23 + { 1, 7, 2, 3, 7, 4, 9, 5, 6, -1, -1, -1, -1, -1, -1}}, +/* 87: 0, 1, 2, 4, 6, */ {{ 3, 4, 7, 4, 3, 9, 2, 9, 3, 9, 2, 5, 6, 5, 2 },// 24 + { 1, 7, 2, 6, 5, 9, 4, 7, 3, -1, -1, -1, -1, -1, -1}}, +/* 151: 0, 1, 2, 4, 7, */ {{ 6, 11, 4, 3, 4, 11, 4, 3, 9, 2, 9, 3, 9, 2, 10 },// 25 + { 1, 7, 2, 10, 9, 4, 6, 11, 3, -1, -1, -1, -1, -1, -1}}, +/* 199: 0, 1, 2, 6, 7, */ {{ 5, 11, 7, 11, 5, 2, 9, 2, 5, 2, 9, 3, 8, 3, 9 },// 26 + { 1, 7, 2, 11, 7, 5, 9, 8, 3, -1, -1, -1, -1, -1, -1}}, +/* 107: 0, 1, 3, 5, 6, */ {{ 4, 10, 6, 10, 4, 1, 8, 1, 4, 1, 8, 2, 11, 2, 8 },// 27 + { 1, 7, 1, 10, 6, 4, 8, 11, 2, -1, -1, -1, -1, -1, -1}}, +/* 171: 0, 1, 3, 5, 7, */ {{ 2, 7, 6, 7, 2, 8, 1, 8, 2, 8, 1, 4, 5, 4, 1 },// 28 + { 1, 7, 1, 5, 4, 8, 7, 6, 2, -1, -1, -1, -1, -1, -1}}, +/* 203: 0, 1, 3, 6, 7, */ {{ 5, 10, 7, 2, 7, 10, 7, 2, 8, 1, 8, 2, 8, 1, 9 },// 29 + { 1, 7, 1, 9, 8, 7, 5, 10, 2, -1, -1, -1, -1, -1, -1}}, +/* 211: 0, 1, 4, 6, 7, */ {{ 1, 9, 3, 4, 3, 9, 3, 4, 11, 5, 11, 4, 11, 5, 10 },// 30 + { 1, 7, 1, 9, 4, 5, 10, 11, 3, -1, -1, -1, -1, -1, -1}}, +/* 227: 0, 1, 5, 6, 7, */ {{ 1, 8, 3, 8, 1, 4, 10, 4, 1, 4, 10, 7, 11, 7, 10 },// 31 + { 1, 7, 1, 10, 11, 7, 4, 8, 3, -1, -1, -1, -1, -1, -1}}, +/* 61: 0, 2, 3, 4, 5, */ {{ 7, 9, 5, 9, 7, 0, 11, 0, 7, 0, 11, 1, 10, 1, 11 },// 32 + { 1, 7, 0, 9, 5, 7, 11, 10, 1, -1, -1, -1, -1, -1, -1}}, +/* 93: 0, 2, 3, 4, 6, */ {{ 1, 6, 5, 6, 1, 11, 0, 11, 1, 11, 0, 7, 4, 7, 0 },// 33 + { 1, 7, 0, 4, 7, 11, 6, 5, 1, -1, -1, -1, -1, -1, -1}}, +/* 109: 0, 2, 3, 5, 6, */ {{ 4, 9, 6, 1, 6, 9, 6, 1, 11, 0, 11, 1, 11, 0, 8 },// 34 + { 1, 7, 0, 8, 11, 6, 4, 9, 1, -1, -1, -1, -1, -1, -1}}, +/* 117: 0, 2, 4, 5, 6, */ {{ 3, 0, 7, 9, 7, 0, 7, 9, 6, 1, 6, 9, 6, 1, 2 },// 35 + { 1, 7, 0, 9, 1, 2, 6, 7, 3, -1, -1, -1, -1, -1, -1}}, +/* 213: 0, 2, 4, 6, 7, */ {{ 1, 2, 5, 11, 5, 2, 5, 11, 4, 3, 4, 11, 4, 3, 0 },// 36 + { 1, 7, 0, 4, 5, 1, 2, 11, 3, -1, -1, -1, -1, -1, -1}}, +/* 121: 0, 3, 4, 5, 6, */ {{ 0, 11, 2, 11, 0, 7, 9, 7, 0, 7, 9, 6, 10, 6, 9 },// 37 + { 1, 7, 0, 9, 10, 6, 7, 11, 2, -1, -1, -1, -1, -1, -1}}, +/* 233: 0, 3, 5, 6, 7, */ {{ 0, 8, 2, 7, 2, 8, 2, 7, 10, 4, 10, 7, 10, 4, 9 },// 38 + { 1, 7, 0, 8, 7, 4, 9, 10, 2, -1, -1, -1, -1, -1, -1}}, +/* 62: 1, 2, 3, 4, 5, */ {{ 7, 8, 5, 0, 5, 8, 5, 0, 10, 3, 10, 0, 10, 3, 11 },// 39 + { 1, 7, 0, 3, 11, 10, 5, 7, 8, -1, -1, -1, -1, -1, -1}}, +/* 158: 1, 2, 3, 4, 7, */ {{ 6, 8, 4, 8, 6, 3, 10, 3, 6, 3, 10, 0, 9, 0, 10 },// 40 + { 1, 7, 0, 3, 8, 4, 6, 10, 9, -1, -1, -1, -1, -1, -1}}, +/* 174: 1, 2, 3, 5, 7, */ {{ 0, 5, 4, 5, 0, 10, 3, 10, 0, 10, 3, 6, 7, 6, 3 },// 41 + { 1, 7, 0, 3, 7, 6, 10, 5, 4, -1, -1, -1, -1, -1, -1}}, +/* 182: 1, 2, 4, 5, 7, */ {{ 2, 10, 0, 5, 0, 10, 0, 5, 8, 6, 8, 5, 8, 6, 11 },// 42 + { 1, 7, 0, 2, 10, 5, 6, 11, 8, -1, -1, -1, -1, -1, -1}}, +/* 214: 1, 2, 4, 6, 7, */ {{ 2, 9, 0, 9, 2, 5, 11, 5, 2, 5, 11, 4, 8, 4, 11 },// 43 + { 1, 7, 0, 2, 11, 8, 4, 5, 9, -1, -1, -1, -1, -1, -1}}, +/* 186: 1, 3, 4, 5, 7, */ {{ 2, 3, 6, 8, 6, 3, 6, 8, 5, 0, 5, 8, 5, 0, 1 },// 44 + { 1, 7, 0, 1, 5, 6, 2, 3, 8, -1, -1, -1, -1, -1, -1}}, +/* 234: 1, 3, 5, 6, 7, */ {{ 0, 1, 4, 10, 4, 1, 4, 10, 7, 2, 7, 10, 7, 2, 3 },// 45 + { 1, 7, 0, 1, 10, 2, 3, 7, 4, -1, -1, -1, -1, -1, -1}}, +/* 124: 2, 3, 4, 5, 6, */ {{ 3, 11, 1, 6, 1, 11, 1, 6, 9, 7, 9, 6, 9, 7, 8 },// 46 + { 1, 7, 1, 3, 11, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1}}, +/* 188: 2, 3, 4, 5, 7, */ {{ 3, 10, 1, 10, 3, 6, 8, 6, 3, 6, 8, 5, 9, 5, 8 }, // 47 + { 1, 7, 1, 3, 8, 9, 5, 6, 10, -1, -1, -1, -1, -1, -1}} +} ; // Gestione dei casi in configurazione 10 diff --git a/VolZmapGraphics.cpp b/VolZmapGraphics.cpp index af9fe3d..3ffdacd 100644 --- a/VolZmapGraphics.cpp +++ b/VolZmapGraphics.cpp @@ -943,9 +943,9 @@ VolZmap::ProcessCube( int nVoxI, int nVoxJ, int nVoxK, TRIA3DEXLIST& lstTria, Vo // Costruzione dei triangoli for ( int TriIndex = 0 ; TriIndex < 15 ; TriIndex += 3) { // Indici vertici - int i0 = Cases6Plus[nRotCase][TriIndex + 2] ; - int i1 = Cases6Plus[nRotCase][TriIndex + 1] ; - int i2 = Cases6Plus[nRotCase][TriIndex] ; + int i0 = Cases6Plus[nRotCase][0][TriIndex + 2] ; + int i1 = Cases6Plus[nRotCase][0][TriIndex + 1] ; + int i2 = Cases6Plus[nRotCase][0][TriIndex] ; // Costruzione triangolo Triangle3dEx CurrentTriangle ; CurrentTriangle.Set( VecField[i0].ptPApp, VecField[i1].ptPApp, VecField[i2].ptPApp) ; @@ -1541,51 +1541,74 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, VoxelContainer& vV ++ nt ; int nRotCase = nIndexVsIndex6[nt][1] ; - // Costruzione dei triangoli - for ( int TriIndex = 0 ; TriIndex < 15 ; TriIndex += 3) { - // Indici vertici - int i0 = Cases6Plus[nRotCase][TriIndex + 2] ; - int i1 = Cases6Plus[nRotCase][TriIndex + 1] ; - int i2 = Cases6Plus[nRotCase][TriIndex] ; - // Costruzione triangolo - Triangle3dEx CurrentTriangle ; - CurrentTriangle.Set( VecField[i0].ptPApp, VecField[i1].ptPApp, VecField[i2].ptPApp) ; - CurrentTriangle.Validate( true) ; - CurrentTriangle.SetVertexNorm( 0, VecField[i0].vtVec) ; - CurrentTriangle.SetVertexNorm( 1, VecField[i1].vtVec) ; - CurrentTriangle.SetVertexNorm( 2, VecField[i2].vtVec) ; - // Setto il numero di utensile (conta solo positivo, nullo o negativo) - int nTool0 = Clamp( VecField[i0].nPropIndex, -1, 1) ; - int nTool1 = Clamp( VecField[i1].nPropIndex, -1, 1) ; - int nTool2 = Clamp( VecField[i2].nPropIndex, -1, 1) ; - if ( nTool0 == nTool1 || nTool0 == nTool2) - CurrentTriangle.SetGrade( nTool0) ; - else if ( nTool1 == nTool2) - CurrentTriangle.SetGrade( nTool1) ; - // Valido il triangolo e setto le normali del campo vettoriale ai corrispondenti vertici - if ( CurrentTriangle.Validate( true)) { - Vector3d vtVertNorm = VecField[i0].vtVec ; - if ( CurrentTriangle.GetN() * vtVertNorm > 0.6) - CurrentTriangle.SetVertexNorm( 0, vtVertNorm) ; - else - CurrentTriangle.SetVertexNorm( 0, CurrentTriangle.GetN()) ; - vtVertNorm = VecField[i1].vtVec ; - if ( CurrentTriangle.GetN() * vtVertNorm > 0.6) - CurrentTriangle.SetVertexNorm( 1, vtVertNorm) ; - else - CurrentTriangle.SetVertexNorm( 1, CurrentTriangle.GetN()) ; - vtVertNorm = VecField[i2].vtVec ; - if ( CurrentTriangle.GetN() * vtVertNorm > 0.6) - CurrentTriangle.SetVertexNorm( 2, vtVertNorm) ; - else - CurrentTriangle.SetVertexNorm( 2, CurrentTriangle.GetN()) ; + //// Costruzione dei triangoli + //for ( int TriIndex = 0 ; TriIndex < 15 ; TriIndex += 3) { + // // Indici vertici + // int i0 = Cases6Plus[nRotCase][TriIndex + 2] ; + // int i1 = Cases6Plus[nRotCase][TriIndex + 1] ; + // int i2 = Cases6Plus[nRotCase][TriIndex] ; + // // Costruzione triangolo + // Triangle3dEx CurrentTriangle ; + // CurrentTriangle.Set( VecField[i0].ptPApp, VecField[i1].ptPApp, VecField[i2].ptPApp) ; + // CurrentTriangle.Validate( true) ; + // CurrentTriangle.SetVertexNorm( 0, VecField[i0].vtVec) ; + // CurrentTriangle.SetVertexNorm( 1, VecField[i1].vtVec) ; + // CurrentTriangle.SetVertexNorm( 2, VecField[i2].vtVec) ; + // // Setto il numero di utensile (conta solo positivo, nullo o negativo) + // int nTool0 = Clamp( VecField[i0].nPropIndex, -1, 1) ; + // int nTool1 = Clamp( VecField[i1].nPropIndex, -1, 1) ; + // int nTool2 = Clamp( VecField[i2].nPropIndex, -1, 1) ; + // if ( nTool0 == nTool1 || nTool0 == nTool2) + // CurrentTriangle.SetGrade( nTool0) ; + // else if ( nTool1 == nTool2) + // CurrentTriangle.SetGrade( nTool1) ; + // // Valido il triangolo e setto le normali del campo vettoriale ai corrispondenti vertici + // if ( CurrentTriangle.Validate( true)) { + // Vector3d vtVertNorm = VecField[i0].vtVec ; + // if ( CurrentTriangle.GetN() * vtVertNorm > 0.6) + // CurrentTriangle.SetVertexNorm( 0, vtVertNorm) ; + // else + // CurrentTriangle.SetVertexNorm( 0, CurrentTriangle.GetN()) ; + // vtVertNorm = VecField[i1].vtVec ; + // if ( CurrentTriangle.GetN() * vtVertNorm > 0.6) + // CurrentTriangle.SetVertexNorm( 1, vtVertNorm) ; + // else + // CurrentTriangle.SetVertexNorm( 1, CurrentTriangle.GetN()) ; + // vtVertNorm = VecField[i2].vtVec ; + // if ( CurrentTriangle.GetN() * vtVertNorm > 0.6) + // CurrentTriangle.SetVertexNorm( 2, vtVertNorm) ; + // else + // CurrentTriangle.SetVertexNorm( 2, CurrentTriangle.GetN()) ; + // } + // // Riporto il triangolo nel sistema in cui è immerso quello dello Zmap + // CurrentTriangle.ToGlob( m_MapFrame) ; + // // Aggiungo alla lista + // lstTria.emplace_back( CurrentTriangle) ; + //} + //continue ; + + // Aggiorno numero di componenti + nComponents = Cases6Plus[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] = Cases6Plus[nRotCase][1][nC] ; + // Matrice dei vertici della base del fan + for ( int nFanVert = 0 ; nFanVert < nVertComp[nC - 1] ; ++ nFanVert) + CompoVert[nC - 1][nFanVert] = VecField[Cases6Plus[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[Cases6Plus[nRotCase][0][nStdTabOff + nTriVert+2]] ; + CompoTriVert[nC - 1][nTriVert+1] = VecField[Cases6Plus[nRotCase][0][nStdTabOff + nTriVert+1]] ; + CompoTriVert[nC - 1][nTriVert+2] = VecField[Cases6Plus[nRotCase][0][nStdTabOff + nTriVert]] ; } - // Riporto il triangolo nel sistema in cui è immerso quello dello Zmap - CurrentTriangle.ToGlob( m_MapFrame) ; - // Aggiungo alla lista - lstTria.emplace_back( CurrentTriangle) ; - } - continue ; + // Aggiorno gli offsets per raggiungere i vertici della componente successiva. + nExtTabOff += nVertComp[nC - 1] ; + nStdTabOff += 3 * ( nVertComp[nC - 1] - 2) ; + } } }