diff --git a/include/xdg/vec3da.h b/include/xdg/vec3da.h index 1ff41f4d..c62731ed 100644 --- a/include/xdg/vec3da.h +++ b/include/xdg/vec3da.h @@ -147,7 +147,7 @@ __forceinline double dot( const Vec3da& a, const Vec3da& b ) { return a.dot(b); __forceinline Vec3da cross( const Vec3da& a, const Vec3da& b ) { return a.cross(b); } __forceinline std::ostream& operator <<(std::ostream &os, Vec3da const& v) { - return os << '[' << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' << v.a << ']'; + return os << '[' << v[0] << ' ' << v[1] << ' ' << v[2] << ']'; } //! Determine if a position is lexicographically higher or lower than another diff --git a/tools/find_volume.cpp b/tools/find_volume.cpp index 80f9a839..5fd18107 100644 --- a/tools/find_volume.cpp +++ b/tools/find_volume.cpp @@ -47,7 +47,6 @@ int main(int argc, char** argv) { const auto& mm = xdg->mesh_manager(); mm->load_file(args.get("filename")); mm->init(); - mm->parse_metadata(); xdg->prepare_raytracer(); if (args.get("--list")) { @@ -63,11 +62,32 @@ int main(int argc, char** argv) { MeshID volume = xdg->find_volume(position, direction); + std::cout << "Find Volume" << std::endl; + std::cout << "-----------" << std::endl; if (volume == ID_NONE) { std::cout << "No volume found for position " << position << std::endl; } else { std::cout << "Point " << position << " is in Volume " << volume << std::endl; } + std::cout << "-----------" << std::endl; + + // perform the same check using a point in volume loop + MeshID piv_volume = ID_NONE; + for (auto volume_id : mm->volumes()) { + if (xdg->point_in_volume(volume_id, position, &direction)) { + piv_volume = volume_id; + break; + } + } + + std::cout << "Point in Volume" << std::endl; + std::cout << "---------------" << std::endl; + if (piv_volume == ID_NONE) { + std::cout << "No volume found for position " << position << std::endl; + } else { + std::cout << "Point " << position << " is in Volume " << piv_volume << std::endl; + } + std::cout << "---------------" << std::endl; return 0; } \ No newline at end of file