| 1178 | } |
| 1179 | |
| 1180 | void TriangleMetric::test() { |
| 1181 | TriangleMetric tm; |
| 1182 | Point t1[3] = { |
| 1183 | Point(2.000098712, -0.04524066013, -0.9999982602), |
| 1184 | Point(1.999842166, -0.04465568953, 1.359489154e-05), |
| 1185 | Point(2.999878476, -0.04524056265, 1.530231913e-05) |
| 1186 | }; |
| 1187 | Point t2[3] = { |
| 1188 | Point(3.000113436, -0.04465617663, -0.9999897823), |
| 1189 | Point(3.999907166, -0.02901589298, 2.439938101e-05), |
| 1190 | Point(4.000050746, -0.02771025116, -0.9999683076) |
| 1191 | }; |
| 1192 | tm.update(t1[0], t1[1], t1[2], t2[0], t2[1], t2[2]); |
| 1193 | tm.m_ft_types[0] = EDGE; |
| 1194 | tm.m_ft_types[1] = EDGE; |
| 1195 | tm.m_ft_idx[0] = 2; |
| 1196 | tm.m_ft_idx[1] = 2; |
| 1197 | |
| 1198 | Point p1, p2; |
| 1199 | //Real d = tm.getClosestPts(p1, p2); |
| 1200 | std::cout << "p1: " << p1[0] << ", " << p1[1] << ", " << p1[2] << std::endl; |
| 1201 | std::cout << "p2: " << p2[0] << ", " << p2[1] << ", " << p2[2] << std::endl; |
| 1202 | std::cout << "dist is " << (p1 - p2).squaredNorm() << std::endl; |
| 1203 | tm.print(); |
| 1204 | //bool done = tm.EFCase(1, 0, p2, p1); |
| 1205 | //std::cout << "done? " << done << std::endl; |
| 1206 | //std::cout << "p1: " << p1[0] << ", " << p1[1] << ", " << p1[2] << std::endl; |
| 1207 | //std::cout << "p2: " << p2[0] << ", " << p2[1] << ", " << p2[2] << std::endl; |
| 1208 | //std::cout << "dist is " << (p1 - p2).squaredNorm() << std::endl; |
| 1209 | //tm.print(); |
| 1210 | |
| 1211 | //tm.getClosestVEPts(t1[0], t2[2], t2[0], p1, p2); |
| 1212 | //std::cout << "p1: " << p1[0] << ", " << p1[1] << ", " << p1[2] << std::endl; |
| 1213 | //std::cout << "p2: " << p2[0] << ", " << p2[1] << ", " << p2[2] << std::endl; |
| 1214 | //std::cout << "dist is " << (p1 - p2).squaredNorm() << std::endl; |
| 1215 | |
| 1216 | //tm.getClosestEEPts(t2[0], t2[1], t1[1], t1[2], p2, p1); |
| 1217 | //std::cout << "p1: " << p1[0] << ", " << p1[1] << ", " << p1[2] << std::endl; |
| 1218 | //std::cout << "p2: " << p2[0] << ", " << p2[1] << ", " << p2[2] << std::endl; |
| 1219 | //std::cout << "dist is " << (p1 - p2).squaredNorm() << std::endl; |
| 1220 | } |