From 2a4b878fd5da23553fa8f953b71ee3f81885532f Mon Sep 17 00:00:00 2001 From: spelufo Date: Mon, 30 Oct 2023 19:41:17 -0300 Subject: [PATCH 01/12] Try to output normals with a consitent orientation for convex meshes. --- .../include/vc/meshing/CalculateNormals.hpp | 2 + meshing/src/CalculateNormals.cpp | 45 ++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/meshing/include/vc/meshing/CalculateNormals.hpp b/meshing/include/vc/meshing/CalculateNormals.hpp index 644318418..c5c419eb2 100644 --- a/meshing/include/vc/meshing/CalculateNormals.hpp +++ b/meshing/include/vc/meshing/CalculateNormals.hpp @@ -84,5 +84,7 @@ class CalculateNormals /** Storage for summed normals, organized by vertex ID */ std::vector vertexNormals_; + + bool flippedNormals_; }; } // namespace volcart::meshing diff --git a/meshing/src/CalculateNormals.cpp b/meshing/src/CalculateNormals.cpp index 915bcf2ca..1ca4f1381 100644 --- a/meshing/src/CalculateNormals.cpp +++ b/meshing/src/CalculateNormals.cpp @@ -22,6 +22,28 @@ void CalculateNormals::compute_normals_() { vertexNormals_ = std::vector(output_->GetNumberOfPoints(), 0); + // Compute the average mesh coordinates, to use as reference when choosing + // an orientation for the mesh normals. Should produce consistent result on + // convex-ish meshes. + unsigned int pointCount = 0; + ITKPoint pointAverage; + pointAverage.Fill(0.0); + for (auto it = input_->GetPoints()->Begin(); it != input_->GetPoints()->End(); ++it) { + auto point = it.Value(); + pointAverage[0] += point[0]; + pointAverage[1] += point[1]; + pointAverage[2] += point[2]; + pointCount++; + } + if (pointCount > 0) { + pointAverage[0] /= pointCount; + pointAverage[1] /= pointCount; + pointAverage[2] /= pointCount; + } + + unsigned int outwardNormalsCount = 0; + unsigned int inwardNormalsCount = 0; + for (auto cellIt = input_->GetCells()->Begin(); cellIt != input_->GetCells()->End(); ++cellIt) { @@ -38,21 +60,29 @@ void CalculateNormals::compute_normals_() // To-Do: #185 + ITKPoint facePoint; + facePoint.Fill(0.0); + // Collect the vertex info for each point vert = input_->GetPoint(pointIds[0]); v0(0) = vert[0]; v0(1) = vert[1]; v0(2) = vert[2]; + facePoint += vert; vert = input_->GetPoint(pointIds[1]); v1(0) = vert[0]; v1(1) = vert[1]; v1(2) = vert[2]; + facePoint += vert; vert = input_->GetPoint(pointIds[2]); v2(0) = vert[0]; v2(1) = vert[1]; v2(2) = vert[2]; + facePoint += vert; + + facePoint /= 3.0; // Get the edge vectors e0 = v2 - v0; @@ -62,11 +92,20 @@ void CalculateNormals::compute_normals_() cv::Vec3d normals; normals = e1.cross(e0); + // Accumulate the relative direction of the normals for this face. + if (normals.dot(facePoint - pointAverage) > 0) { + outwardNormalsCount++; + } else { + inwardNormalsCount++; + } + // Add the norm for this face to the running sum for each vertex vertexNormals_[pointIds[0]] += normals; vertexNormals_[pointIds[1]] += normals; vertexNormals_[pointIds[2]] += normals; } + + flippedNormals_ = outwardNormalsCount > inwardNormalsCount; } void CalculateNormals::assign_to_mesh_() @@ -76,6 +115,10 @@ void CalculateNormals::assign_to_mesh_() cv::Vec3d norm = vertexNormals_[point.Index()]; cv::normalize(norm, norm); - output_->SetPointData(point.Index(), norm.val); + auto val = norm.val; + if (flippedNormals_) { + val = -val; + } + output_->SetPointData(point.Index(), val); } } From e338234472751fdd5b1ebf039e6ccc2df96af34d Mon Sep 17 00:00:00 2001 From: spelufo Date: Mon, 30 Oct 2023 20:15:56 -0300 Subject: [PATCH 02/12] Get it to compile. --- meshing/src/CalculateNormals.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/meshing/src/CalculateNormals.cpp b/meshing/src/CalculateNormals.cpp index 1ca4f1381..ddbfdf1cc 100644 --- a/meshing/src/CalculateNormals.cpp +++ b/meshing/src/CalculateNormals.cpp @@ -68,21 +68,29 @@ void CalculateNormals::compute_normals_() v0(0) = vert[0]; v0(1) = vert[1]; v0(2) = vert[2]; - facePoint += vert; + facePoint[0] += vert[0]; + facePoint[1] += vert[1]; + facePoint[2] += vert[2]; vert = input_->GetPoint(pointIds[1]); v1(0) = vert[0]; v1(1) = vert[1]; v1(2) = vert[2]; - facePoint += vert; + facePoint[0] += vert[0]; + facePoint[1] += vert[1]; + facePoint[2] += vert[2]; vert = input_->GetPoint(pointIds[2]); v2(0) = vert[0]; v2(1) = vert[1]; v2(2) = vert[2]; - facePoint += vert; + facePoint[0] += vert[0]; + facePoint[1] += vert[1]; + facePoint[2] += vert[2]; - facePoint /= 3.0; + facePoint[0] /= 3.0; + facePoint[1] /= 3.0; + facePoint[2] /= 3.0; // Get the edge vectors e0 = v2 - v0; @@ -93,7 +101,8 @@ void CalculateNormals::compute_normals_() normals = e1.cross(e0); // Accumulate the relative direction of the normals for this face. - if (normals.dot(facePoint - pointAverage) > 0) { + cv::Vec3d itkVecToCvVec(facePoint[0] - pointAverage[0], facePoint[1] - pointAverage[1], facePoint[2] - pointAverage[2]); + if (normals.dot(itkVecToCvVec) > 0) { outwardNormalsCount++; } else { inwardNormalsCount++; @@ -115,10 +124,9 @@ void CalculateNormals::assign_to_mesh_() cv::Vec3d norm = vertexNormals_[point.Index()]; cv::normalize(norm, norm); - auto val = norm.val; if (flippedNormals_) { - val = -val; + norm = -norm; } - output_->SetPointData(point.Index(), val); + output_->SetPointData(point.Index(), norm.val); } } From c6714f2a727348292eb4671c40ef76677c97c880 Mon Sep 17 00:00:00 2001 From: spelufo Date: Wed, 1 Nov 2023 06:51:59 -0300 Subject: [PATCH 03/12] Mesh normals orientation PR changes. --- .../include/vc/meshing/CalculateNormals.hpp | 14 ++++ meshing/src/CalculateNormals.cpp | 82 +++++++------------ 2 files changed, 45 insertions(+), 51 deletions(-) diff --git a/meshing/include/vc/meshing/CalculateNormals.hpp b/meshing/include/vc/meshing/CalculateNormals.hpp index c5c419eb2..e504aa8d9 100644 --- a/meshing/include/vc/meshing/CalculateNormals.hpp +++ b/meshing/include/vc/meshing/CalculateNormals.hpp @@ -59,6 +59,15 @@ class CalculateNormals */ ITKMesh::Pointer compute(); + /** + * @brief Flag specifying if we should reorient normals. + * + * If this flag is set and most of the mesh's normals are facing outwards + * relative to the mesh's centroid, then they're considered flipped, and + * will be reversed to face inwards, the conventionally positive direction. + */ + bool shouldOrientNormals = true; + private: /** * @brief Compute normals for each vertex. @@ -76,6 +85,11 @@ class CalculateNormals */ void assign_to_mesh_(); + /** + * @brief Compute the mesh's centroid, the arithmetic mean of its vertices. + */ + cv::Vec3d compute_mesh_centroid_(); + /** Mesh for which normals will be calculated. */ ITKMesh::Pointer input_; diff --git a/meshing/src/CalculateNormals.cpp b/meshing/src/CalculateNormals.cpp index ddbfdf1cc..f2d6aed58 100644 --- a/meshing/src/CalculateNormals.cpp +++ b/meshing/src/CalculateNormals.cpp @@ -22,34 +22,16 @@ void CalculateNormals::compute_normals_() { vertexNormals_ = std::vector(output_->GetNumberOfPoints(), 0); - // Compute the average mesh coordinates, to use as reference when choosing - // an orientation for the mesh normals. Should produce consistent result on - // convex-ish meshes. - unsigned int pointCount = 0; - ITKPoint pointAverage; - pointAverage.Fill(0.0); - for (auto it = input_->GetPoints()->Begin(); it != input_->GetPoints()->End(); ++it) { - auto point = it.Value(); - pointAverage[0] += point[0]; - pointAverage[1] += point[1]; - pointAverage[2] += point[2]; - pointCount++; - } - if (pointCount > 0) { - pointAverage[0] /= pointCount; - pointAverage[1] /= pointCount; - pointAverage[2] /= pointCount; - } + // Compute the mesh centroid to use as reference when deciding if the mesh + // normals are flipped. Should produce consistent result on convex meshes. + cv::Vec3d meshCentroid = compute_mesh_centroid_(); - unsigned int outwardNormalsCount = 0; - unsigned int inwardNormalsCount = 0; + std::size_t outwardNormalsCount = 0; + std::size_t inwardNormalsCount = 0; for (auto cellIt = input_->GetCells()->Begin(); cellIt != input_->GetCells()->End(); ++cellIt) { - // Empty vectors for the vertex and edge info - cv::Vec3d v0, v1, v2, e0, e1; - // Collect the point id's for this cell std::vector pointIds; ITKPoint vert; @@ -60,49 +42,34 @@ void CalculateNormals::compute_normals_() // To-Do: #185 - ITKPoint facePoint; - facePoint.Fill(0.0); + cv::Vec3d faceCentroid(0.0, 0.0, 0.0); // Collect the vertex info for each point vert = input_->GetPoint(pointIds[0]); - v0(0) = vert[0]; - v0(1) = vert[1]; - v0(2) = vert[2]; - facePoint[0] += vert[0]; - facePoint[1] += vert[1]; - facePoint[2] += vert[2]; + cv::Vec3d v0(vert[0], vert[1], vert[2]); + faceCentroid += v0; vert = input_->GetPoint(pointIds[1]); - v1(0) = vert[0]; - v1(1) = vert[1]; - v1(2) = vert[2]; - facePoint[0] += vert[0]; - facePoint[1] += vert[1]; - facePoint[2] += vert[2]; + cv::Vec3d v1(vert[0], vert[1], vert[2]); + faceCentroid += v1; vert = input_->GetPoint(pointIds[2]); - v2(0) = vert[0]; - v2(1) = vert[1]; - v2(2) = vert[2]; - facePoint[0] += vert[0]; - facePoint[1] += vert[1]; - facePoint[2] += vert[2]; + cv::Vec3d v2(vert[0], vert[1], vert[2]); + faceCentroid += v2; - facePoint[0] /= 3.0; - facePoint[1] /= 3.0; - facePoint[2] /= 3.0; + // Centroid is the average of the three points of the face. + faceCentroid /= 3.; // Get the edge vectors - e0 = v2 - v0; - e1 = v1 - v0; + cv::Vec3d e0 = v2 - v0; + cv::Vec3d e1 = v1 - v0; // Take the cross-product cv::Vec3d normals; normals = e1.cross(e0); // Accumulate the relative direction of the normals for this face. - cv::Vec3d itkVecToCvVec(facePoint[0] - pointAverage[0], facePoint[1] - pointAverage[1], facePoint[2] - pointAverage[2]); - if (normals.dot(itkVecToCvVec) > 0) { + if (normals.dot(faceCentroid - meshCentroid) > 0) { outwardNormalsCount++; } else { inwardNormalsCount++; @@ -114,6 +81,7 @@ void CalculateNormals::compute_normals_() vertexNormals_[pointIds[2]] += normals; } + // If more face normals were facing outwards than inwards, they are flipped. flippedNormals_ = outwardNormalsCount > inwardNormalsCount; } @@ -124,9 +92,21 @@ void CalculateNormals::assign_to_mesh_() cv::Vec3d norm = vertexNormals_[point.Index()]; cv::normalize(norm, norm); - if (flippedNormals_) { + if (shouldOrientNormals && flippedNormals_) { norm = -norm; } output_->SetPointData(point.Index(), norm.val); } } + +cv::Vec3d CalculateNormals::compute_mesh_centroid_() { + cv::Vec3d meshCentroid(0.0, 0.0, 0.0); + double pointCount = 1.0; + for (auto it = input_->GetPoints()->Begin(); it != input_->GetPoints()->End(); ++it) { + auto vert = it.Value(); + cv::Vec3d point(vert[0], vert[1], vert[2]); + meshCentroid = meshCentroid + (point - meshCentroid)/pointCount; + pointCount += 1.0; + } + return meshCentroid; +} From 9d00574063b8089cb3ae4516c67c3b49e6b72084 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Wed, 1 Nov 2023 15:10:01 -0400 Subject: [PATCH 04/12] Move normal orientation code to a new class --- meshing/CMakeLists.txt | 1 + .../include/vc/meshing/CalculateNormals.hpp | 16 ---- meshing/include/vc/meshing/OrientNormals.hpp | 32 ++++++++ meshing/src/CalculateNormals.cpp | 59 ++++--------- meshing/src/OrientNormals.cpp | 82 +++++++++++++++++++ 5 files changed, 129 insertions(+), 61 deletions(-) create mode 100644 meshing/include/vc/meshing/OrientNormals.hpp create mode 100644 meshing/src/OrientNormals.cpp diff --git a/meshing/CMakeLists.txt b/meshing/CMakeLists.txt index e92c6bbe0..813681bb9 100644 --- a/meshing/CMakeLists.txt +++ b/meshing/CMakeLists.txt @@ -9,6 +9,7 @@ set(srcs src/SmoothNormals.cpp src/OrderedResampling.cpp src/OrderedPointSetMesher.cpp + src/OrientNormals.cpp src/UVMapToITKMesh.cpp src/LaplacianSmooth.cpp ) diff --git a/meshing/include/vc/meshing/CalculateNormals.hpp b/meshing/include/vc/meshing/CalculateNormals.hpp index e504aa8d9..644318418 100644 --- a/meshing/include/vc/meshing/CalculateNormals.hpp +++ b/meshing/include/vc/meshing/CalculateNormals.hpp @@ -59,15 +59,6 @@ class CalculateNormals */ ITKMesh::Pointer compute(); - /** - * @brief Flag specifying if we should reorient normals. - * - * If this flag is set and most of the mesh's normals are facing outwards - * relative to the mesh's centroid, then they're considered flipped, and - * will be reversed to face inwards, the conventionally positive direction. - */ - bool shouldOrientNormals = true; - private: /** * @brief Compute normals for each vertex. @@ -85,11 +76,6 @@ class CalculateNormals */ void assign_to_mesh_(); - /** - * @brief Compute the mesh's centroid, the arithmetic mean of its vertices. - */ - cv::Vec3d compute_mesh_centroid_(); - /** Mesh for which normals will be calculated. */ ITKMesh::Pointer input_; @@ -98,7 +84,5 @@ class CalculateNormals /** Storage for summed normals, organized by vertex ID */ std::vector vertexNormals_; - - bool flippedNormals_; }; } // namespace volcart::meshing diff --git a/meshing/include/vc/meshing/OrientNormals.hpp b/meshing/include/vc/meshing/OrientNormals.hpp new file mode 100644 index 000000000..6b809d19e --- /dev/null +++ b/meshing/include/vc/meshing/OrientNormals.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "vc/core/types/ITKMesh.hpp" + +namespace volcart::meshing +{ +class OrientNormals +{ +public: + OrientNormals() = default; + + /** + * @brief Set the input mesh. + * @param mesh The mesh for which normals will be calculated + */ + void setMesh(const ITKMesh::Pointer& mesh); + + /** + * @brief Get the output mesh with computed normals + */ + [[nodiscard]] auto getMesh() const -> ITKMesh::Pointer; + + /** + * @brief Compute vertex normals for the mesh. + */ + auto compute() -> ITKMesh::Pointer; + +private: + ITKMesh::Pointer input_; + ITKMesh::Pointer output_; +}; +} // namespace volcart::meshing diff --git a/meshing/src/CalculateNormals.cpp b/meshing/src/CalculateNormals.cpp index f2d6aed58..915bcf2ca 100644 --- a/meshing/src/CalculateNormals.cpp +++ b/meshing/src/CalculateNormals.cpp @@ -22,16 +22,12 @@ void CalculateNormals::compute_normals_() { vertexNormals_ = std::vector(output_->GetNumberOfPoints(), 0); - // Compute the mesh centroid to use as reference when deciding if the mesh - // normals are flipped. Should produce consistent result on convex meshes. - cv::Vec3d meshCentroid = compute_mesh_centroid_(); - - std::size_t outwardNormalsCount = 0; - std::size_t inwardNormalsCount = 0; - for (auto cellIt = input_->GetCells()->Begin(); cellIt != input_->GetCells()->End(); ++cellIt) { + // Empty vectors for the vertex and edge info + cv::Vec3d v0, v1, v2, e0, e1; + // Collect the point id's for this cell std::vector pointIds; ITKPoint vert; @@ -42,47 +38,35 @@ void CalculateNormals::compute_normals_() // To-Do: #185 - cv::Vec3d faceCentroid(0.0, 0.0, 0.0); - // Collect the vertex info for each point vert = input_->GetPoint(pointIds[0]); - cv::Vec3d v0(vert[0], vert[1], vert[2]); - faceCentroid += v0; + v0(0) = vert[0]; + v0(1) = vert[1]; + v0(2) = vert[2]; vert = input_->GetPoint(pointIds[1]); - cv::Vec3d v1(vert[0], vert[1], vert[2]); - faceCentroid += v1; + v1(0) = vert[0]; + v1(1) = vert[1]; + v1(2) = vert[2]; vert = input_->GetPoint(pointIds[2]); - cv::Vec3d v2(vert[0], vert[1], vert[2]); - faceCentroid += v2; - - // Centroid is the average of the three points of the face. - faceCentroid /= 3.; + v2(0) = vert[0]; + v2(1) = vert[1]; + v2(2) = vert[2]; // Get the edge vectors - cv::Vec3d e0 = v2 - v0; - cv::Vec3d e1 = v1 - v0; + e0 = v2 - v0; + e1 = v1 - v0; // Take the cross-product cv::Vec3d normals; normals = e1.cross(e0); - // Accumulate the relative direction of the normals for this face. - if (normals.dot(faceCentroid - meshCentroid) > 0) { - outwardNormalsCount++; - } else { - inwardNormalsCount++; - } - // Add the norm for this face to the running sum for each vertex vertexNormals_[pointIds[0]] += normals; vertexNormals_[pointIds[1]] += normals; vertexNormals_[pointIds[2]] += normals; } - - // If more face normals were facing outwards than inwards, they are flipped. - flippedNormals_ = outwardNormalsCount > inwardNormalsCount; } void CalculateNormals::assign_to_mesh_() @@ -92,21 +76,6 @@ void CalculateNormals::assign_to_mesh_() cv::Vec3d norm = vertexNormals_[point.Index()]; cv::normalize(norm, norm); - if (shouldOrientNormals && flippedNormals_) { - norm = -norm; - } output_->SetPointData(point.Index(), norm.val); } } - -cv::Vec3d CalculateNormals::compute_mesh_centroid_() { - cv::Vec3d meshCentroid(0.0, 0.0, 0.0); - double pointCount = 1.0; - for (auto it = input_->GetPoints()->Begin(); it != input_->GetPoints()->End(); ++it) { - auto vert = it.Value(); - cv::Vec3d point(vert[0], vert[1], vert[2]); - meshCentroid = meshCentroid + (point - meshCentroid)/pointCount; - pointCount += 1.0; - } - return meshCentroid; -} diff --git a/meshing/src/OrientNormals.cpp b/meshing/src/OrientNormals.cpp new file mode 100644 index 000000000..b9edb34fe --- /dev/null +++ b/meshing/src/OrientNormals.cpp @@ -0,0 +1,82 @@ +#include "vc/meshing/OrientNormals.hpp" + +#include + +#include "vc/meshing/DeepCopy.hpp" + +using namespace volcart; +using namespace volcart::meshing; + +namespace +{ +auto ComputeMeshCentroid(const ITKMesh::Pointer& mesh) -> cv::Vec3d +{ + cv::Vec3d centroid{0, 0, 0}; + double cnt = 1.; + for (auto it = mesh->GetPoints()->Begin(); it != mesh->GetPoints()->End(); + ++it) { + auto vert = it.Value(); + const cv::Vec3d point{vert[0], vert[1], vert[2]}; + centroid = centroid + (point - centroid) / cnt; + cnt += 1.; + } + return centroid; +} +} // namespace + +void OrientNormals::setMesh(const ITKMesh::Pointer& mesh) { input_ = mesh; } + +auto OrientNormals::getMesh() const -> ITKMesh::Pointer { return output_; } + +auto OrientNormals::compute() -> ITKMesh::Pointer +{ + // Compute the mesh refPt + auto refPt = ::ComputeMeshCentroid(input_); + + // Get a count of the vectors which points towards and away from the + // reference point + std::size_t coDir{0}; + std::size_t antiDir{0}; + + for (auto it = input_->GetPoints()->Begin(); + it != input_->GetPoints()->End(); ++it) { + // Temp variables + ITKPoint vert; + ITKPixel normal; + + // Convert point data to cv::Vec3d + vert = it->Value(); + input_->GetPointData(it.Index(), &normal); + cv::Vec3d pt{vert[0], vert[1], vert[2]}; + cv::Vec3d n{normal[0], normal[1], normal[2]}; + n = cv::normalize(n); + + // Accumulate the relative direction of the normals for this face. + if (n.dot(cv::normalize(refPt - pt)) > 0) { + coDir++; + } else { + antiDir++; + } + } + + // If more face normals were facing outwards than inwards, they are flipped. + auto flip = antiDir > coDir; + + // Setup output mesh + output_ = ITKMesh::New(); + DeepCopy(input_, output_); + + // Flip the normals as required + if (flip) { + for (auto it = input_->GetPoints()->Begin(); + it != input_->GetPoints()->End(); ++it) { + // Convert point data to cv::Vec3d + ITKPixel normal; + input_->GetPointData(it.Index(), &normal); + normal *= -1; + input_->SetPointData(it.Index(), normal); + } + } + + return output_; +} From 457dc3d5588a3631db1345ccbd303580878ed436 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 10:25:03 -0400 Subject: [PATCH 05/12] Fill out the interface to support manual reference point --- meshing/include/vc/meshing/OrientNormals.hpp | 46 +++++++++++++++++--- meshing/src/OrientNormals.cpp | 24 ++++++++-- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/meshing/include/vc/meshing/OrientNormals.hpp b/meshing/include/vc/meshing/OrientNormals.hpp index 6b809d19e..bf32902f7 100644 --- a/meshing/include/vc/meshing/OrientNormals.hpp +++ b/meshing/include/vc/meshing/OrientNormals.hpp @@ -1,32 +1,64 @@ #pragma once +/** @file */ + +#include + #include "vc/core/types/ITKMesh.hpp" namespace volcart::meshing { + +/** + * @class OrientNormals + * + * @brief Orient vertex normals towards a reference point. + */ class OrientNormals { public: + /** @brief Reference point mode */ + enum class ReferenceMode { + Centroid, /** Mesh centroid reference point for convex meshes. */ + Manual /** Point provided by setReferencePoint(). */ + }; + + /** @brief Default constructor */ OrientNormals() = default; - /** - * @brief Set the input mesh. - * @param mesh The mesh for which normals will be calculated - */ + /** @brief Set the input mesh */ void setMesh(const ITKMesh::Pointer& mesh); + /** @brief Get the output mesh with updated normals */ + [[nodiscard]] auto getMesh() const -> ITKMesh::Pointer; + /** - * @brief Get the output mesh with computed normals + * @brief Set reference point mode + * + * Determines which automatically calculated reference point to use. See + * ReferenceMode for more details. */ - [[nodiscard]] auto getMesh() const -> ITKMesh::Pointer; + void setReferenceMode(ReferenceMode mode); /** - * @brief Compute vertex normals for the mesh. + * @brief Set manual reference point + * + * If provided, automatically sets the reference mode to + * ReferenceMode::Manual. */ + void setReferencePoint(const cv::Vec3d& point); + + /** @brief Compute vertex normal reorientation */ auto compute() -> ITKMesh::Pointer; private: + /** Input mesh */ ITKMesh::Pointer input_; + /** Reference point mode */ + ReferenceMode mode_{ReferenceMode::Centroid}; + /** User-defined reference point */ + cv::Vec3d refPt_; + /** Output mesh */ ITKMesh::Pointer output_; }; } // namespace volcart::meshing diff --git a/meshing/src/OrientNormals.cpp b/meshing/src/OrientNormals.cpp index b9edb34fe..810b48c8e 100644 --- a/meshing/src/OrientNormals.cpp +++ b/meshing/src/OrientNormals.cpp @@ -1,7 +1,5 @@ #include "vc/meshing/OrientNormals.hpp" -#include - #include "vc/meshing/DeepCopy.hpp" using namespace volcart; @@ -28,10 +26,28 @@ void OrientNormals::setMesh(const ITKMesh::Pointer& mesh) { input_ = mesh; } auto OrientNormals::getMesh() const -> ITKMesh::Pointer { return output_; } +void OrientNormals::setReferenceMode(OrientNormals::ReferenceMode mode) +{ + mode_ = mode; +} + +void OrientNormals::setReferencePoint(const cv::Vec3d& point) +{ + mode_ = ReferenceMode::Manual; + refPt_ = point; +} + auto OrientNormals::compute() -> ITKMesh::Pointer { - // Compute the mesh refPt - auto refPt = ::ComputeMeshCentroid(input_); + // Get the reference point based on the reference mode + cv::Vec3d refPt; + if (mode_ == ReferenceMode::Centroid) { + refPt = ::ComputeMeshCentroid(input_); + } else if (mode_ == ReferenceMode::Manual) { + refPt = refPt_; + } else { + refPt = ::ComputeMeshCentroid(input_); + } // Get a count of the vectors which points towards and away from the // reference point From 6e9f78a81862ad88c0e665456a3919b114cb008d Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 11:28:13 -0400 Subject: [PATCH 06/12] (graph) Add OrientNormalsNode --- core/CMakeLists.txt | 1 + core/include/vc/core/types/Metadata.hpp | 24 +------- core/include/vc/core/util/Json.hpp | 46 ++++++++++++++ graph/include/vc/graph.hpp | 4 +- graph/include/vc/graph/meshing.hpp | 43 +++++++++++++ graph/src/graph.cpp | 3 +- graph/src/meshing.cpp | 65 +++++++++++++++++--- meshing/include/vc/meshing/OrientNormals.hpp | 6 ++ meshing/src/OrientNormals.cpp | 7 +++ 9 files changed, 167 insertions(+), 32 deletions(-) create mode 100644 core/include/vc/core/util/Json.hpp diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 1f211f9e5..5f49a83ae 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -61,6 +61,7 @@ set(util_srcs set(logging_srcs src/Logging.cpp + include/vc/core/util/Json.hpp ) configure_file(src/Version.cpp.in Version.cpp) diff --git a/core/include/vc/core/types/Metadata.hpp b/core/include/vc/core/types/Metadata.hpp index 395bce9ce..51bce2ae0 100644 --- a/core/include/vc/core/types/Metadata.hpp +++ b/core/include/vc/core/types/Metadata.hpp @@ -9,6 +9,7 @@ #include #include "vc/core/filesystem.hpp" +#include "vc/core/util/Json.hpp" namespace volcart { @@ -104,26 +105,3 @@ class Metadata volcart::filesystem::path path_; }; } // namespace volcart - -/** JSON Serializer for cv::Vec */ -namespace nlohmann -{ -template -struct adl_serializer> { - // NOLINTNEXTLINE(readability-identifier-naming): Must be exact signature - static void to_json(nlohmann::json& j, const cv::Vec& v) - { - for (int i = 0; i < Cn; i++) { - j.push_back(v[i]); - } - } - - // NOLINTNEXTLINE(readability-identifier-naming): Must be exact signature - static void from_json(const nlohmann::json& j, cv::Vec& v) - { - for (int i = 0; i < Cn; i++) { - v[i] = j.at(i).get(); - } - } -}; -} // namespace nlohmann diff --git a/core/include/vc/core/util/Json.hpp b/core/include/vc/core/util/Json.hpp new file mode 100644 index 000000000..6094a82a3 --- /dev/null +++ b/core/include/vc/core/util/Json.hpp @@ -0,0 +1,46 @@ +#pragma once + +/** + * @file Json.hpp + * JSON serialization/deserialization type specializations. + */ + +#include + +/** cv::Vec */ +NLOHMANN_JSON_NAMESPACE_BEGIN +template +struct adl_serializer> { + // NOLINTNEXTLINE(readability-identifier-naming): Must be exact signature + static void to_json(json& j, const cv::Vec& v) + { + for (int i = 0; i < Cn; i++) { + j.push_back(v[i]); + } + } + + // NOLINTNEXTLINE(readability-identifier-naming): Must be exact signature + static void from_json(const json& j, cv::Vec& v) + { + for (int i = 0; i < Cn; i++) { + v[i] = j.at(i).get(); + } + } + + // NOLINTNEXTLINE(readability-identifier-naming): Must be exact signature + static void to_json(ordered_json& j, const cv::Vec& v) + { + for (int i = 0; i < Cn; i++) { + j.push_back(v[i]); + } + } + + // NOLINTNEXTLINE(readability-identifier-naming): Must be exact signature + static void from_json(const ordered_json& j, cv::Vec& v) + { + for (int i = 0; i < Cn; i++) { + v[i] = j.at(i).get(); + } + } +}; +NLOHMANN_JSON_NAMESPACE_END \ No newline at end of file diff --git a/graph/include/vc/graph.hpp b/graph/include/vc/graph.hpp index eba8fccd4..aac799b18 100644 --- a/graph/include/vc/graph.hpp +++ b/graph/include/vc/graph.hpp @@ -2,6 +2,8 @@ /** @file */ +#include + #include "vc/graph/core.hpp" #include "vc/graph/meshing.hpp" #include "vc/graph/texturing.hpp" @@ -12,4 +14,4 @@ namespace volcart /** @brief Register all VC provided nodes with the Smeagol library */ void RegisterNodes(); -} // namespace volcart +} // namespace volcart \ No newline at end of file diff --git a/graph/include/vc/graph/meshing.hpp b/graph/include/vc/graph/meshing.hpp index f4c4f18ca..9fe009a45 100644 --- a/graph/include/vc/graph/meshing.hpp +++ b/graph/include/vc/graph/meshing.hpp @@ -11,6 +11,7 @@ #include "vc/meshing/ACVD.hpp" #include "vc/meshing/LaplacianSmooth.hpp" #include "vc/meshing/OrderedPointSetMesher.hpp" +#include "vc/meshing/OrientNormals.hpp" #include "vc/meshing/UVMapToITKMesh.hpp" namespace volcart @@ -261,4 +262,46 @@ class UVMapToMeshNode : public smgl::Node const smgl::Metadata& meta, const filesystem::path& cacheDir) override; }; +/** + * @copybrief meshing::OrientNormals + * + * @see meshing::OrientNormals + * @ingroup Graph + */ +class OrientNormalsNode : public smgl::Node +{ +private: + /** Orient Normals class type */ + using OrientNormals = meshing::OrientNormals; + /** Orient normals compute */ + OrientNormals orientNormals_{}; + /** Output mesh */ + ITKMesh::Pointer output_{nullptr}; + +public: + /** @copydoc OrientNormals::ReferenceMode */ + using ReferenceMode = OrientNormals::ReferenceMode; + + /** @brief Input mesh */ + smgl::InputPort input; + /** @copydoc OrientNormals::setReferenceMode(ReferenceMode) */ + smgl::InputPort referenceMode; + /** @copydoc OrientNormals::setReferencePoint() */ + smgl::InputPort referencePoint; + /** @brief Output mesh */ + smgl::OutputPort output; + + /** Constructor */ + OrientNormalsNode(); + +private: + /** Smeagol custom serialization */ + auto serialize_(bool useCache, const filesystem::path& cacheDir) + -> smgl::Metadata override; + + /** Smeagol custom deserialization */ + void deserialize_( + const smgl::Metadata& meta, const filesystem::path& cacheDir) override; +}; + } // namespace volcart \ No newline at end of file diff --git a/graph/src/graph.cpp b/graph/src/graph.cpp index df55e0aaf..ac7e55a2e 100644 --- a/graph/src/graph.cpp +++ b/graph/src/graph.cpp @@ -38,7 +38,8 @@ static auto RegisterNodesImpl() -> bool CalculateNumVertsNode, LaplacianSmoothMeshNode, ResampleMeshNode, - UVMapToMeshNode + UVMapToMeshNode, + OrientNormalsNode >(); // Texturing diff --git a/graph/src/meshing.cpp b/graph/src/meshing.cpp index 21a8a1d63..063b59a6d 100644 --- a/graph/src/meshing.cpp +++ b/graph/src/meshing.cpp @@ -3,6 +3,7 @@ #include #include "vc/core/io/MeshIO.hpp" +#include "vc/core/util/Json.hpp" #include "vc/meshing/ScaleMesh.hpp" using namespace volcart; @@ -16,7 +17,13 @@ namespace volcart::meshing using ResampleMode = ResampleMeshNode::Mode; NLOHMANN_JSON_SERIALIZE_ENUM(ResampleMode, { {ResampleMode::Isotropic, "isotropic"}, - {ResampleMode::Anisotropic, "Anisotropic"} + {ResampleMode::Anisotropic, "anisotropic"} +}) + +using ReferenceMode = OrientNormalsNode::ReferenceMode; +NLOHMANN_JSON_SERIALIZE_ENUM(ReferenceMode , { + {ReferenceMode::Centroid, "centroid"}, + {ReferenceMode::Manual, "manual"} }) // clang-format on } // namespace volcart::meshing @@ -26,7 +33,7 @@ MeshingNode::MeshingNode() { registerInputPort("points", points); registerOutputPort("mesh", mesh); - compute = [=]() { mesh_ = mesher_.compute(); }; + compute = [this]() { mesh_ = mesher_.compute(); }; } auto MeshingNode::serialize_(bool useCache, const fs::path& cacheDir) @@ -56,7 +63,7 @@ ScaleMeshNode::ScaleMeshNode() registerInputPort("scaleFactor", scaleFactor); registerOutputPort("output", output); - compute = [=]() { + compute = [this]() { if (input_) { output_ = ScaleMesh(input_, scaleFactor_); } @@ -95,7 +102,7 @@ CalculateNumVertsNode::CalculateNumVertsNode() registerInputPort("density", density); registerOutputPort("numVerts", numVerts); - compute = [=]() { + compute = [this]() { using meshmath::SurfaceArea; static constexpr double UM_TO_MM{0.000001}; static constexpr std::size_t MIN_NUM{100}; @@ -127,7 +134,7 @@ LaplacianSmoothMeshNode::LaplacianSmoothMeshNode() { registerInputPort("input", input); registerOutputPort("output", output); - compute = [=]() { mesh_ = smoother_.compute(); }; + compute = [this]() { mesh_ = smoother_.compute(); }; } auto LaplacianSmoothMeshNode::serialize_( @@ -180,7 +187,7 @@ ResampleMeshNode::ResampleMeshNode() registerInputPort("subsampleThreshold", subsampleThreshold); registerInputPort("quadricsOptimizationLevel", quadricsOptimizationLevel); registerOutputPort("output", output); - compute = [=]() { mesh_ = acvd_.compute(); }; + compute = [this]() { mesh_ = acvd_.compute(); }; } auto ResampleMeshNode::serialize_(bool useCache, const fs::path& cacheDir) @@ -227,7 +234,7 @@ UVMapToMeshNode::UVMapToMeshNode() registerInputPort("scaleToUVDimensions", scaleToUVDimensions); registerOutputPort("outputMesh", outputMesh); - compute = [=]() { + compute = [this]() { mesher_.setScaleToUVDimensions(scaleDims_); output_ = mesher_.compute(); }; @@ -253,3 +260,47 @@ void UVMapToMeshNode::deserialize_( output_ = ReadMesh(cacheDir / file).mesh; } } + +OrientNormalsNode::OrientNormalsNode() + : Node{true} + , input{&orientNormals_, &OrientNormals::setMesh} + , referenceMode{&orientNormals_, &OrientNormals::setReferenceMode} + , referencePoint{&orientNormals_, &OrientNormals::setReferencePoint} + , output{&output_} +{ + registerInputPort("input", input); + registerInputPort("referenceMode", referenceMode); + registerInputPort("referencePoint", referencePoint); + registerOutputPort("output", output); + compute = [this]() { output_ = orientNormals_.compute(); }; +} + +auto OrientNormalsNode::serialize_(bool useCache, const fs::path& cacheDir) + -> smgl::Metadata +{ + smgl::Metadata meta{{"referenceMode", orientNormals_.referenceMode()}}; + if (orientNormals_.referenceMode() == ReferenceMode::Manual) { + meta["referencePoint"] = orientNormals_.referencePoint(); + } + if (useCache and output_) { + WriteMesh(cacheDir / "orient_normals.obj", output_); + meta["mesh"] = "orient_normals.obj"; + } + return meta; +} + +void OrientNormalsNode::deserialize_( + const smgl::Metadata& meta, const fs::path& cacheDir) +{ + auto refMode = meta["referenceMode"].get(); + orientNormals_.setReferenceMode(refMode); + if (refMode == ReferenceMode::Manual) { + orientNormals_.setReferencePoint( + meta["referencePoint"].get()); + } + + if (meta.contains("mesh")) { + auto meshFile = meta["mesh"].get(); + output_ = ReadMesh(cacheDir / meshFile).mesh; + } +} \ No newline at end of file diff --git a/meshing/include/vc/meshing/OrientNormals.hpp b/meshing/include/vc/meshing/OrientNormals.hpp index bf32902f7..add06200b 100644 --- a/meshing/include/vc/meshing/OrientNormals.hpp +++ b/meshing/include/vc/meshing/OrientNormals.hpp @@ -40,6 +40,9 @@ class OrientNormals */ void setReferenceMode(ReferenceMode mode); + /** @brief Get the current reference mode */ + [[nodiscard]] auto referenceMode() const -> ReferenceMode; + /** * @brief Set manual reference point * @@ -48,6 +51,9 @@ class OrientNormals */ void setReferencePoint(const cv::Vec3d& point); + /** @brief Get the manually defined reference point */ + [[nodiscard]] auto referencePoint() const -> cv::Vec3d; + /** @brief Compute vertex normal reorientation */ auto compute() -> ITKMesh::Pointer; diff --git a/meshing/src/OrientNormals.cpp b/meshing/src/OrientNormals.cpp index 810b48c8e..2da44a1fc 100644 --- a/meshing/src/OrientNormals.cpp +++ b/meshing/src/OrientNormals.cpp @@ -31,12 +31,19 @@ void OrientNormals::setReferenceMode(OrientNormals::ReferenceMode mode) mode_ = mode; } +auto OrientNormals::referenceMode() const -> OrientNormals::ReferenceMode +{ + return mode_; +} + void OrientNormals::setReferencePoint(const cv::Vec3d& point) { mode_ = ReferenceMode::Manual; refPt_ = point; } +auto OrientNormals::referencePoint() const -> cv::Vec3d { return refPt_; } + auto OrientNormals::compute() -> ITKMesh::Pointer { // Get the reference point based on the reference mode From a70e3b71d7dabacc7cb3522ec8a824a0f18fee95 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 11:51:04 -0400 Subject: [PATCH 07/12] (apps) Add orient-normals option --- apps/src/GeneratePPM.cpp | 20 ++++- apps/src/Mesher.cpp | 19 ++++- apps/src/Render.cpp | 13 ++- apps/src/RenderMeshing.cpp | 171 ------------------------------------- 4 files changed, 42 insertions(+), 181 deletions(-) delete mode 100644 apps/src/RenderMeshing.cpp diff --git a/apps/src/GeneratePPM.cpp b/apps/src/GeneratePPM.cpp index b79726104..393ff4059 100644 --- a/apps/src/GeneratePPM.cpp +++ b/apps/src/GeneratePPM.cpp @@ -7,12 +7,15 @@ #include "vc/core/util/Logging.hpp" #include "vc/texturing/AngleBasedFlattening.hpp" #include "vc/texturing/PPMGenerator.hpp" +#include "vc/meshing/OrientNormals.hpp" namespace vc = volcart; +namespace vcm = volcart::meshing; +namespace vct = volcart::texturing; namespace fs = volcart::filesystem; namespace po = boost::program_options; -int main(int argc, char* argv[]) +auto main(int argc, char* argv[]) -> int { // clang-format off po::options_description all("Usage"); @@ -23,7 +26,8 @@ int main(int argc, char* argv[]) ("output-ppm,o", po::value()->required(), "Path for the output ppm") ("uv-reuse", "If input-mesh is specified, attempt to use its existing " - "UV map instead of generating a new one."); + "UV map instead of generating a new one.") + ("orient-normals", "Auto-orient surface normals towards the mesh centroid"); // clang-format on // parsed will hold the values of all parsed options as a Map @@ -54,11 +58,19 @@ int main(int argc, char* argv[]) auto mesh = meshFile.mesh; auto uvMap = meshFile.uv; + // Reorient the surface normals + if (parsed.count("orient-normals") > 0) { + vcm::OrientNormals orient; + orient.setReferenceMode(vcm::OrientNormals::ReferenceMode::Centroid); + orient.setMesh(mesh); + mesh = orient.compute(); + } + // Generate UV map auto genUV = parsed.count("uv-reuse") == 0; if (genUV or not uvMap) { // ABF - vc::texturing::AngleBasedFlattening abf; + vct::AngleBasedFlattening abf; abf.setMesh(mesh); abf.compute(); @@ -71,7 +83,7 @@ int main(int argc, char* argv[]) // PPM vc::Logger()->info("Generating per-pixel map"); - vc::texturing::PPMGenerator p; + vct::PPMGenerator p; p.setDimensions(height, width); p.setMesh(mesh); p.setUVMap(uvMap); diff --git a/apps/src/Mesher.cpp b/apps/src/Mesher.cpp index 803c5a8ae..06fa88178 100644 --- a/apps/src/Mesher.cpp +++ b/apps/src/Mesher.cpp @@ -6,20 +6,21 @@ #include "vc/core/filesystem.hpp" #include "vc/core/io/MeshIO.hpp" #include "vc/core/io/PointSetIO.hpp" -#include "vc/core/types/OrderedPointSet.hpp" #include "vc/core/util/Logging.hpp" #include "vc/meshing/OrderedPointSetMesher.hpp" +#include "vc/meshing/OrientNormals.hpp" namespace fs = volcart::filesystem; namespace po = boost::program_options; namespace vc = volcart; +namespace vcm = volcart::meshing; using psio = vc::PointSetIO; auto main(int argc, char* argv[]) -> int { ///// Parse the command line options ///// - // All command line options + // clang-format off po::options_description all("Usage"); all.add_options() ("help,h", "Show this message") @@ -29,7 +30,9 @@ auto main(int argc, char* argv[]) -> int "Path for the output mesh") ("mode,m", po::value()->default_value(1), "Reading mode: 0 = ASCII, 1 = Binary") - ("disable-triangulation", "Disable vertex triangulation"); + ("disable-triangulation", "Disable vertex triangulation") + ("orient-normals", "Auto-orient surface normals towards the mesh centroid"); + // clang-format on // parsed will hold the values of all parsed options as a Map po::variables_map parsed; @@ -59,10 +62,18 @@ auto main(int argc, char* argv[]) -> int // Convert to a mesh vc::Logger()->info("Generating mesh..."); - vc::meshing::OrderedPointSetMesher mesher(inputCloud); + vcm::OrderedPointSetMesher mesher(inputCloud); mesher.setComputeTriangulation(parsed.count("disable-triangulation") == 0); auto output = mesher.compute(); + // Reorient the surface normals + if (parsed.count("orient-normals") > 0) { + vcm::OrientNormals orient; + orient.setReferenceMode(vcm::OrientNormals::ReferenceMode::Centroid); + orient.setMesh(output); + output = orient.compute(); + } + // Write the mesh vc::Logger()->info("Writing mesh..."); vc::WriteMesh(outputPath, output); diff --git a/apps/src/Render.cpp b/apps/src/Render.cpp index 363fc3ba9..0be602a07 100644 --- a/apps/src/Render.cpp +++ b/apps/src/Render.cpp @@ -103,7 +103,8 @@ static auto GetMeshingOpts() -> po::options_description " 3 = Both before and after mesh resampling") ("intermediate-mesh", po::value(),"Output file path for the " "intermediate (i.e. scale + resampled) mesh. File is saved prior " - "to flattening. Useful for testing meshing parameters."); + "to flattening. Useful for testing meshing parameters.") + ("orient-normals", "Auto-orient surface normals towards the mesh centroid"); // clang-format on return opts; @@ -331,7 +332,7 @@ auto main(int argc, char* argv[]) -> int }; // clang-format on graph->setProjectMetadata(projectInfo); - // Setup a map to keep a reference to important output ports + // Set up a map to keep a reference to important output ports std::unordered_map results; //// Load the segmentation/mesh //// @@ -489,6 +490,14 @@ auto main(int argc, char* argv[]) -> int } } + ///// Reorient the mesh normals ///// + if (parsed.count("orient-normals") > 0) { + auto orient = graph->insertNode(); + orient->input = *results["mesh"]; + orient->referenceMode = OrientNormalsNode::ReferenceMode::Centroid; + results["mesh"] = &orient->output; + } + ///// Flattening ///// if (needResample and results.count("uvMap") > 0) { Logger()->warn( diff --git a/apps/src/RenderMeshing.cpp b/apps/src/RenderMeshing.cpp deleted file mode 100644 index 269b7d7bc..000000000 --- a/apps/src/RenderMeshing.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include "vc/apps/render/RenderMeshing.hpp" - -#include -#include - -#include "vc/core/filesystem.hpp" -#include "vc/core/io/FileExtensionFilter.hpp" -#include "vc/core/io/OBJWriter.hpp" -#include "vc/core/io/PLYWriter.hpp" -#include "vc/core/types/Volume.hpp" -#include "vc/core/util/Logging.hpp" -#include "vc/core/util/MeshMath.hpp" -#include "vc/meshing/ACVD.hpp" -#include "vc/meshing/CalculateNormals.hpp" -#include "vc/meshing/ITK2VTK.hpp" - -namespace fs = volcart::filesystem; -namespace po = boost::program_options; -namespace vc = volcart; -namespace vcm = volcart::meshing; - -extern po::variables_map parsed_; -extern vc::Volume::Pointer volume_; - -// Square Micron to square millimeter conversion factor -static constexpr double UM_TO_MM = 0.000001; -// Min. number of points required to do flattening -static constexpr size_t CLEANER_MIN_REQ_POINTS = 100; -// Default resampling factor -static constexpr size_t DEFAULT_RESAMPLE_FACTOR = 50; - -po::options_description GetMeshingOpts() -{ - // clang-format off - po::options_description opts("Meshing Options"); - opts.add_options() - ("scale-mesh", po::value(), "Scale the mesh by a linear scale " - "factor") - ("enable-mesh-resampling", "Enable ACVD mesh resampling. Automatically " - "enabled if the input is a Segmentation") - ("mesh-resample-factor", po::value()->default_value(DEFAULT_RESAMPLE_FACTOR), - "Roughly, the number of vertices per square millimeter in the " - "output mesh") - ("mesh-resample-vcount", po::value(), "The target number of vertices " - "in the resampled mesh. If specified, overrides both the mesh-resample-factor " - "and mesh-resample-keep-vcount options.") - ("mesh-resample-keep-vcount", "If enabled, mesh resampling will " - "attempt to maintain the number of vertices in the input mesh. " - "Overrides the value set by --mesh-resample-factor.") - ("mesh-resample-anisotropic", "Enable the anisotropic extension " - "of the mesh resampler.") - ("mesh-resample-gradation", po::value()->default_value(0), - "Set the resampling gradation constraint.") - ("mesh-resample-quadrics-level", po::value()->default_value(1), - "Set the mesh resampling quadrics optimization level.") - ("mesh-resample-smoothing", po::value()->default_value(0), - "Smoothing Options:\n" - " 0 = Off\n" - " 1 = Before mesh resampling\n" - " 2 = After mesh resampling\n" - " 3 = Both before and after mesh resampling") - ("intermediate-mesh", po::value(),"Output file path for the " - "intermediate (i.e. scale + resampled) mesh. File is saved prior " - "to flattening. Useful for testing meshing parameters."); - // clang-format on - - return opts; -} - -vc::ITKMesh::Pointer ResampleMesh(const vc::ITKMesh::Pointer& m) -{ - auto smooth = - static_cast(parsed_["mesh-resample-smoothing"].as()); - - ///// Resample the segmentation ///// - // Calculate sampling density - size_t vertCount{0}; - auto voxelToMicron = volume_->voxelSize() * volume_->voxelSize(); - auto area = vc::meshmath::SurfaceArea(m) * voxelToMicron * UM_TO_MM; - auto currentDensityFactor = m->GetNumberOfPoints() / area; - double newDensityFactor{50}; - if (parsed_.count("mesh-resample-vcount")) { - vertCount = parsed_["mesh-resample-vcount"].as(); - newDensityFactor = vertCount / area; - } else if (parsed_.count("mesh-resample-keep-vcount")) { - newDensityFactor = currentDensityFactor; - vertCount = static_cast(m->GetNumberOfPoints()); - } else { - newDensityFactor = parsed_["mesh-resample-factor"].as(); - vertCount = static_cast(newDensityFactor * area); - } - - vertCount = (vertCount < CLEANER_MIN_REQ_POINTS) ? CLEANER_MIN_REQ_POINTS - : vertCount; - // Copy the pointer to the input mesh - auto workingMesh = m; - - // Pre-Smooth - if (smooth == SmoothOpt::Both || smooth == SmoothOpt::Before) { - // Convert to polydata - auto vtkMesh = vtkSmartPointer::New(); - vcm::ITK2VTK(workingMesh, vtkMesh); - // Smoother - vc::Logger()->info("Smoothing mesh"); - auto vtkSmoother = vtkSmartPointer::New(); - vtkSmoother->SetInputData(vtkMesh); - vtkSmoother->Update(); - vtkMesh = vtkSmoother->GetOutput(); - // Convert back to ITK - workingMesh = vc::ITKMesh::New(); - vcm::VTK2ITK(vtkMesh, workingMesh); - } - - // Decimate using ACVD - vc::Logger()->info( - "Resampling mesh (Density: {:.3g} -> {:.3g})", currentDensityFactor, - newDensityFactor); - - vcm::ACVD resampler; - resampler.setInputMesh(workingMesh); - resampler.setNumberOfClusters(vertCount); - resampler.setGradation(parsed_["mesh-resample-gradation"].as()); - resampler.setQuadricsOptimizationLevel( - parsed_["mesh-resample-quadrics-level"].as()); - if (parsed_.count("mesh-resample-anisotropic")) { - resampler.setMode(vcm::ACVD::Mode::Anisotropic); - } - workingMesh = resampler.compute(); - - // Post-Smooth - if (smooth == SmoothOpt::Both || smooth == SmoothOpt::After) { - // Convert to polydata - auto vtkMesh = vtkSmartPointer::New(); - vcm::ITK2VTK(workingMesh, vtkMesh); - // Smoother - vc::Logger()->info("Smoothing mesh"); - auto vtkSmoother = vtkSmartPointer::New(); - vtkSmoother->SetInputData(vtkMesh); - vtkSmoother->Update(); - vtkMesh = vtkSmoother->GetOutput(); - // Convert back to ITK - workingMesh = vc::ITKMesh::New(); - vcm::VTK2ITK(vtkMesh, workingMesh); - } - - // Make sure the normals are up-to-date if we've smoothed - if (smooth != SmoothOpt::Off) { - vcm::CalculateNormals normals; - normals.setMesh(workingMesh); - workingMesh = normals.compute(); - } - - // Save the intermediate mesh - if (parsed_.count("intermediate-mesh")) { - vc::Logger()->info("Writing intermediate mesh"); - fs::path meshPath = parsed_["intermediate-mesh"].as(); - if (vc::io::FileExtensionFilter(meshPath, {"ply"})) { - vc::io::PLYWriter writer; - writer.setMesh(workingMesh); - writer.setPath(meshPath); - writer.write(); - } else if (vc::io::FileExtensionFilter(meshPath, {"obj"})) { - vc::io::OBJWriter writer; - writer.setMesh(workingMesh); - writer.setPath(meshPath); - writer.write(); - } - } - - return workingMesh; -} From c61c7ed2f991183d39dc7418e2ececa40b3da395 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 15:01:11 -0400 Subject: [PATCH 08/12] (core) Fix Cube shape primitive winding order and all related tests --- core/include/vc/core/shapes/Cube.hpp | 21 +- core/src/ShapePrimitive.cpp | 8 +- meshing/test/ITK2VTKTest.cpp | 2 +- .../res/ArchResamplePointCloudExample.pcd | 109 ---------- meshing/test/res/ArchWithSmoothedNormals.obj | 200 +++++++++--------- meshing/test/res/Cone.obj | 8 +- .../res/ConeResamplePointCloudExample.pcd | 29 --- meshing/test/res/ConeWithSmoothedNormals.obj | 8 +- .../res/CubeResamplePointCloudExample.pcd | 18 -- meshing/test/res/CubeWithSmoothedNormals.obj | 36 ++-- .../test/res/ITKArchMeshConvertedToVTK.ply | 198 ++++++++--------- .../test/res/ITKConeMeshConvertedToVTK.ply | 8 +- .../test/res/ITKCubeMeshConvertedToVTK.ply | 36 ++-- .../test/res/ITKSphereMeshConvertedToVTK.ply | 80 +++---- .../res/PlaneResamplePointCloudExample.pcd | 36 ---- meshing/test/res/ScaledArchMesh.obj | 198 ++++++++--------- meshing/test/res/ScaledConeMesh.obj | 8 +- meshing/test/res/ScaledCubeMesh.obj | 36 ++-- meshing/test/res/ScaledSphereMesh.obj | 80 +++---- .../res/SphereResamplePointCloudExample.pcd | 27 --- .../test/res/SphereWithSmoothedNormals.obj | 84 ++++---- .../test/res/VTKArchMeshConvertedToITK.obj | 198 ++++++++--------- .../test/res/VTKConeMeshConvertedToITK.obj | 8 +- .../test/res/VTKCubeMeshConvertedToITK.obj | 36 ++-- .../test/res/VTKSphereMeshConvertedToITK.obj | 80 +++---- 25 files changed, 666 insertions(+), 886 deletions(-) delete mode 100644 meshing/test/res/ArchResamplePointCloudExample.pcd delete mode 100644 meshing/test/res/ConeResamplePointCloudExample.pcd delete mode 100644 meshing/test/res/CubeResamplePointCloudExample.pcd delete mode 100644 meshing/test/res/PlaneResamplePointCloudExample.pcd delete mode 100644 meshing/test/res/SphereResamplePointCloudExample.pcd diff --git a/core/include/vc/core/shapes/Cube.hpp b/core/include/vc/core/shapes/Cube.hpp index 22894ed17..14c2863db 100644 --- a/core/include/vc/core/shapes/Cube.hpp +++ b/core/include/vc/core/shapes/Cube.hpp @@ -41,18 +41,17 @@ class Cube : public ShapePrimitive // generate the 12 cells for faces addCell_(0, 1, 2); - addCell_(0, 1, 5); addCell_(0, 2, 3); - addCell_(0, 3, 4); - addCell_(0, 4, 5); - addCell_(1, 2, 6); - addCell_(1, 5, 6); - addCell_(2, 3, 7); - addCell_(2, 6, 7); - addCell_(3, 4, 7); - addCell_(4, 5, 7); - addCell_(5, 6, 7); - + addCell_(3, 2, 6); + addCell_(3,6,7); + addCell_(7, 6, 5); + addCell_(7, 5, 4); + addCell_(4, 5, 1); + addCell_(4, 1, 0); + addCell_(0, 3, 7); + addCell_(0, 7, 4); + addCell_(5, 6, 2); + addCell_(5, 2, 1); } // Constructor }; // Cube diff --git a/core/src/ShapePrimitive.cpp b/core/src/ShapePrimitive.cpp index 56c2ffd6c..8bc729515 100644 --- a/core/src/ShapePrimitive.cpp +++ b/core/src/ShapePrimitive.cpp @@ -161,7 +161,7 @@ void ShapePrimitive::addVertex_(double x, double y, double z) v.nx = 0; v.ny = 0; v.nz = 0; - v.faceCount = 0; + v.faceCount = 1; points_.push_back(v); } @@ -209,9 +209,9 @@ void ShapePrimitive::updateNormal_(int vertID, double nx, double ny, double nz) { // recalculate average (unaverage, add new component, recalculate average) SimpleMesh::Vertex v = points_[vertID]; - v.nx = (v.nx * v.faceCount + nx) / (v.faceCount + 1); - v.ny = (v.ny * v.faceCount + ny) / (v.faceCount + 1); - v.nz = (v.nz * v.faceCount + nz) / (v.faceCount + 1); + v.nx = v.nx + (nx - v.nx) / v.faceCount; + v.ny = v.ny + (ny - v.ny) / v.faceCount; + v.nz = v.nz + (nz - v.nz) / v.faceCount; v.faceCount++; points_[vertID] = v; } diff --git a/meshing/test/ITK2VTKTest.cpp b/meshing/test/ITK2VTKTest.cpp index 0d33e1765..85dc542d8 100644 --- a/meshing/test/ITK2VTKTest.cpp +++ b/meshing/test/ITK2VTKTest.cpp @@ -15,7 +15,7 @@ using namespace volcart; /* * The following five fixture build test inputs for the ITK2VTK tests * - * Comments are included in the Plane Fixture only...the remainder of the fixure + * Comments are included in the Plane Fixture only...the remainder of the fixture * copy the same ideas */ diff --git a/meshing/test/res/ArchResamplePointCloudExample.pcd b/meshing/test/res/ArchResamplePointCloudExample.pcd deleted file mode 100644 index 53b170bef..000000000 --- a/meshing/test/res/ArchResamplePointCloudExample.pcd +++ /dev/null @@ -1,109 +0,0 @@ -# .PCD v0.7 - Point Cloud Data file format -VERSION 0.7 -FIELDS x y z normal_x normal_y normal_z curvature -SIZE 4 4 4 4 4 4 4 -TYPE F F F F F F F -COUNT 1 1 1 1 1 1 1 -WIDTH 98 -HEIGHT 1 -VIEWPOINT 0 0 0 1 0 0 0 -POINTS 98 -DATA ascii --4.7196779 1.1439068 4.4404564 0.83873248 -0.54454106 0.0017029543 0.08540491 --4.7155428 2.023772 -0.48824656 0.87195528 -0.47281954 -0.12702645 0.087087363 --4.7333698 1.7040005 0.65563709 0.85817075 -0.49672848 -0.12962942 0.08540491 --4.7422323 1.4192768 1.7949101 0.85174459 -0.51287144 -0.10721022 0.08540491 --4.7486296 1.2137438 2.895447 0.84759223 -0.52570188 -0.072284073 0.08540491 --4.7519822 1.1060221 3.9481392 0.84449285 -0.53497583 -0.025152318 0.08540491 --4.7519026 1.1085943 4.9468808 0.84083432 -0.54025793 0.03345155 0.08540491 --4.7481742 1.2283734 5.8882909 0.83476132 -0.54107475 0.10203742 0.08540491 --4.7407393 1.4672449 6.7714467 0.82446277 -0.53715646 0.17811251 0.08540491 --4.7296791 1.8225807 7.5976334 0.80857652 -0.52872473 0.25817478 0.08540491 --4.7152014 2.2877288 8.3701057 0.78658336 -0.51672226 0.33806023 0.08540491 --4.7682142 1.5845191 7.2032332 0.82183278 -0.52725375 0.21585727 0.08540491 --4.7801232 2.2019179 8.3903828 0.79615974 -0.50541949 0.33268717 0.08540491 --4.7850137 3.0447936 9.4672403 0.76078528 -0.47985253 0.43697515 0.08540491 --4.7842879 4.0681076 10.455836 0.72023678 -0.45901343 0.5201593 0.08540491 --4.7797756 5.2130904 11.384918 0.68060941 -0.45086306 0.57748884 0.08540491 --4.7735963 6.4116178 12.287808 0.64651847 -0.4625417 0.60668689 0.08540491 --4.7680826 7.5887628 13.201158 0.62001961 -0.50061995 0.60411531 0.08540491 --4.7657046 8.6651621 14.163786 0.59974802 -0.57092899 0.56066251 0.08540491 --3.7831573 3.1044343 0.43806735 0.7277993 -0.6506272 -0.21677735 0.08540491 --3.7947135 2.733155 1.6196791 0.71640438 -0.6736756 -0.18145509 0.08540491 --3.803179 2.4611731 2.7527194 0.70756 -0.69453776 -0.13029274 0.08540491 --3.8081048 2.302923 3.8301277 0.69927365 -0.71208715 -0.062835477 0.08540491 --3.8092215 2.2670436 4.8476782 0.6889587 -0.72451001 0.020522613 0.08540491 --3.8064234 2.3569427 5.8037038 0.67368013 -0.72959614 0.11766268 0.08540491 --3.7997503 2.5713327 6.6988349 0.65078545 -0.72545105 0.22405156 0.08540491 --3.7893729 2.9047387 7.5357485 0.61881816 -0.71152163 0.33286795 0.08540491 --3.7755768 3.3479836 8.3189344 0.57821757 -0.68940353 0.43633386 0.08540491 --3.7587583 3.8883238 9.0546265 0.53242379 -0.66221249 0.52725661 0.08540491 --1.6436236 3.5873718 3.2452316 0.22631618 -0.95130843 -0.20926832 0.08540491 --1.6817131 3.363632 4.8438258 0.19842951 -0.97929955 -0.039977085 0.08540491 --1.7102406 3.4471021 6.2921476 0.16208379 -0.97290522 0.16487671 0.08540491 --1.72987 3.816452 7.6006312 0.11670578 -0.92157692 0.37023747 0.08540491 --1.741799 4.4331932 8.7881031 0.067176409 -0.84142369 0.53618419 0.08540491 --1.7476571 5.2449856 9.8801651 0.018600699 -0.76357591 0.64545012 0.08540491 --1.7494094 6.1886873 10.907703 -0.028003018 -0.71158946 0.70203722 0.08540491 --1.7492695 7.1931844 11.905503 -0.075004995 -0.69645214 0.7136727 0.08540491 --1.7496173 8.1820059 12.910972 -0.12590623 -0.72170693 0.68065172 0.08540491 --1.7529246 9.0757513 13.962946 -0.1829327 -0.78481883 0.59211063 0.08540491 --0.75826031 4.904325 0.046799578 0.12478372 -0.89634496 -0.4254348 0.08540491 --0.77567524 4.3448186 1.320483 0.10784497 -0.92391509 -0.36708358 0.08540491 --0.78901029 3.9163902 2.5300493 0.092047483 -0.95255154 -0.29012561 0.08540491 --0.7980054 3.6273944 3.671412 0.076539278 -0.97834975 -0.19228488 0.08540491 --0.80256641 3.4808598 4.7430897 0.060611188 -0.99546355 -0.07333865 0.08540491 --0.80274725 3.4750483 5.7459326 0.043848705 -0.99707264 0.062637761 0.08540491 --0.79873395 3.6039886 6.6828609 0.026300073 -0.97820622 0.20596337 0.08540491 --0.79082829 3.8579807 7.5586205 0.0084498236 -0.9392193 0.34321386 0.08540491 --0.77943337 4.2240767 8.3795443 -0.009115871 -0.88675445 0.46215087 0.08540491 --0.76503909 4.6865373 9.1533308 -0.026127398 -0.83082843 0.55591506 0.08540491 -1.3562229 3.5824411 3.2476435 -0.20785515 -0.95066124 -0.23030284 0.08540491 -1.3176597 3.3434854 4.8536806 -0.18045916 -0.98202235 -0.055376951 0.08540491 -1.288854 3.4180133 6.3063765 -0.14132528 -0.9779802 0.15356395 0.08540491 -1.2689382 3.7781575 7.6193628 -0.094294146 -0.92856395 0.35899529 0.08540491 -1.2565353 4.3796778 8.8142796 -0.04889081 -0.8522886 0.52078187 0.08540491 -1.2498642 5.1653504 9.9191189 -0.01302101 -0.78149426 0.62377656 0.08540491 -1.2468374 6.0681038 10.966687 0.010440452 -0.73935598 0.67323381 0.08540491 -1.2451509 7.0139217 11.99319 0.02116972 -0.73638374 0.67623281 0.08540491 -1.2423687 7.9245338 13.036915 0.018525615 -0.77555013 0.63101411 0.08540491 -1.2359998 8.7199135 14.137005 0.00056802173 -0.85161948 0.52416021 0.08540491 -2.2650237 4.6523948 -0.31911984 -0.39923376 -0.81977999 -0.41057661 0.08540491 -2.2467132 4.0641112 0.96863991 -0.38838485 -0.84951633 -0.35704228 0.08540491 -2.2326095 3.6109872 2.1902862 -0.3755751 -0.88163704 -0.28576124 0.08540491 -2.2229793 3.3015928 3.3416269 -0.35839629 -0.91318953 -0.19400254 0.08540491 -2.2179182 3.1389904 4.421164 -0.33405685 -0.93910784 -0.080513895 0.08540491 -2.2173681 3.1213162 5.4298096 -0.30005911 -0.95249486 0.052134838 0.08540491 -2.2211349 3.2423358 6.3706126 -0.25555527 -0.94683099 0.19545491 0.08540491 -2.228905 3.4919703 7.2485032 -0.20262446 -0.91988724 0.33578387 0.08540491 -2.2402604 3.8567972 8.0700474 -0.14599974 -0.87629473 0.45912048 0.08540491 -2.2546942 4.3205261 8.843214 -0.090992011 -0.8257609 0.55663222 0.08540491 -3.3265817 2.6301281 3.713469 -0.59261936 -0.79925781 -0.099946477 0.08540491 -3.2948318 2.6100652 5.2124343 -0.53890038 -0.83955783 0.068767913 0.08540491 -3.2723196 2.8867962 6.5662222 -0.45165223 -0.85081321 0.26856494 0.08540491 -3.258065 3.4288218 7.7902412 -0.33415818 -0.82220232 0.46078375 0.08540491 -3.2506347 4.1901021 8.907011 -0.20798898 -0.76783508 0.60594547 0.08540491 -3.2480135 5.1058884 9.948205 -0.096043691 -0.71739447 0.69001508 0.08540491 -3.2481773 6.1111488 10.945631 -0.0064452155 -0.69294393 0.72096264 0.08540491 -3.2487109 7.1282959 11.937243 0.06086091 -0.70584172 0.70575029 0.08540491 -3.2471313 8.0775471 12.962068 0.10747338 -0.75977349 0.64124388 0.08540491 -3.2409189 8.8779535 14.059699 0.13132679 -0.84880584 0.51213467 0.08540491 -4.2959948 1.6474352 4.1941547 -0.78523171 -0.61919826 -0.0021491335 0.08540491 -4.3095984 3.0844927 -1.0196327 -0.81651545 -0.52194691 -0.24672654 0.08540491 -4.2932916 2.5605819 0.23663904 -0.80963486 -0.54463345 -0.21878256 0.08540491 -4.2804108 2.1467543 1.4390634 -0.80386817 -0.56774968 -0.17735918 0.08540491 -4.2714586 1.8591367 2.579752 -0.797369 -0.59122384 -0.12106619 0.08540491 -4.2667384 1.7074853 3.6539326 -0.78749293 -0.6144135 -0.048487138 0.08540491 -4.2663751 1.6958151 4.6596408 -0.77067256 -0.63590324 0.041119967 0.08540491 -4.2703528 1.8236122 5.5971289 -0.74302435 -0.65309215 0.14623772 0.08540491 -4.2784371 2.0833383 6.4700832 -0.69934595 -0.66423082 0.26403153 0.08540491 -4.2903819 2.4671052 7.2823634 -0.63867903 -0.66610211 0.38522351 0.08540491 -4.3057566 2.9610584 8.0407457 -0.56214529 -0.65887296 0.49987912 0.08540491 -4.2534661 2.2810717 6.8625135 -0.66638798 -0.67253625 0.32190382 0.08540491 -4.244307 2.986809 8.0064526 -0.55121082 -0.67045909 0.49664 0.08540491 -4.2413487 3.8917618 9.0529451 -0.41219601 -0.65190196 0.63648903 0.08540491 -4.242672 4.9342713 10.032151 -0.27363518 -0.63405651 0.72325385 0.08540491 -4.2460651 6.043293 10.978823 -0.15238391 -0.63539344 0.75700355 0.08540491 -4.2491179 7.1413689 11.930849 -0.053976227 -0.66883171 0.74145174 0.08540491 -4.2493052 8.1473885 12.927905 0.021061499 -0.74075401 0.67144608 0.08540491 -4.2440686 8.9791555 14.010196 0.070273958 -0.84564197 0.52910411 0.08540491 diff --git a/meshing/test/res/ArchWithSmoothedNormals.obj b/meshing/test/res/ArchWithSmoothedNormals.obj index 3a549434d..e6102569f 100644 --- a/meshing/test/res/ArchWithSmoothedNormals.obj +++ b/meshing/test/res/ArchWithSmoothedNormals.obj @@ -2,205 +2,205 @@ # VC OBJ Exporter v1.0 # Vertices: 100 v 5 0 0 -vn 0.968889 0.214293 0 +vn 0.968889 0.214293 -5.55377e-18 v 4.75528 1.54508 0 -vn 0.9085 0.354523 0 +vn 0.9085 0.354523 -2.47879e-18 v 4.04508 2.93893 0 -vn 0.764552 0.586918 0 +vn 0.764552 0.586918 5.57074e-18 v 2.93893 4.04508 0 -vn 0.545765 0.794452 0 +vn 0.545765 0.794452 5.14056e-18 v 1.54508 4.75528 0 -vn 0.273554 0.92422 0 +vn 0.273554 0.92422 1.21494e-18 v 3.06162e-16 5 0 -vn -0.0254344 0.963518 0 +vn -0.0254344 0.963518 4.08117e-18 v -1.54508 4.75528 0 -vn -0.321933 0.9085 0 +vn -0.321933 0.9085 1.11425e-17 v -2.93893 4.04508 0 -vn -0.586918 0.764552 0 +vn -0.586918 0.764552 1.20823e-17 v -4.04508 2.93893 0 -vn -0.780353 0.589158 0 +vn -0.780353 0.589158 1.93766e-18 v -4.75528 1.54508 0 -vn -0.865465 0.489146 0 +vn -0.865465 0.489146 -4.80776e-18 v 5 0 1 -vn 0.967546 0.218425 0 +vn 0.967546 0.218425 -6.09071e-18 v 4.75528 1.54508 1 -vn 0.910019 0.348072 0 +vn 0.910019 0.348072 -2.11148e-18 v 4.04508 2.93893 1 -vn 0.769638 0.57618 0 +vn 0.769638 0.57618 4.3955e-18 v 2.93893 4.04508 1 -vn 0.55392 0.785811 0 +vn 0.55392 0.785811 6.18261e-18 v 1.54508 4.75528 1 -vn 0.28398 0.918521 0 +vn 0.28398 0.918521 1.8112e-18 v 3.06162e-16 5 1 -vn -0.0137573 0.961321 0 +vn -0.0137573 0.961321 4.02717e-18 v -1.54508 4.75528 1 -vn -0.310148 0.910019 0 +vn -0.310148 0.910019 1.18145e-17 v -2.93893 4.04508 1 -vn -0.57618 0.769638 0 +vn -0.57618 0.769638 1.22774e-17 v -4.04508 2.93893 1 -vn -0.771162 0.599004 0 +vn -0.771162 0.599004 3.64453e-18 v -4.75528 1.54508 1 -vn -0.860357 0.496177 0 +vn -0.860357 0.496177 -5.9965e-18 v 5 0 2 -vn 0.971575 0.206027 0 +vn 0.971575 0.206027 -5.88e-18 v 4.75528 1.54508 2 -vn 0.915017 0.340985 0 +vn 0.915017 0.340985 -3.37157e-18 v 4.04508 2.93893 2 -vn 0.776948 0.569857 0 +vn 0.776948 0.569857 5.67622e-18 v 2.93893 4.04508 2 -vn 0.562826 0.782057 0 +vn 0.562826 0.782057 5.89856e-18 v 1.54508 4.75528 2 -vn 0.293611 0.917703 0 +vn 0.293611 0.917703 2.14919e-18 v 3.06162e-16 5 2 -vn -0.0043454 0.963518 0 +vn -0.0043454 0.963518 4.22567e-18 v -1.54508 4.75528 2 -vn -0.301876 0.915017 0 +vn -0.301876 0.915017 1.19369e-17 v -2.93893 4.04508 2 -vn -0.569857 0.776948 0 +vn -0.569857 0.776948 1.42943e-17 v -4.04508 2.93893 2 -vn -0.769971 0.600021 0 +vn -0.769971 0.600021 2.88033e-18 v -4.75528 1.54508 2 -vn -0.860357 0.496177 0 +vn -0.860357 0.496177 -5.295e-18 v 5 0 3 -vn 0.971575 0.206027 0 +vn 0.971575 0.206027 -5.9732e-18 v 4.75528 1.54508 3 -vn 0.91636 0.336852 0 +vn 0.91636 0.336852 -3.44147e-18 v 4.04508 2.93893 3 -vn 0.779502 0.566342 0 +vn 0.779502 0.566342 5.24414e-18 v 2.93893 4.04508 3 -vn 0.566342 0.779502 0 +vn 0.566342 0.779502 6.61489e-18 v 1.54508 4.75528 3 -vn 0.297743 0.91636 0 +vn 0.297743 0.91636 2.13149e-18 v 3.06162e-16 5 3 -vn 2.01859e-16 0.961321 0 +vn 1.51394e-16 0.961321 4.15768e-18 v -1.54508 4.75528 3 -vn -0.297064 0.91427 0 +vn -0.297064 0.91427 1.23169e-17 v -2.93893 4.04508 3 -vn -0.56505 0.777725 0 +vn -0.56505 0.777725 1.37686e-17 v -4.04508 2.93893 3 -vn -0.764541 0.605626 0 +vn -0.764541 0.605626 4.02592e-18 v -4.75528 1.54508 3 -vn -0.860357 0.496177 0 +vn -0.860357 0.496177 -6.37513e-18 v 5 0 4 -vn 0.971575 0.206027 0 +vn 0.971575 0.206027 -5.9732e-18 v 4.75528 1.54508 4 -vn 0.91636 0.336852 0 +vn 0.91636 0.336852 -3.44147e-18 v 4.04508 2.93893 4 -vn 0.779502 0.566342 0 +vn 0.779502 0.566342 5.24414e-18 v 2.93893 4.04508 4 -vn 0.566342 0.779502 0 +vn 0.566342 0.779502 6.61489e-18 v 1.54508 4.75528 4 -vn 0.297743 0.91636 0 +vn 0.297743 0.91636 2.13149e-18 v 3.06162e-16 5 4 -vn 1.85037e-16 0.963518 0 +vn 1.38778e-16 0.963518 4.15577e-18 v -1.54508 4.75528 4 -vn -0.297743 0.91636 0 +vn -0.297743 0.91636 1.21442e-17 v -2.93893 4.04508 4 -vn -0.566342 0.779502 0 +vn -0.566342 0.779502 1.46175e-17 v -4.04508 2.93893 4 -vn -0.767417 0.603536 0 +vn -0.767417 0.603536 3.71684e-18 v -4.75528 1.54508 4 -vn -0.860357 0.496177 0 +vn -0.860357 0.496177 -6.37513e-18 v 5 0 5 -vn 0.971575 0.206027 0 +vn 0.971575 0.206027 -5.9732e-18 v 4.75528 1.54508 5 -vn 0.91636 0.336852 0 +vn 0.91636 0.336852 -3.44147e-18 v 4.04508 2.93893 5 -vn 0.779502 0.566342 0 +vn 0.779502 0.566342 5.24414e-18 v 2.93893 4.04508 5 -vn 0.566342 0.779502 0 +vn 0.566342 0.779502 6.61489e-18 v 1.54508 4.75528 5 -vn 0.297743 0.91636 0 +vn 0.297743 0.91636 2.13149e-18 v 3.06162e-16 5 5 -vn 1.94289e-16 0.963518 0 +vn 1.4803e-16 0.963518 4.15577e-18 v -1.54508 4.75528 5 -vn -0.297743 0.91636 0 +vn -0.297743 0.91636 1.21442e-17 v -2.93893 4.04508 5 -vn -0.566342 0.779502 0 +vn -0.566342 0.779502 1.46175e-17 v -4.04508 2.93893 5 -vn -0.767417 0.603536 0 +vn -0.767417 0.603536 3.71684e-18 v -4.75528 1.54508 5 -vn -0.860357 0.496177 0 +vn -0.860357 0.496177 -6.37513e-18 v 5 0 6 -vn 0.969561 0.212226 0 +vn 0.969561 0.212226 -6.30042e-18 v 4.75528 1.54508 6 -vn 0.91427 0.339728 0 +vn 0.91427 0.339728 -2.73536e-18 v 4.04508 2.93893 6 -vn 0.777725 0.56505 0 +vn 0.777725 0.56505 4.62934e-18 v 2.93893 4.04508 6 -vn 0.566342 0.779502 0 +vn 0.566342 0.779502 6.61489e-18 v 1.54508 4.75528 6 -vn 0.297743 0.91636 0 +vn 0.297743 0.91636 2.13149e-18 v 3.06162e-16 5 6 -vn 2.03541e-16 0.963518 0 +vn 1.66533e-16 0.963518 4.15577e-18 v -1.54508 4.75528 6 -vn -0.297743 0.91636 0 +vn -0.297743 0.91636 1.21442e-17 v -2.93893 4.04508 6 -vn -0.566342 0.779502 0 +vn -0.566342 0.779502 1.46175e-17 v -4.04508 2.93893 6 -vn -0.767417 0.603536 0 +vn -0.767417 0.603536 3.71684e-18 v -4.75528 1.54508 6 -vn -0.860357 0.496177 0 +vn -0.860357 0.496177 -6.37513e-18 v 5 0 7 -vn 0.971575 0.206027 0 +vn 0.971575 0.206027 -6.15962e-18 v 4.75528 1.54508 7 -vn 0.917703 0.332719 0 +vn 0.917703 0.332719 -3.51138e-18 v 4.04508 2.93893 7 -vn 0.782057 0.562826 0 +vn 0.782057 0.562826 4.81206e-18 v 2.93893 4.04508 7 -vn 0.569857 0.776948 0 +vn 0.569857 0.776948 7.33122e-18 v 1.54508 4.75528 7 -vn 0.301876 0.915017 0 +vn 0.301876 0.915017 2.1138e-18 v 3.06162e-16 5 7 -vn 0.0043454 0.963518 0 +vn 0.0043454 0.963518 4.08586e-18 v -1.54508 4.75528 7 -vn -0.293611 0.917703 0 +vn -0.293611 0.917703 1.23514e-17 v -2.93893 4.04508 7 -vn -0.562826 0.782057 0 +vn -0.562826 0.782057 1.49407e-17 v -4.04508 2.93893 7 -vn -0.764863 0.607052 0 +vn -0.764863 0.607052 4.55335e-18 v -4.75528 1.54508 7 -vn -0.860357 0.496177 0 +vn -0.860357 0.496177 -6.9152e-18 v 5 0 8 -vn 0.971575 0.206027 0 +vn 0.971575 0.206027 -6.615e-18 v 4.75528 1.54508 8 -vn 0.918521 0.331385 0 +vn 0.918521 0.331385 -3.4355e-18 v 4.04508 2.93893 8 -vn 0.785811 0.55392 0 +vn 0.785811 0.55392 4.86317e-18 v 2.93893 4.04508 8 -vn 0.57618 0.769638 0 +vn 0.57618 0.769638 6.76419e-18 v 1.54508 4.75528 8 -vn 0.310148 0.910019 0 +vn 0.310148 0.910019 3.18298e-18 v 3.06162e-16 5 8 -vn 0.0137573 0.961321 0 +vn 0.0137573 0.961321 4.28819e-18 v -1.54508 4.75528 8 -vn -0.28398 0.918521 0 +vn -0.28398 0.918521 1.28193e-17 v -2.93893 4.04508 8 -vn -0.55392 0.785811 0 +vn -0.55392 0.785811 1.52598e-17 v -4.04508 2.93893 8 -vn -0.757919 0.612247 0 +vn -0.757919 0.612247 4.84919e-18 v -4.75528 1.54508 8 -vn -0.852694 0.506723 0 +vn -0.852694 0.506723 -5.30969e-18 v 5 0 9 -vn 0.97426 0.197762 0 +vn 0.97426 0.197762 -6.67225e-18 v 4.75528 1.54508 9 -vn 0.92422 0.319181 0 +vn 0.92422 0.319181 -4.50902e-18 v 4.04508 2.93893 9 -vn 0.794452 0.545765 0 +vn 0.794452 0.545765 4.91755e-18 v 2.93893 4.04508 9 -vn 0.586918 0.764552 0 +vn 0.586918 0.764552 8.08923e-18 v 1.54508 4.75528 9 -vn 0.321933 0.9085 0 +vn 0.321933 0.9085 3.04805e-18 v 3.06162e-16 5 9 -vn 0.0254344 0.963518 0 +vn 0.0254344 0.963518 4.23036e-18 v -1.54508 4.75528 9 -vn -0.273554 0.92422 0 +vn -0.273554 0.92422 1.31458e-17 v -2.93893 4.04508 9 -vn -0.545765 0.794452 0 +vn -0.545765 0.794452 1.71527e-17 v -4.04508 2.93893 9 -vn -0.754481 0.617914 0 +vn -0.754481 0.617914 6.1036e-18 v -4.75528 1.54508 9 -vn -0.855248 0.503208 0 +vn -0.855248 0.503208 -6.32231e-18 # Faces: 162 f 12//12 11//11 1//1 f 12//12 1//1 2//2 diff --git a/meshing/test/res/Cone.obj b/meshing/test/res/Cone.obj index 2cb9d0013..96e5352ce 100644 --- a/meshing/test/res/Cone.obj +++ b/meshing/test/res/Cone.obj @@ -2,11 +2,11 @@ # VC OBJ Exporter v1.0 # Vertices: 50 v 0 0 0 -vn -8.46545e-16 -3.46366e-16 -0.370705 +vn -8.39606e-16 -2.35922e-16 -0.370705 v 0 0 5 vn 0 0 1 v 2 0 5 -vn 0.463381 -4.56232e-16 0.314648 +vn 0.463381 -4.55365e-16 0.314648 v 1.98289 0.261052 5 vn 0.459417 0.0604834 0.314648 v 1.93185 0.517638 5 @@ -54,7 +54,7 @@ vn -0.447592 0.119932 0.314648 v -1.98289 0.261052 5 vn -0.459417 0.0604834 0.314648 v -2 2.02129e-15 5 -vn -0.463381 5.91541e-16 0.314648 +vn -0.463381 5.88071e-16 0.314648 v -1.98289 -0.261052 5 vn -0.459417 -0.0604834 0.314648 v -1.93185 -0.517638 5 @@ -78,7 +78,7 @@ vn -0.119932 -0.447592 0.314648 v -0.261052 -1.98289 5 vn -0.0604834 -0.459417 0.314648 v -5.69646e-15 -2 5 -vn -1.38257e-15 -0.463381 0.314648 +vn -1.38171e-15 -0.463381 0.314648 v 0.261052 -1.98289 5 vn 0.0604834 -0.459417 0.314648 v 0.517638 -1.93185 5 diff --git a/meshing/test/res/ConeResamplePointCloudExample.pcd b/meshing/test/res/ConeResamplePointCloudExample.pcd deleted file mode 100644 index 2e53e5d59..000000000 --- a/meshing/test/res/ConeResamplePointCloudExample.pcd +++ /dev/null @@ -1,29 +0,0 @@ -# .PCD v0.7 - Point Cloud Data file format -VERSION 0.7 -FIELDS x y z normal_x normal_y normal_z curvature -SIZE 4 4 4 4 4 4 4 -TYPE F F F F F F F -COUNT 1 1 1 1 1 1 1 -WIDTH 18 -HEIGHT 1 -VIEWPOINT 0 0 0 1 0 0 0 -POINTS 18 -DATA ascii --2 -1.1559864 4.1070457 1.919538e-17 -0.67944962 0.73372221 0.030049849 --2 -0.61763817 4.6055732 2.4483653e-17 -0.67944962 0.73372221 0.030049849 --2 -0.079289913 5.1041002 2.4483653e-17 -0.67944962 0.73372221 0.030049849 --2 0.45905831 5.6026278 -4.1721316e-17 -0.67944962 0.73372221 0.030049849 --2 4.5667396 9.4064684 -6.6548176e-17 -0.67944962 0.73372221 0.030049849 --1 -1.1559864 4.1070457 -1.1850283e-16 -0.67944962 0.73372221 0.030049849 --1 0.45905831 5.6026278 -1.1850283e-16 -0.67944962 0.73372221 0.030049849 --1 4.5667396 9.4064684 -1.1399478e-16 -0.67944962 0.73372221 0.030049849 -0 -1.1559864 4.1070457 -2.0084897e-18 -0.67944962 0.73372221 0.030049849 --1.5922603e-18 -0.61763817 4.6055732 2.9619603e-18 -0.67944962 0.73372221 0.030049849 -0 0.45905834 5.6026278 -2.0084897e-18 -0.67944962 0.73372221 0.030049849 -3.9294863e-18 4.5667396 9.4064684 -4.8576132e-18 -0.67944962 0.73372221 0.030049849 -1 -1.1559864 4.1070457 1.9577154e-18 -0.67944962 0.73372221 0.030049849 -1 -0.61763817 4.6055732 -6.9535529e-17 -0.67944962 0.73372221 0.030049849 -1 -0.079289921 5.1041002 2.9619603e-18 -0.67944962 0.73372221 0.030049849 -1 0.45905831 5.6026278 -7.48238e-17 -0.67944962 0.73372221 0.030049849 -1 4.5667396 9.4064684 -8.0699999e-17 -0.67944962 0.73372221 0.030049849 -2 4.5667396 9.4064684 9.7885772e-19 -0.67944962 0.73372221 0.030049849 diff --git a/meshing/test/res/ConeWithSmoothedNormals.obj b/meshing/test/res/ConeWithSmoothedNormals.obj index 4c2309cf7..5f297e5a9 100644 --- a/meshing/test/res/ConeWithSmoothedNormals.obj +++ b/meshing/test/res/ConeWithSmoothedNormals.obj @@ -2,9 +2,9 @@ # VC OBJ Exporter v1.0 # Vertices: 50 v 0 0 0 -vn -8.46545e-16 -3.46366e-16 -0.370705 +vn -8.39606e-16 -2.35922e-16 -0.370705 v 0 0 5 -vn -4.30767e-16 -1.03494e-16 0.342062 +vn -4.25215e-16 -1.02366e-16 0.342062 v 2 0 5 vn 0.365891 0.0222944 0.352723 v 1.98289 0.261052 5 @@ -54,7 +54,7 @@ vn -0.346601 0.0928714 0.350719 v -1.98289 0.261052 5 vn -0.355758 0.0468364 0.350719 v -2 2.02129e-15 5 -vn -0.358828 3.62283e-16 0.350719 +vn -0.358828 3.68127e-16 0.350719 v -1.98289 -0.261052 5 vn -0.355758 -0.0468364 0.350719 v -1.93185 -0.517638 5 @@ -78,7 +78,7 @@ vn -0.0928714 -0.346601 0.350719 v -0.261052 -1.98289 5 vn -0.0468364 -0.355758 0.350719 v -5.69646e-15 -2 5 -vn -1.03426e-15 -0.358828 0.350719 +vn -1.02842e-15 -0.358828 0.350719 v 0.261052 -1.98289 5 vn 0.0468364 -0.355758 0.350719 v 0.517638 -1.93185 5 diff --git a/meshing/test/res/CubeResamplePointCloudExample.pcd b/meshing/test/res/CubeResamplePointCloudExample.pcd deleted file mode 100644 index 08686c3af..000000000 --- a/meshing/test/res/CubeResamplePointCloudExample.pcd +++ /dev/null @@ -1,18 +0,0 @@ -# .PCD v0.7 - Point Cloud Data file format -VERSION 0.7 -FIELDS x y z normal_x normal_y normal_z curvature -SIZE 4 4 4 4 4 4 4 -TYPE F F F F F F F -COUNT 1 1 1 1 1 1 1 -WIDTH 7 -HEIGHT 1 -VIEWPOINT 0 0 0 1 0 0 0 -POINTS 7 -DATA ascii -2.165462 2.5337777 4.2007227 -0.63178128 -0.73923874 0.23319198 0.10373919 --0.90635568 3.9394855 0.33453804 -0.63178128 -0.73923874 0.23319198 0.10373919 --0.16972403 4.8014083 5.0626454 -0.63178128 -0.73923874 0.23319198 0.10373919 -0.56690758 5.663331 9.7907534 -0.63178128 -0.73923874 0.23319198 0.10373919 -4.4330926 -0.66333091 0.20924695 -0.63178128 -0.73923874 0.23319198 0.10373919 -5.169724 0.19859178 4.9373546 -0.63178128 -0.73923874 0.23319198 0.10373919 -3.5711696 3.328145 10.527385 -0.63178128 -0.73923874 0.23319198 0.10373919 diff --git a/meshing/test/res/CubeWithSmoothedNormals.obj b/meshing/test/res/CubeWithSmoothedNormals.obj index 5a4d93bd9..ddd89a32e 100644 --- a/meshing/test/res/CubeWithSmoothedNormals.obj +++ b/meshing/test/res/CubeWithSmoothedNormals.obj @@ -2,31 +2,31 @@ # VC OBJ Exporter v1.0 # Vertices: 8 v 0 0 0 -vn 0 -0.2 -0.4 +vn -0.2 -0.4 -0.4 v 0 5 0 -vn 0.25 0 -0.25 +vn -0.5 0.25 -0.25 v 5 5 0 -vn 0 -0.2 -0.4 +vn 0.2 0.4 -0.4 v 5 0 0 -vn -0.25 0 -0.25 +vn 0.5 -0.25 -0.25 v 0 0 5 -vn -0.25 0 -0.25 +vn -0.5 -0.25 0.25 v 0 5 5 -vn 0 0.2 -0.4 +vn -0.2 0.4 0.4 v 5 5 5 -vn 0.25 0 -0.25 +vn 0.5 0.25 0.25 v 5 0 5 -vn 0 0.2 -0.4 +vn 0.2 -0.4 0.4 # Faces: 12 f 1//1 2//2 3//3 -f 1//1 2//2 6//6 f 1//1 3//3 4//4 -f 1//1 4//4 5//5 -f 1//1 5//5 6//6 -f 2//2 3//3 7//7 -f 2//2 6//6 7//7 -f 3//3 4//4 8//8 -f 3//3 7//7 8//8 -f 4//4 5//5 8//8 -f 5//5 6//6 8//8 -f 6//6 7//7 8//8 +f 4//4 3//3 7//7 +f 4//4 7//7 8//8 +f 8//8 7//7 6//6 +f 8//8 6//6 5//5 +f 5//5 6//6 2//2 +f 5//5 2//2 1//1 +f 1//1 4//4 8//8 +f 1//1 8//8 5//5 +f 6//6 7//7 3//3 +f 6//6 3//3 2//2 diff --git a/meshing/test/res/ITKArchMeshConvertedToVTK.ply b/meshing/test/res/ITKArchMeshConvertedToVTK.ply index b18e0c48c..2f87ad976 100644 --- a/meshing/test/res/ITKArchMeshConvertedToVTK.ply +++ b/meshing/test/res/ITKArchMeshConvertedToVTK.ply @@ -11,106 +11,106 @@ property float nz element face 162 property list uchar int vertex_indices end_header -5 0 0 0.987688 0.156434 0 -4.75528 1.54508 0 0.923234 0.354805 0 -4.04508 2.93893 0 0.768407 0.622735 0 -2.93893 4.04508 0 0.538363 0.829707 0 -1.54508 4.75528 0 0.25562 0.955461 0 -3.06162e-16 5 0 -0.0521448 0.987688 0 --1.54508 4.75528 0 -0.354805 0.923234 0 --2.93893 4.04508 0 -0.622735 0.768407 0 --4.04508 2.93893 0 -0.829707 0.538363 0 +5 0 0 0.987688 0.156434 -2.51658e-18 +4.75528 1.54508 0 0.923234 0.354805 -1.03699e-17 +4.04508 2.93893 0 0.768407 0.622735 1.71919e-17 +2.93893 4.04508 0 0.538363 0.829707 -4.24636e-19 +1.54508 4.75528 0 0.25562 0.955461 -1.67772e-18 +3.06162e-16 5 0 -0.0521448 0.987688 4.9736e-18 +-1.54508 4.75528 0 -0.354805 0.923234 7.75683e-18 +-2.93893 4.04508 0 -0.622735 0.768407 2.00762e-17 +-4.04508 2.93893 0 -0.829707 0.538363 -9.72117e-18 -4.75528 1.54508 0 -0.891007 0.45399 0 -5 0 1 0.987688 0.156434 0 -4.75528 1.54508 1 0.939347 0.305212 0 -4.04508 2.93893 1 0.799057 0.580549 0 -2.93893 4.04508 1 0.580549 0.799057 0 -1.54508 4.75528 1 0.305212 0.939347 0 -3.06162e-16 5 1 2.91434e-16 0.987688 0 --1.54508 4.75528 1 -0.305212 0.939347 0 --2.93893 4.04508 1 -0.580549 0.799057 0 --4.04508 2.93893 1 -0.799057 0.580549 0 --4.75528 1.54508 1 -0.891007 0.45399 0 -5 0 2 0.987688 0.156434 0 -4.75528 1.54508 2 0.939347 0.305212 0 -4.04508 2.93893 2 0.799057 0.580549 0 -2.93893 4.04508 2 0.580549 0.799057 0 -1.54508 4.75528 2 0.305212 0.939347 0 -3.06162e-16 5 2 2.91434e-16 0.987688 0 --1.54508 4.75528 2 -0.305212 0.939347 0 --2.93893 4.04508 2 -0.580549 0.799057 0 --4.04508 2.93893 2 -0.799057 0.580549 0 --4.75528 1.54508 2 -0.891007 0.45399 0 -5 0 3 0.987688 0.156434 0 -4.75528 1.54508 3 0.939347 0.305212 0 -4.04508 2.93893 3 0.799057 0.580549 0 -2.93893 4.04508 3 0.580549 0.799057 0 -1.54508 4.75528 3 0.305212 0.939347 0 -3.06162e-16 5 3 2.91434e-16 0.987688 0 --1.54508 4.75528 3 -0.305212 0.939347 0 --2.93893 4.04508 3 -0.580549 0.799057 0 --4.04508 2.93893 3 -0.799057 0.580549 0 --4.75528 1.54508 3 -0.891007 0.45399 0 -5 0 4 0.987688 0.156434 0 -4.75528 1.54508 4 0.939347 0.305212 0 -4.04508 2.93893 4 0.799057 0.580549 0 -2.93893 4.04508 4 0.580549 0.799057 0 -1.54508 4.75528 4 0.305212 0.939347 0 -3.06162e-16 5 4 2.91434e-16 0.987688 0 --1.54508 4.75528 4 -0.305212 0.939347 0 --2.93893 4.04508 4 -0.580549 0.799057 0 --4.04508 2.93893 4 -0.799057 0.580549 0 --4.75528 1.54508 4 -0.891007 0.45399 0 -5 0 5 0.987688 0.156434 0 -4.75528 1.54508 5 0.939347 0.305212 0 -4.04508 2.93893 5 0.799057 0.580549 0 -2.93893 4.04508 5 0.580549 0.799057 0 -1.54508 4.75528 5 0.305212 0.939347 0 -3.06162e-16 5 5 2.91434e-16 0.987688 0 --1.54508 4.75528 5 -0.305212 0.939347 0 --2.93893 4.04508 5 -0.580549 0.799057 0 --4.04508 2.93893 5 -0.799057 0.580549 0 --4.75528 1.54508 5 -0.891007 0.45399 0 -5 0 6 0.987688 0.156434 0 -4.75528 1.54508 6 0.939347 0.305212 0 -4.04508 2.93893 6 0.799057 0.580549 0 -2.93893 4.04508 6 0.580549 0.799057 0 -1.54508 4.75528 6 0.305212 0.939347 0 -3.06162e-16 5 6 2.91434e-16 0.987688 0 --1.54508 4.75528 6 -0.305212 0.939347 0 --2.93893 4.04508 6 -0.580549 0.799057 0 --4.04508 2.93893 6 -0.799057 0.580549 0 --4.75528 1.54508 6 -0.891007 0.45399 0 -5 0 7 0.987688 0.156434 0 -4.75528 1.54508 7 0.939347 0.305212 0 -4.04508 2.93893 7 0.799057 0.580549 0 -2.93893 4.04508 7 0.580549 0.799057 0 -1.54508 4.75528 7 0.305212 0.939347 0 -3.06162e-16 5 7 2.91434e-16 0.987688 0 --1.54508 4.75528 7 -0.305212 0.939347 0 --2.93893 4.04508 7 -0.580549 0.799057 0 --4.04508 2.93893 7 -0.799057 0.580549 0 --4.75528 1.54508 7 -0.891007 0.45399 0 -5 0 8 0.987688 0.156434 0 -4.75528 1.54508 8 0.939347 0.305212 0 -4.04508 2.93893 8 0.799057 0.580549 0 -2.93893 4.04508 8 0.580549 0.799057 0 -1.54508 4.75528 8 0.305212 0.939347 0 -3.06162e-16 5 8 2.91434e-16 0.987688 0 --1.54508 4.75528 8 -0.305212 0.939347 0 --2.93893 4.04508 8 -0.580549 0.799057 0 --4.04508 2.93893 8 -0.799057 0.580549 0 --4.75528 1.54508 8 -0.891007 0.45399 0 -5 0 9 0.987688 0.156434 0 -4.75528 1.54508 9 0.955461 0.25562 0 -4.04508 2.93893 9 0.829707 0.538363 0 -2.93893 4.04508 9 0.622735 0.768407 0 -1.54508 4.75528 9 0.354805 0.923234 0 -3.06162e-16 5 9 0.0521448 0.987688 0 --1.54508 4.75528 9 -0.25562 0.955461 0 --2.93893 4.04508 9 -0.538363 0.829707 0 --4.04508 2.93893 9 -0.768407 0.622735 0 --4.75528 1.54508 9 -0.891007 0.45399 0 +5 0 1 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 1 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 1 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 1 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 1 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 1 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 1 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 1 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 1 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 1 -0.891007 0.45399 -9.72117e-18 +5 0 2 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 2 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 2 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 2 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 2 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 2 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 2 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 2 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 2 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 2 -0.891007 0.45399 -9.72117e-18 +5 0 3 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 3 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 3 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 3 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 3 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 3 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 3 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 3 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 3 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 3 -0.891007 0.45399 -9.72117e-18 +5 0 4 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 4 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 4 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 4 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 4 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 4 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 4 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 4 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 4 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 4 -0.891007 0.45399 -9.72117e-18 +5 0 5 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 5 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 5 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 5 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 5 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 5 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 5 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 5 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 5 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 5 -0.891007 0.45399 -9.72117e-18 +5 0 6 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 6 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 6 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 6 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 6 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 6 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 6 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 6 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 6 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 6 -0.891007 0.45399 -9.72117e-18 +5 0 7 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 7 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 7 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 7 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 7 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 7 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 7 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 7 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 7 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 7 -0.891007 0.45399 -9.72117e-18 +5 0 8 0.987688 0.156434 -3.35545e-18 +4.75528 1.54508 8 0.939347 0.305212 -1.12087e-17 +4.04508 2.93893 8 0.799057 0.580549 1.2007e-17 +2.93893 4.04508 8 0.580549 0.799057 8.17132e-18 +1.54508 4.75528 8 0.305212 0.939347 -1.89004e-18 +3.06162e-16 5 8 2.91434e-16 0.987688 4.13474e-18 +-1.54508 4.75528 8 -0.305212 0.939347 1.02436e-17 +-2.93893 4.04508 8 -0.580549 0.799057 2.39547e-17 +-4.04508 2.93893 8 -0.799057 0.580549 3.16945e-19 +-4.75528 1.54508 8 -0.891007 0.45399 -9.72117e-18 +5 0 9 0.987688 0.156434 -5.03317e-18 +4.75528 1.54508 9 0.955461 0.25562 -1.20476e-17 +4.04508 2.93893 9 0.829707 0.538363 6.82205e-18 +2.93893 4.04508 9 0.622735 0.768407 1.67673e-17 +1.54508 4.75528 9 0.354805 0.923234 -2.10236e-18 +3.06162e-16 5 9 0.0521448 0.987688 3.29587e-18 +-1.54508 4.75528 9 -0.25562 0.955461 1.27304e-17 +-2.93893 4.04508 9 -0.538363 0.829707 2.78331e-17 +-4.04508 2.93893 9 -0.768407 0.622735 1.03551e-17 +-4.75528 1.54508 9 -0.891007 0.45399 -1.45818e-17 3 11 10 0 3 11 0 1 3 12 11 1 diff --git a/meshing/test/res/ITKConeMeshConvertedToVTK.ply b/meshing/test/res/ITKConeMeshConvertedToVTK.ply index fc5d7f4c7..32f00a3eb 100644 --- a/meshing/test/res/ITKConeMeshConvertedToVTK.ply +++ b/meshing/test/res/ITKConeMeshConvertedToVTK.ply @@ -11,9 +11,9 @@ property float nz element face 96 property list uchar int vertex_indices end_header -0 0 0 -8.46545e-16 -3.46366e-16 -0.370705 +0 0 0 -8.39606e-16 -2.35922e-16 -0.370705 0 0 5 0 0 1 -2 0 5 0.463381 -4.56232e-16 0.314648 +2 0 5 0.463381 -4.55365e-16 0.314648 1.98289 0.261052 5 0.459417 0.0604834 0.314648 1.93185 0.517638 5 0.447592 0.119932 0.314648 1.84776 0.765367 5 0.428108 0.177328 0.314648 @@ -37,7 +37,7 @@ end_header -1.84776 0.765367 5 -0.428108 0.177328 0.314648 -1.93185 0.517638 5 -0.447592 0.119932 0.314648 -1.98289 0.261052 5 -0.459417 0.0604834 0.314648 --2 2.02129e-15 5 -0.463381 5.91541e-16 0.314648 +-2 2.02129e-15 5 -0.463381 5.88071e-16 0.314648 -1.98289 -0.261052 5 -0.459417 -0.0604834 0.314648 -1.93185 -0.517638 5 -0.447592 -0.119932 0.314648 -1.84776 -0.765367 5 -0.428108 -0.177328 0.314648 @@ -49,7 +49,7 @@ end_header -0.765367 -1.84776 5 -0.177328 -0.428108 0.314648 -0.517638 -1.93185 5 -0.119932 -0.447592 0.314648 -0.261052 -1.98289 5 -0.0604834 -0.459417 0.314648 --5.69646e-15 -2 5 -1.38257e-15 -0.463381 0.314648 +-5.69646e-15 -2 5 -1.38171e-15 -0.463381 0.314648 0.261052 -1.98289 5 0.0604834 -0.459417 0.314648 0.517638 -1.93185 5 0.119932 -0.447592 0.314648 0.765367 -1.84776 5 0.177328 -0.428108 0.314648 diff --git a/meshing/test/res/ITKCubeMeshConvertedToVTK.ply b/meshing/test/res/ITKCubeMeshConvertedToVTK.ply index 14861774c..e085376fb 100644 --- a/meshing/test/res/ITKCubeMeshConvertedToVTK.ply +++ b/meshing/test/res/ITKCubeMeshConvertedToVTK.ply @@ -11,23 +11,23 @@ property float nz element face 12 property list uchar int vertex_indices end_header -0 0 0 0 -0.2 -0.4 -0 5 0 0.25 0 -0.25 -5 5 0 0 -0.2 -0.4 -5 0 0 -0.25 0 -0.25 -0 0 5 -0.25 0 -0.25 -0 5 5 0 0.2 -0.4 -5 5 5 0.25 0 -0.25 -5 0 5 0 0.2 -0.4 +0 0 0 -0.2 -0.4 -0.4 +0 5 0 -0.5 0.25 -0.25 +5 5 0 0.2 0.4 -0.4 +5 0 0 0.5 -0.25 -0.25 +0 0 5 -0.5 -0.25 0.25 +0 5 5 -0.2 0.4 0.4 +5 5 5 0.5 0.25 0.25 +5 0 5 0.2 -0.4 0.4 3 0 1 2 -3 0 1 5 3 0 2 3 -3 0 3 4 -3 0 4 5 -3 1 2 6 -3 1 5 6 -3 2 3 7 -3 2 6 7 -3 3 4 7 -3 4 5 7 -3 5 6 7 +3 3 2 6 +3 3 6 7 +3 7 6 5 +3 7 5 4 +3 4 5 1 +3 4 1 0 +3 0 3 7 +3 0 7 4 +3 5 6 2 +3 5 2 1 diff --git a/meshing/test/res/ITKSphereMeshConvertedToVTK.ply b/meshing/test/res/ITKSphereMeshConvertedToVTK.ply index 63511ec26..3edf82ef9 100644 --- a/meshing/test/res/ITKSphereMeshConvertedToVTK.ply +++ b/meshing/test/res/ITKSphereMeshConvertedToVTK.ply @@ -11,35 +11,35 @@ property float nz element face 320 property list uchar int vertex_indices end_header --0.525731 0.850651 0 -0.518109 0.838317 0 -0.525731 0.850651 0 0.518109 0.838317 0 --0.525731 -0.850651 0 -0.518109 -0.838317 0 -0.525731 -0.850651 0 0.518109 -0.838317 0 +-0.525731 0.850651 0 -0.518109 0.838317 -8.60276e-18 +0.525731 0.850651 0 0.518109 0.838317 3.05164e-18 +-0.525731 -0.850651 0 -0.518109 -0.838317 6.93889e-18 +0.525731 -0.850651 0 0.518109 -0.838317 -8.60276e-18 0 -0.525731 0.850651 0 -0.518109 0.838317 -0 0.525731 0.850651 0 0.518109 0.838317 +0 0.525731 0.850651 -6.93889e-18 0.518109 0.838317 0 -0.525731 -0.850651 0 -0.518109 -0.838317 -0 0.525731 -0.850651 -2.77556e-18 0.518109 -0.838317 -0.850651 0 -0.525731 0.838317 0 -0.518109 -0.850651 0 0.525731 0.838317 0 0.518109 --0.850651 0 -0.525731 -0.838317 0 -0.518109 --0.850651 0 0.525731 -0.838317 0 0.518109 +0 0.525731 -0.850651 0 0.518109 -0.838317 +0.850651 0 -0.525731 0.838317 3.46945e-18 -0.518109 +0.850651 0 0.525731 0.838317 -3.46945e-18 0.518109 +-0.850651 0 -0.525731 -0.838317 6.93889e-18 -0.518109 +-0.850651 0 0.525731 -0.838317 1.38778e-17 0.518109 -0.809017 0.5 0.309017 -0.796697 0.492386 0.304311 -0.5 0.309017 0.809017 -0.492386 0.304311 0.796697 -0.309017 0.809017 0.5 -0.304311 0.796697 0.492386 0.309017 0.809017 0.5 0.304311 0.796697 0.492386 -0 1 0 0 0.984772 9.25186e-18 +0 1 0 4.64705e-19 0.984772 0 0.309017 0.809017 -0.5 0.304311 0.796697 -0.492386 -0.309017 0.809017 -0.5 -0.304311 0.796697 -0.492386 -0.5 0.309017 -0.809017 -0.492386 0.304311 -0.796697 -0.809017 0.5 -0.309017 -0.796697 0.492386 -0.304311 --1 0 0 -0.984772 -4.62593e-18 0 +-1 0 0 -0.984772 -6.93889e-18 9.78962e-19 0.5 0.309017 0.809017 0.492386 0.304311 0.796697 0.809017 0.5 0.309017 0.796697 0.492386 0.304311 -0.5 -0.309017 0.809017 -0.492386 -0.304311 0.796697 -0 0 1 4.62593e-18 0 0.984772 +0 0 1 0 -4.64705e-19 0.984772 -0.809017 -0.5 -0.309017 -0.796697 -0.492386 -0.304311 -0.809017 -0.5 0.309017 -0.796697 -0.492386 0.304311 -0 0 -1 4.62593e-18 0 -0.984772 +0 0 -1 0 4.64705e-19 -0.984772 -0.5 -0.309017 -0.809017 -0.492386 -0.304311 -0.796697 0.809017 0.5 -0.309017 0.796697 0.492386 -0.304311 0.5 0.309017 -0.809017 0.492386 0.304311 -0.796697 @@ -47,12 +47,12 @@ end_header 0.5 -0.309017 0.809017 0.492386 -0.304311 0.796697 0.309017 -0.809017 0.5 0.304311 -0.796697 0.492386 -0.309017 -0.809017 0.5 -0.304311 -0.796697 0.492386 -0 -1 0 0 -0.984772 9.25186e-18 +0 -1 0 -4.64705e-19 -0.984772 0 -0.309017 -0.809017 -0.5 -0.304311 -0.796697 -0.492386 0.309017 -0.809017 -0.5 0.304311 -0.796697 -0.492386 0.5 -0.309017 -0.809017 0.492386 -0.304311 -0.796697 0.809017 -0.5 -0.309017 0.796697 -0.492386 -0.304311 -1 0 0 0.984772 4.62593e-18 0 +1 0 0 0.984772 6.93889e-18 9.78962e-19 -0.69378 0.702046 0.160622 -0.676851 0.700156 0.150881 -0.587785 0.688191 0.425325 -0.578444 0.670456 0.429567 -0.433889 0.862668 0.259892 -0.43272 0.851037 0.244131 @@ -63,10 +63,10 @@ end_header -0.425325 0.587785 0.688191 -0.429567 0.578444 0.670456 -0.259892 0.433889 0.862668 -0.244131 0.43272 0.851037 -0.16246 0.951057 0.262866 -0.148877 0.935942 0.265487 --0.273267 0.961938 0 -0.281839 0.944287 0 +-0.273267 0.961938 0 -0.281839 0.944287 -6.93889e-18 0.160622 0.69378 0.702046 0.150881 0.676851 0.700156 -0 0.850651 0.525731 0 0.843931 0.506376 -0.273267 0.961938 0 0.281839 0.944287 0 +0 0.850651 0.525731 -3.04696e-18 0.843931 0.506376 +0.273267 0.961938 0 0.281839 0.944287 6.93889e-18 0.16246 0.951057 0.262866 0.148877 0.935942 0.265487 0.433889 0.862668 0.259892 0.43272 0.851037 0.244131 -0.16246 0.951057 -0.262866 -0.148877 0.935942 -0.265487 @@ -74,7 +74,7 @@ end_header 0.433889 0.862668 -0.259892 0.43272 0.851037 -0.244131 0.16246 0.951057 -0.262866 0.148877 0.935942 -0.265487 -0.160622 0.69378 -0.702046 -0.150881 0.676851 -0.700156 -0 0.850651 -0.525731 0 0.843931 -0.506376 +0 0.850651 -0.525731 5.78241e-18 0.843931 -0.506376 0.160622 0.69378 -0.702046 0.150881 0.676851 -0.700156 -0.587785 0.688191 -0.425325 -0.578444 0.670456 -0.429567 -0.69378 0.702046 -0.160622 -0.676851 0.700156 -0.150881 @@ -83,11 +83,11 @@ end_header -0.862668 0.259892 -0.433889 -0.851037 0.244131 -0.43272 -0.688191 0.425325 -0.587785 -0.670456 0.429567 -0.578444 -0.702046 0.160622 -0.69378 -0.700156 0.150881 -0.676851 --0.850651 0.525731 0 -0.843931 0.506376 0 --0.961938 0 -0.273267 -0.944287 -4.62593e-18 -0.281839 +-0.850651 0.525731 0 -0.843931 0.506376 1.73472e-17 +-0.961938 0 -0.273267 -0.944287 0 -0.281839 -0.951057 0.262866 -0.16246 -0.935942 0.265487 -0.148877 -0.951057 0.262866 0.16246 -0.935942 0.265487 0.148877 --0.961938 0 0.273267 -0.944287 9.25186e-18 0.281839 +-0.961938 0 0.273267 -0.944287 6.93889e-18 0.281839 0.587785 0.688191 0.425325 0.578444 0.670456 0.429567 0.69378 0.702046 0.160622 0.676851 0.700156 0.150881 0.259892 0.433889 0.862668 0.244131 0.43272 0.851037 @@ -96,10 +96,10 @@ end_header 0.688191 0.425325 0.587785 0.670456 0.429567 0.578444 0.702046 0.160622 0.69378 0.700156 0.150881 0.676851 -0.262866 0.16246 0.951057 -0.265487 0.148877 0.935942 -0 0.273267 0.961938 -9.25186e-18 0.281839 0.944287 +0 0.273267 0.961938 6.93889e-18 0.281839 0.944287 -0.702046 -0.160622 0.69378 -0.700156 -0.150881 0.676851 --0.525731 0 0.850651 -0.506376 0 0.843931 -0 -0.273267 0.961938 4.62593e-18 -0.281839 0.944287 +-0.525731 0 0.850651 -0.506376 3.04696e-18 0.843931 +0 -0.273267 0.961938 6.93889e-18 -0.281839 0.944287 -0.262866 -0.16246 0.951057 -0.265487 -0.148877 0.935942 -0.259892 -0.433889 0.862668 -0.244131 -0.43272 0.851037 -0.951057 -0.262866 0.16246 -0.935942 -0.265487 0.148877 @@ -107,15 +107,15 @@ end_header -0.862668 -0.259892 -0.433889 -0.851037 -0.244131 -0.43272 -0.951057 -0.262866 -0.16246 -0.935942 -0.265487 -0.148877 -0.69378 -0.702046 0.160622 -0.676851 -0.700156 0.150881 --0.850651 -0.525731 0 -0.843931 -0.506376 0 +-0.850651 -0.525731 0 -0.843931 -0.506376 -1.15648e-17 -0.69378 -0.702046 -0.160622 -0.676851 -0.700156 -0.150881 --0.525731 0 -0.850651 -0.506376 0 -0.843931 +-0.525731 0 -0.850651 -0.506376 -5.78241e-18 -0.843931 -0.702046 -0.160622 -0.69378 -0.700156 -0.150881 -0.676851 -0 0.273267 -0.961938 4.62593e-18 0.281839 -0.944287 +0 0.273267 -0.961938 6.93889e-18 0.281839 -0.944287 -0.262866 0.16246 -0.951057 -0.265487 0.148877 -0.935942 -0.259892 -0.433889 -0.862668 -0.244131 -0.43272 -0.851037 -0.262866 -0.16246 -0.951057 -0.265487 -0.148877 -0.935942 -0 -0.273267 -0.961938 -9.25186e-18 -0.281839 -0.944287 +0 -0.273267 -0.961938 6.93889e-18 -0.281839 -0.944287 0.425325 0.587785 -0.688191 0.429567 0.578444 -0.670456 0.259892 0.433889 -0.862668 0.244131 0.43272 -0.851037 0.69378 0.702046 -0.160622 0.676851 0.700156 -0.150881 @@ -133,10 +133,10 @@ end_header 0.425325 -0.587785 0.688191 0.429567 -0.578444 0.670456 0.259892 -0.433889 0.862668 0.244131 -0.43272 0.851037 0.16246 -0.951057 0.262866 0.148877 -0.935942 0.265487 -0.273267 -0.961938 0 0.281839 -0.944287 0 +0.273267 -0.961938 0 0.281839 -0.944287 -6.93889e-18 -0.160622 -0.69378 0.702046 -0.150881 -0.676851 0.700156 -0 -0.850651 0.525731 0 -0.843931 0.506376 --0.273267 -0.961938 0 -0.281839 -0.944287 0 +0 -0.850651 0.525731 3.04696e-18 -0.843931 0.506376 +-0.273267 -0.961938 0 -0.281839 -0.944287 6.93889e-18 -0.16246 -0.951057 0.262866 -0.148877 -0.935942 0.265487 -0.433889 -0.862668 0.259892 -0.43272 -0.851037 0.244131 0.16246 -0.951057 -0.262866 0.148877 -0.935942 -0.265487 @@ -144,7 +144,7 @@ end_header -0.433889 -0.862668 -0.259892 -0.43272 -0.851037 -0.244131 -0.16246 -0.951057 -0.262866 -0.148877 -0.935942 -0.265487 0.160622 -0.69378 -0.702046 0.150881 -0.676851 -0.700156 -0 -0.850651 -0.525731 0 -0.843931 -0.506376 +0 -0.850651 -0.525731 -5.78241e-18 -0.843931 -0.506376 -0.160622 -0.69378 -0.702046 -0.150881 -0.676851 -0.700156 0.587785 -0.688191 -0.425325 0.578444 -0.670456 -0.429567 0.69378 -0.702046 -0.160622 0.676851 -0.700156 -0.150881 @@ -153,13 +153,13 @@ end_header 0.862668 -0.259892 -0.433889 0.851037 -0.244131 -0.43272 0.688191 -0.425325 -0.587785 0.670456 -0.429567 -0.578444 0.702046 -0.160622 -0.69378 0.700156 -0.150881 -0.676851 -0.850651 -0.525731 0 0.843931 -0.506376 0 -0.961938 0 -0.273267 0.944287 4.62593e-18 -0.281839 +0.850651 -0.525731 0 0.843931 -0.506376 1.73472e-17 +0.961938 0 -0.273267 0.944287 0 -0.281839 0.951057 -0.262866 -0.16246 0.935942 -0.265487 -0.148877 0.951057 -0.262866 0.16246 0.935942 -0.265487 0.148877 -0.961938 0 0.273267 0.944287 -9.25186e-18 0.281839 +0.961938 0 0.273267 0.944287 -6.93889e-18 0.281839 0.262866 -0.16246 0.951057 0.265487 -0.148877 0.935942 -0.525731 0 0.850651 0.506376 0 0.843931 +0.525731 0 0.850651 0.506376 -3.04696e-18 0.843931 0.262866 0.16246 0.951057 0.265487 0.148877 0.935942 -0.587785 -0.688191 0.425325 -0.578444 -0.670456 0.429567 -0.425325 -0.587785 0.688191 -0.429567 -0.578444 0.670456 @@ -167,12 +167,12 @@ end_header -0.425325 -0.587785 -0.688191 -0.429567 -0.578444 -0.670456 -0.587785 -0.688191 -0.425325 -0.578444 -0.670456 -0.429567 -0.688191 -0.425325 -0.587785 -0.670456 -0.429567 -0.578444 -0.525731 0 -0.850651 0.506376 0 -0.843931 +0.525731 0 -0.850651 0.506376 5.78241e-18 -0.843931 0.262866 -0.16246 -0.951057 0.265487 -0.148877 -0.935942 0.262866 0.16246 -0.951057 0.265487 0.148877 -0.935942 0.951057 0.262866 0.16246 0.935942 0.265487 0.148877 0.951057 0.262866 -0.16246 0.935942 0.265487 -0.148877 -0.850651 0.525731 0 0.843931 0.506376 0 +0.850651 0.525731 0 0.843931 0.506376 -1.15648e-17 3 0 42 44 3 12 43 42 3 14 44 43 diff --git a/meshing/test/res/PlaneResamplePointCloudExample.pcd b/meshing/test/res/PlaneResamplePointCloudExample.pcd deleted file mode 100644 index c66705de9..000000000 --- a/meshing/test/res/PlaneResamplePointCloudExample.pcd +++ /dev/null @@ -1,36 +0,0 @@ -# .PCD v0.7 - Point Cloud Data file format -VERSION 0.7 -FIELDS x y z normal_x normal_y normal_z curvature -SIZE 4 4 4 4 4 4 4 -TYPE F F F F F F F -COUNT 1 1 1 1 1 1 1 -WIDTH 25 -HEIGHT 1 -VIEWPOINT 0 0 0 1 0 0 0 -POINTS 25 -DATA ascii -1.0950514e-17 -0.51792693 1.2401578 1.9181222e-17 -0.90721512 0.42066702 0.035740476 -5.1873013e-18 0.24534403 2.8862362 -1.9181222e-17 -0.90721512 0.42066702 0.035740476 -0 1.008615 4.5323148 0 -0.90721512 0.42066702 0.035740476 --2.6599442e-18 2.1258075 6.9416642 1.9181222e-17 -0.90721512 0.42066702 0.035740476 --3.3263751e-17 3.243 9.3510141 -3.9864434e-17 -0.90721512 0.42066702 0.035740476 -1 -0.89956242 0.41711858 0 -0.90721512 0.42066702 0.035740476 -1 -0.13629146 2.0631971 1.9181222e-17 -0.90721512 0.42066702 0.035740476 -1 0.62697953 3.7092755 0 -0.90721512 0.42066702 0.035740476 -1 1.5672113 5.7369895 0 -0.90721512 0.42066702 0.035740476 -1 2.6844037 8.1463394 -3.9864434e-17 -0.90721512 0.42066702 0.035740476 -2 -0.51792693 1.2401578 0 -0.90721512 0.42066702 0.035740476 -2 0.24534403 2.8862362 0 -0.90721512 0.42066702 0.035740476 -2 1.008615 4.5323148 0 -0.90721512 0.42066702 0.035740476 -2 2.1258075 6.9416642 0 -0.90721512 0.42066702 0.035740476 -2 3.243 9.3510141 0 -0.90721512 0.42066702 0.035740476 -3 -0.89956242 0.41711858 0 -0.90721512 0.42066702 0.035740476 -3 -0.13629146 2.0631971 0 -0.90721512 0.42066702 0.035740476 -3 0.62697953 3.7092755 0 -0.90721512 0.42066702 0.035740476 -3 1.5672113 5.7369895 0 -0.90721512 0.42066702 0.035740476 -3 2.6844037 8.1463394 3.9864434e-17 -0.90721512 0.42066702 0.035740476 -4 -0.51792693 1.2401578 0 -0.90721512 0.42066702 0.035740476 -4 0.24534403 2.8862362 0 -0.90721512 0.42066702 0.035740476 -4 1.008615 4.5323148 0 -0.90721512 0.42066702 0.035740476 -4 2.1258075 6.9416642 -1.9181222e-17 -0.90721512 0.42066702 0.035740476 -4 3.243 9.3510141 3.9864434e-17 -0.90721512 0.42066702 0.035740476 diff --git a/meshing/test/res/ScaledArchMesh.obj b/meshing/test/res/ScaledArchMesh.obj index 89b4bb8f3..d01cf5146 100644 --- a/meshing/test/res/ScaledArchMesh.obj +++ b/meshing/test/res/ScaledArchMesh.obj @@ -2,205 +2,205 @@ # VC OBJ Exporter v1.0 # Vertices: 100 v 15 0 0 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -2.51658e-18 v 14.2658 4.63525 0 -vn 0.923234 0.354805 0 +vn 0.923234 0.354805 -1.03699e-17 v 12.1353 8.81678 0 -vn 0.768407 0.622735 0 +vn 0.768407 0.622735 1.71919e-17 v 8.81678 12.1353 0 -vn 0.538363 0.829707 0 +vn 0.538363 0.829707 -4.24636e-19 v 4.63525 14.2658 0 -vn 0.25562 0.955461 0 +vn 0.25562 0.955461 -1.67772e-18 v 9.18485e-16 15 0 -vn -0.0521448 0.987688 0 +vn -0.0521448 0.987688 4.9736e-18 v -4.63525 14.2658 0 -vn -0.354805 0.923234 0 +vn -0.354805 0.923234 7.75683e-18 v -8.81678 12.1353 0 -vn -0.622735 0.768407 0 +vn -0.622735 0.768407 2.00762e-17 v -12.1353 8.81678 0 -vn -0.829707 0.538363 0 +vn -0.829707 0.538363 -9.72117e-18 v -14.2658 4.63525 0 vn -0.891007 0.45399 0 v 15 0 3 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 3 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 3 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 3 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 3 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 3 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 3 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 3 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 3 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 3 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 6 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 6 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 6 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 6 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 6 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 6 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 6 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 6 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 6 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 6 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 9 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 9 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 9 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 9 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 9 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 9 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 9 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 9 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 9 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 9 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 12 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 12 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 12 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 12 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 12 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 12 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 12 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 12 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 12 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 12 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 15 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 15 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 15 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 15 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 15 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 15 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 15 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 15 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 15 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 15 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 18 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 18 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 18 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 18 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 18 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 18 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 18 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 18 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 18 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 18 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 21 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 21 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 21 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 21 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 21 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 21 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 21 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 21 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 21 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 21 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 24 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 14.2658 4.63525 24 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 12.1353 8.81678 24 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 8.81678 12.1353 24 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 4.63525 14.2658 24 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 9.18485e-16 15 24 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -4.63525 14.2658 24 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -8.81678 12.1353 24 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -12.1353 8.81678 24 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -14.2658 4.63525 24 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 15 0 27 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -5.03317e-18 v 14.2658 4.63525 27 -vn 0.955461 0.25562 0 +vn 0.955461 0.25562 -1.20476e-17 v 12.1353 8.81678 27 -vn 0.829707 0.538363 0 +vn 0.829707 0.538363 6.82205e-18 v 8.81678 12.1353 27 -vn 0.622735 0.768407 0 +vn 0.622735 0.768407 1.67673e-17 v 4.63525 14.2658 27 -vn 0.354805 0.923234 0 +vn 0.354805 0.923234 -2.10236e-18 v 9.18485e-16 15 27 -vn 0.0521448 0.987688 0 +vn 0.0521448 0.987688 3.29587e-18 v -4.63525 14.2658 27 -vn -0.25562 0.955461 0 +vn -0.25562 0.955461 1.27304e-17 v -8.81678 12.1353 27 -vn -0.538363 0.829707 0 +vn -0.538363 0.829707 2.78331e-17 v -12.1353 8.81678 27 -vn -0.768407 0.622735 0 +vn -0.768407 0.622735 1.03551e-17 v -14.2658 4.63525 27 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -1.45818e-17 # Faces: 162 f 12//12 11//11 1//1 f 12//12 1//1 2//2 diff --git a/meshing/test/res/ScaledConeMesh.obj b/meshing/test/res/ScaledConeMesh.obj index 99eccb712..3516b240e 100644 --- a/meshing/test/res/ScaledConeMesh.obj +++ b/meshing/test/res/ScaledConeMesh.obj @@ -2,11 +2,11 @@ # VC OBJ Exporter v1.0 # Vertices: 50 v 0 0 0 -vn -8.46545e-16 -3.46366e-16 -0.370705 +vn -8.39606e-16 -2.35922e-16 -0.370705 v 0 0 15 vn 0 0 1 v 6 0 15 -vn 0.463381 -4.56232e-16 0.314648 +vn 0.463381 -4.55365e-16 0.314648 v 5.94867 0.783157 15 vn 0.459417 0.0604834 0.314648 v 5.79555 1.55291 15 @@ -54,7 +54,7 @@ vn -0.447592 0.119932 0.314648 v -5.94867 0.783157 15 vn -0.459417 0.0604834 0.314648 v -6 6.06386e-15 15 -vn -0.463381 5.91541e-16 0.314648 +vn -0.463381 5.88071e-16 0.314648 v -5.94867 -0.783157 15 vn -0.459417 -0.0604834 0.314648 v -5.79555 -1.55291 15 @@ -78,7 +78,7 @@ vn -0.119932 -0.447592 0.314648 v -0.783157 -5.94867 15 vn -0.0604834 -0.459417 0.314648 v -1.70894e-14 -6 15 -vn -1.38257e-15 -0.463381 0.314648 +vn -1.38171e-15 -0.463381 0.314648 v 0.783157 -5.94867 15 vn 0.0604834 -0.459417 0.314648 v 1.55291 -5.79555 15 diff --git a/meshing/test/res/ScaledCubeMesh.obj b/meshing/test/res/ScaledCubeMesh.obj index 35890cfaf..a12617128 100644 --- a/meshing/test/res/ScaledCubeMesh.obj +++ b/meshing/test/res/ScaledCubeMesh.obj @@ -2,31 +2,31 @@ # VC OBJ Exporter v1.0 # Vertices: 8 v 0 0 0 -vn 0 -0.2 -0.4 +vn -0.2 -0.4 -0.4 v 0 15 0 -vn 0.25 0 -0.25 +vn -0.5 0.25 -0.25 v 15 15 0 -vn 0 -0.2 -0.4 +vn 0.2 0.4 -0.4 v 15 0 0 -vn -0.25 0 -0.25 +vn 0.5 -0.25 -0.25 v 0 0 15 -vn -0.25 0 -0.25 +vn -0.5 -0.25 0.25 v 0 15 15 -vn 0 0.2 -0.4 +vn -0.2 0.4 0.4 v 15 15 15 -vn 0.25 0 -0.25 +vn 0.5 0.25 0.25 v 15 0 15 -vn 0 0.2 -0.4 +vn 0.2 -0.4 0.4 # Faces: 12 f 1//1 2//2 3//3 -f 1//1 2//2 6//6 f 1//1 3//3 4//4 -f 1//1 4//4 5//5 -f 1//1 5//5 6//6 -f 2//2 3//3 7//7 -f 2//2 6//6 7//7 -f 3//3 4//4 8//8 -f 3//3 7//7 8//8 -f 4//4 5//5 8//8 -f 5//5 6//6 8//8 -f 6//6 7//7 8//8 +f 4//4 3//3 7//7 +f 4//4 7//7 8//8 +f 8//8 7//7 6//6 +f 8//8 6//6 5//5 +f 5//5 6//6 2//2 +f 5//5 2//2 1//1 +f 1//1 4//4 8//8 +f 1//1 8//8 5//5 +f 6//6 7//7 3//3 +f 6//6 3//3 2//2 diff --git a/meshing/test/res/ScaledSphereMesh.obj b/meshing/test/res/ScaledSphereMesh.obj index 03ac0676c..f842bd426 100644 --- a/meshing/test/res/ScaledSphereMesh.obj +++ b/meshing/test/res/ScaledSphereMesh.obj @@ -2,29 +2,29 @@ # VC OBJ Exporter v1.0 # Vertices: 162 v -1.57719 2.55195 0 -vn -0.518109 0.838317 0 +vn -0.518109 0.838317 -8.60276e-18 v 1.57719 2.55195 0 -vn 0.518109 0.838317 0 +vn 0.518109 0.838317 3.05164e-18 v -1.57719 -2.55195 0 -vn -0.518109 -0.838317 0 +vn -0.518109 -0.838317 6.93889e-18 v 1.57719 -2.55195 0 -vn 0.518109 -0.838317 0 +vn 0.518109 -0.838317 -8.60276e-18 v 0 -1.57719 2.55195 vn 0 -0.518109 0.838317 v 0 1.57719 2.55195 -vn 0 0.518109 0.838317 +vn -6.93889e-18 0.518109 0.838317 v 0 -1.57719 -2.55195 vn 0 -0.518109 -0.838317 v 0 1.57719 -2.55195 -vn -2.77556e-18 0.518109 -0.838317 +vn 0 0.518109 -0.838317 v 2.55195 0 -1.57719 -vn 0.838317 0 -0.518109 +vn 0.838317 3.46945e-18 -0.518109 v 2.55195 0 1.57719 -vn 0.838317 0 0.518109 +vn 0.838317 -3.46945e-18 0.518109 v -2.55195 0 -1.57719 -vn -0.838317 0 -0.518109 +vn -0.838317 6.93889e-18 -0.518109 v -2.55195 0 1.57719 -vn -0.838317 0 0.518109 +vn -0.838317 1.38778e-17 0.518109 v -2.42705 1.5 0.927051 vn -0.796697 0.492386 0.304311 v -1.5 0.927051 2.42705 @@ -34,7 +34,7 @@ vn -0.304311 0.796697 0.492386 v 0.927051 2.42705 1.5 vn 0.304311 0.796697 0.492386 v 0 3 0 -vn 0 0.984772 9.25186e-18 +vn 4.64705e-19 0.984772 0 v 0.927051 2.42705 -1.5 vn 0.304311 0.796697 -0.492386 v -0.927051 2.42705 -1.5 @@ -44,7 +44,7 @@ vn -0.492386 0.304311 -0.796697 v -2.42705 1.5 -0.927051 vn -0.796697 0.492386 -0.304311 v -3 0 0 -vn -0.984772 -4.62593e-18 0 +vn -0.984772 -6.93889e-18 9.78962e-19 v 1.5 0.927051 2.42705 vn 0.492386 0.304311 0.796697 v 2.42705 1.5 0.927051 @@ -52,13 +52,13 @@ vn 0.796697 0.492386 0.304311 v -1.5 -0.927051 2.42705 vn -0.492386 -0.304311 0.796697 v 0 0 3 -vn 4.62593e-18 0 0.984772 +vn 0 -4.64705e-19 0.984772 v -2.42705 -1.5 -0.927051 vn -0.796697 -0.492386 -0.304311 v -2.42705 -1.5 0.927051 vn -0.796697 -0.492386 0.304311 v 0 0 -3 -vn 4.62593e-18 0 -0.984772 +vn 0 4.64705e-19 -0.984772 v -1.5 -0.927051 -2.42705 vn -0.492386 -0.304311 -0.796697 v 2.42705 1.5 -0.927051 @@ -74,7 +74,7 @@ vn 0.304311 -0.796697 0.492386 v -0.927051 -2.42705 1.5 vn -0.304311 -0.796697 0.492386 v 0 -3 0 -vn 0 -0.984772 9.25186e-18 +vn -4.64705e-19 -0.984772 0 v -0.927051 -2.42705 -1.5 vn -0.304311 -0.796697 -0.492386 v 0.927051 -2.42705 -1.5 @@ -84,7 +84,7 @@ vn 0.492386 -0.304311 -0.796697 v 2.42705 -1.5 -0.927051 vn 0.796697 -0.492386 -0.304311 v 3 0 0 -vn 0.984772 4.62593e-18 0 +vn 0.984772 6.93889e-18 9.78962e-19 v -2.08134 2.10614 0.481866 vn -0.676851 0.700156 0.150881 v -1.76336 2.06457 1.27598 @@ -106,13 +106,13 @@ vn -0.244131 0.43272 0.851037 v -0.48738 2.85317 0.788597 vn -0.148877 0.935942 0.265487 v -0.8198 2.88582 0 -vn -0.281839 0.944287 0 +vn -0.281839 0.944287 -6.93889e-18 v 0.481866 2.08134 2.10614 vn 0.150881 0.676851 0.700156 v 0 2.55195 1.57719 -vn 0 0.843931 0.506376 +vn -3.04696e-18 0.843931 0.506376 v 0.8198 2.88582 0 -vn 0.281839 0.944287 0 +vn 0.281839 0.944287 6.93889e-18 v 0.48738 2.85317 0.788597 vn 0.148877 0.935942 0.265487 v 1.30167 2.58801 0.779676 @@ -128,7 +128,7 @@ vn 0.148877 0.935942 -0.265487 v -0.481866 2.08134 -2.10614 vn -0.150881 0.676851 -0.700156 v 0 2.55195 -1.57719 -vn 0 0.843931 -0.506376 +vn 5.78241e-18 0.843931 -0.506376 v 0.481866 2.08134 -2.10614 vn 0.150881 0.676851 -0.700156 v -1.76336 2.06457 -1.27598 @@ -146,15 +146,15 @@ vn -0.670456 0.429567 -0.578444 v -2.10614 0.481866 -2.08134 vn -0.700156 0.150881 -0.676851 v -2.55195 1.57719 0 -vn -0.843931 0.506376 0 +vn -0.843931 0.506376 1.73472e-17 v -2.88582 0 -0.8198 -vn -0.944287 -4.62593e-18 -0.281839 +vn -0.944287 0 -0.281839 v -2.85317 0.788597 -0.48738 vn -0.935942 0.265487 -0.148877 v -2.85317 0.788597 0.48738 vn -0.935942 0.265487 0.148877 v -2.88582 0 0.8198 -vn -0.944287 9.25186e-18 0.281839 +vn -0.944287 6.93889e-18 0.281839 v 1.76336 2.06457 1.27598 vn 0.578444 0.670456 0.429567 v 2.08134 2.10614 0.481866 @@ -172,13 +172,13 @@ vn 0.700156 0.150881 0.676851 v -0.788597 0.48738 2.85317 vn -0.265487 0.148877 0.935942 v 0 0.8198 2.88582 -vn -9.25186e-18 0.281839 0.944287 +vn 6.93889e-18 0.281839 0.944287 v -2.10614 -0.481866 2.08134 vn -0.700156 -0.150881 0.676851 v -1.57719 0 2.55195 -vn -0.506376 0 0.843931 +vn -0.506376 3.04696e-18 0.843931 v 0 -0.8198 2.88582 -vn 4.62593e-18 -0.281839 0.944287 +vn 6.93889e-18 -0.281839 0.944287 v -0.788597 -0.48738 2.85317 vn -0.265487 -0.148877 0.935942 v -0.779676 -1.30167 2.58801 @@ -194,15 +194,15 @@ vn -0.935942 -0.265487 -0.148877 v -2.08134 -2.10614 0.481866 vn -0.676851 -0.700156 0.150881 v -2.55195 -1.57719 0 -vn -0.843931 -0.506376 0 +vn -0.843931 -0.506376 -1.15648e-17 v -2.08134 -2.10614 -0.481866 vn -0.676851 -0.700156 -0.150881 v -1.57719 0 -2.55195 -vn -0.506376 0 -0.843931 +vn -0.506376 -5.78241e-18 -0.843931 v -2.10614 -0.481866 -2.08134 vn -0.700156 -0.150881 -0.676851 v 0 0.8198 -2.88582 -vn 4.62593e-18 0.281839 -0.944287 +vn 6.93889e-18 0.281839 -0.944287 v -0.788597 0.48738 -2.85317 vn -0.265487 0.148877 -0.935942 v -0.779676 -1.30167 -2.58801 @@ -210,7 +210,7 @@ vn -0.244131 -0.43272 -0.851037 v -0.788597 -0.48738 -2.85317 vn -0.265487 -0.148877 -0.935942 v 0 -0.8198 -2.88582 -vn -9.25186e-18 -0.281839 -0.944287 +vn 6.93889e-18 -0.281839 -0.944287 v 1.27598 1.76336 -2.06457 vn 0.429567 0.578444 -0.670456 v 0.779676 1.30167 -2.58801 @@ -246,13 +246,13 @@ vn 0.244131 -0.43272 0.851037 v 0.48738 -2.85317 0.788597 vn 0.148877 -0.935942 0.265487 v 0.8198 -2.88582 0 -vn 0.281839 -0.944287 0 +vn 0.281839 -0.944287 -6.93889e-18 v -0.481866 -2.08134 2.10614 vn -0.150881 -0.676851 0.700156 v 0 -2.55195 1.57719 -vn 0 -0.843931 0.506376 +vn 3.04696e-18 -0.843931 0.506376 v -0.8198 -2.88582 0 -vn -0.281839 -0.944287 0 +vn -0.281839 -0.944287 6.93889e-18 v -0.48738 -2.85317 0.788597 vn -0.148877 -0.935942 0.265487 v -1.30167 -2.58801 0.779676 @@ -268,7 +268,7 @@ vn -0.148877 -0.935942 -0.265487 v 0.481866 -2.08134 -2.10614 vn 0.150881 -0.676851 -0.700156 v 0 -2.55195 -1.57719 -vn 0 -0.843931 -0.506376 +vn -5.78241e-18 -0.843931 -0.506376 v -0.481866 -2.08134 -2.10614 vn -0.150881 -0.676851 -0.700156 v 1.76336 -2.06457 -1.27598 @@ -286,19 +286,19 @@ vn 0.670456 -0.429567 -0.578444 v 2.10614 -0.481866 -2.08134 vn 0.700156 -0.150881 -0.676851 v 2.55195 -1.57719 0 -vn 0.843931 -0.506376 0 +vn 0.843931 -0.506376 1.73472e-17 v 2.88582 0 -0.8198 -vn 0.944287 4.62593e-18 -0.281839 +vn 0.944287 0 -0.281839 v 2.85317 -0.788597 -0.48738 vn 0.935942 -0.265487 -0.148877 v 2.85317 -0.788597 0.48738 vn 0.935942 -0.265487 0.148877 v 2.88582 0 0.8198 -vn 0.944287 -9.25186e-18 0.281839 +vn 0.944287 -6.93889e-18 0.281839 v 0.788597 -0.48738 2.85317 vn 0.265487 -0.148877 0.935942 v 1.57719 0 2.55195 -vn 0.506376 0 0.843931 +vn 0.506376 -3.04696e-18 0.843931 v 0.788597 0.48738 2.85317 vn 0.265487 0.148877 0.935942 v -1.76336 -2.06457 1.27598 @@ -314,7 +314,7 @@ vn -0.578444 -0.670456 -0.429567 v -2.06457 -1.27598 -1.76336 vn -0.670456 -0.429567 -0.578444 v 1.57719 0 -2.55195 -vn 0.506376 0 -0.843931 +vn 0.506376 5.78241e-18 -0.843931 v 0.788597 -0.48738 -2.85317 vn 0.265487 -0.148877 -0.935942 v 0.788597 0.48738 -2.85317 @@ -324,7 +324,7 @@ vn 0.935942 0.265487 0.148877 v 2.85317 0.788597 -0.48738 vn 0.935942 0.265487 -0.148877 v 2.55195 1.57719 0 -vn 0.843931 0.506376 0 +vn 0.843931 0.506376 -1.15648e-17 # Faces: 320 f 1//1 43//43 45//45 f 13//13 44//44 43//43 diff --git a/meshing/test/res/SphereResamplePointCloudExample.pcd b/meshing/test/res/SphereResamplePointCloudExample.pcd deleted file mode 100644 index 5ed5dee5b..000000000 --- a/meshing/test/res/SphereResamplePointCloudExample.pcd +++ /dev/null @@ -1,27 +0,0 @@ -# .PCD v0.7 - Point Cloud Data file format -VERSION 0.7 -FIELDS x y z normal_x normal_y normal_z curvature -SIZE 4 4 4 4 4 4 4 -TYPE F F F F F F F -COUNT 1 1 1 1 1 1 1 -WIDTH 16 -HEIGHT 1 -VIEWPOINT 0 0 0 1 0 0 0 -POINTS 16 -DATA ascii --1.2345059 -0.38561043 -0.96511942 -0.19266513 -0.95579368 0.2221228 0.042548809 --1.26195 -0.3137089 0.033234805 -0.097009644 -0.99287456 -0.069204085 0.042548809 --1.1027973 -0.73067826 4.042779 -0.1973353 -0.85646421 0.47699881 0.042548809 --0.84873188 -0.39631218 -0.94198531 0.10470667 -0.95708948 0.27021512 0.042548809 --0.88549775 -0.299988 0.055809945 0.17636259 -0.98213887 -0.065570466 0.042548809 --0.69732773 -0.79298073 4.0670943 -0.10629629 -0.87492228 0.4724533 0.042548809 --1.0284002 0.074406415 5.0472403 -0.18866862 -0.66686147 0.72090214 0.042548809 --0.29373929 -0.23042309 -0.96867156 0.41893074 -0.84729362 0.32648215 0.042548809 --0.34658641 -0.091967262 0.028159313 0.47594696 -0.87788361 -0.052866317 0.042548809 --0.012293207 -0.96779263 3.0482063 0.27361351 -0.958498 -0.080107354 0.042548809 --0.072521701 -0.8099981 4.0445948 0.088074647 -0.912027 0.40056163 0.042548809 -0.020524032 -0.053771567 -0.94982576 0.43809357 -0.8427757 0.31273499 0.042548809 --0.037608128 0.098530725 0.046688166 0.50257063 -0.86235666 -0.061349206 0.042548809 -0.28631389 -0.7501229 4.0661135 0.18743533 -0.90776825 0.37526625 0.042548809 -0.028354308 -0.074286349 5.0506439 0.0093789343 -0.70728332 0.70686799 0.042548809 -0.96783948 0.08425837 -0.95298517 -0.30062938 -0.88539934 0.35452786 0.042548809 diff --git a/meshing/test/res/SphereWithSmoothedNormals.obj b/meshing/test/res/SphereWithSmoothedNormals.obj index 9afeaecf6..cf5e7468b 100644 --- a/meshing/test/res/SphereWithSmoothedNormals.obj +++ b/meshing/test/res/SphereWithSmoothedNormals.obj @@ -2,29 +2,29 @@ # VC OBJ Exporter v1.0 # Vertices: 162 v -0.525731 0.850651 0 -vn -0.00317858 0.00514305 2.58825e-17 +vn -0.00317858 0.00514305 -1.33346e-17 v 0.525731 0.850651 0 -vn 0.00317858 0.00514305 3.95049e-17 +vn 0.00317858 0.00514305 1.08979e-17 v -0.525731 -0.850651 0 -vn -0.00317858 -0.00514305 -6.60685e-17 +vn -0.00317858 -0.00514305 -6.19818e-17 v 0.525731 -0.850651 0 -vn 0.00317858 -0.00514305 7.08363e-17 +vn 0.00317858 -0.00514305 2.24769e-17 v 0 -0.525731 0.850651 -vn -3.2864e-17 -0.00317858 0.00514305 +vn 2.07741e-17 -0.00317858 0.00514305 v 0 0.525731 0.850651 -vn -3.30342e-17 0.00317858 0.00514305 +vn 7.83286e-18 0.00317858 0.00514305 v 0 -0.525731 -0.850651 -vn -9.02482e-18 -0.00317858 -0.00514305 +vn 2.16255e-17 -0.00317858 -0.00514305 v 0 0.525731 -0.850651 -vn 4.95797e-17 0.00317858 -0.00514305 +vn -3.95049e-17 0.00317858 -0.00514305 v 0.850651 0 -0.525731 -vn 0.00514305 1.63468e-17 -0.00317858 +vn 0.00514305 7.73256e-17 -0.00317858 v 0.850651 0 0.525731 -vn 0.00514305 1.02168e-18 0.00317858 +vn 0.00514305 3.33748e-17 0.00317858 v -0.850651 0 -0.525731 -vn -0.00514305 -6.47062e-18 -0.00317858 +vn -0.00514305 5.31272e-17 -0.00317858 v -0.850651 0 0.525731 -vn -0.00514305 -6.13007e-18 0.00317858 +vn -0.00514305 3.54182e-17 0.00317858 v -0.809017 0.5 0.309017 vn -0.00488771 0.00302077 0.00186694 v -0.5 0.309017 0.809017 @@ -34,7 +34,7 @@ vn -0.00186694 0.00488771 0.00302077 v 0.309017 0.809017 0.5 vn 0.00186694 0.00488771 0.00302077 v 0 1 0 -vn 4.95797e-17 0.00604155 2.58825e-17 +vn -1.77091e-17 0.00604155 -1.33346e-17 v 0.309017 0.809017 -0.5 vn 0.00186694 0.00488771 -0.00302077 v -0.309017 0.809017 -0.5 @@ -44,7 +44,7 @@ vn -0.00302077 0.00186694 -0.00488771 v -0.809017 0.5 -0.309017 vn -0.00488771 0.00302077 -0.00186694 v -1 0 0 -vn -0.00604155 -1.73685e-17 -2.24769e-17 +vn -0.00604155 3.13314e-17 -6.19818e-17 v 0.5 0.309017 0.809017 vn 0.00302077 0.00186694 0.00488771 v 0.809017 0.5 0.309017 @@ -52,13 +52,13 @@ vn 0.00488771 0.00302077 0.00186694 v -0.5 -0.309017 0.809017 vn -0.00302077 -0.00186694 0.00488771 v 0 0 1 -vn -1.10682e-17 1.56657e-17 0.00604155 +vn 3.1672e-17 3.54182e-17 0.00604155 v -0.809017 -0.5 -0.309017 vn -0.00488771 -0.00302077 -0.00186694 v -0.809017 -0.5 0.309017 vn -0.00488771 -0.00302077 0.00186694 v 0 0 -1 -vn -9.02482e-18 -6.47062e-18 -0.00604155 +vn 2.16255e-17 5.31272e-17 -0.00604155 v -0.5 -0.309017 -0.809017 vn -0.00302077 -0.00186694 -0.00488771 v 0.809017 0.5 -0.309017 @@ -74,7 +74,7 @@ vn 0.00186694 -0.00488771 0.00302077 v -0.309017 -0.809017 0.5 vn -0.00186694 -0.00488771 0.00302077 v 0 -1 0 -vn -9.02482e-18 -0.00604155 -6.60685e-17 +vn 2.16255e-17 -0.00604155 -6.19818e-17 v -0.309017 -0.809017 -0.5 vn -0.00186694 -0.00488771 -0.00302077 v 0.309017 -0.809017 -0.5 @@ -84,7 +84,7 @@ vn 0.00302077 -0.00186694 -0.00488771 v 0.809017 -0.5 -0.309017 vn 0.00488771 -0.00302077 -0.00186694 v 1 0 0 -vn 0.00604155 2.72447e-17 2.72447e-17 +vn 0.00604155 5.55298e-17 -2.11147e-17 v -0.69378 0.702046 0.160622 vn -0.00415246 0.00429543 0.000925652 v -0.587785 0.688191 0.425325 @@ -106,13 +106,13 @@ vn -0.00149774 0.00265472 0.00522109 v -0.16246 0.951057 0.262866 vn -0.000913358 0.00574198 0.00162875 v -0.273267 0.961938 0 -vn -0.00172907 0.00579317 2.58825e-17 +vn -0.00172907 0.00579317 -1.33346e-17 v 0.160622 0.69378 0.702046 vn 0.000925652 0.00415246 0.00429543 v 0 0.850651 0.525731 -vn 1.05573e-17 0.00517749 0.0031066 +vn -4.66566e-17 0.00517749 0.0031066 v 0.273267 0.961938 0 -vn 0.00172907 0.00579317 3.95049e-17 +vn 0.00172907 0.00579317 1.08979e-17 v 0.16246 0.951057 0.262866 vn 0.000913358 0.00574198 0.00162875 v 0.433889 0.862668 0.259892 @@ -128,7 +128,7 @@ vn 0.000913358 0.00574198 -0.00162875 v -0.160622 0.69378 -0.702046 vn -0.000925652 0.00415246 -0.00429543 v 0 0.850651 -0.525731 -vn 4.95797e-17 0.00517749 -0.0031066 +vn -3.95049e-17 0.00517749 -0.0031066 v 0.160622 0.69378 -0.702046 vn 0.000925652 0.00415246 -0.00429543 v -0.587785 0.688191 -0.425325 @@ -146,15 +146,15 @@ vn -0.00411322 0.00263538 -0.00354874 v -0.702046 0.160622 -0.69378 vn -0.00429543 0.000925652 -0.00415246 v -0.850651 0.525731 0 -vn -0.00517749 0.0031066 2.58825e-17 +vn -0.00517749 0.0031066 -1.33346e-17 v -0.961938 0 -0.273267 -vn -0.00579317 -1.73685e-17 -0.00172907 +vn -0.00579317 3.13314e-17 -0.00172907 v -0.951057 0.262866 -0.16246 vn -0.00574198 0.00162875 -0.000913358 v -0.951057 0.262866 0.16246 vn -0.00574198 0.00162875 0.000913358 v -0.961938 0 0.273267 -vn -0.00579317 -6.13007e-18 0.00172907 +vn -0.00579317 3.54182e-17 0.00172907 v 0.587785 0.688191 0.425325 vn 0.00354874 0.00411322 0.00263538 v 0.69378 0.702046 0.160622 @@ -172,13 +172,13 @@ vn 0.00429543 0.000925652 0.00415246 v -0.262866 0.16246 0.951057 vn -0.00162875 0.000913358 0.00574198 v 0 0.273267 0.961938 -vn -3.30342e-17 0.00172907 0.00579317 +vn 7.83286e-18 0.00172907 0.00579317 v -0.702046 -0.160622 0.69378 vn -0.00429543 -0.000925652 0.00415246 v -0.525731 0 0.850651 -vn -0.0031066 1.56657e-17 0.00517749 +vn -0.0031066 3.54182e-17 0.00517749 v 0 -0.273267 0.961938 -vn -1.10682e-17 -0.00172907 0.00579317 +vn 3.1672e-17 -0.00172907 0.00579317 v -0.262866 -0.16246 0.951057 vn -0.00162875 -0.000913358 0.00574198 v -0.259892 -0.433889 0.862668 @@ -194,15 +194,15 @@ vn -0.00574198 -0.00162875 -0.000913358 v -0.69378 -0.702046 0.160622 vn -0.00415246 -0.00429543 0.000925652 v -0.850651 -0.525731 0 -vn -0.00517749 -0.0031066 -6.60685e-17 +vn -0.00517749 -0.0031066 -6.19818e-17 v -0.69378 -0.702046 -0.160622 vn -0.00415246 -0.00429543 -0.000925652 v -0.525731 0 -0.850651 -vn -0.0031066 -6.47062e-18 -0.00517749 +vn -0.0031066 5.31272e-17 -0.00517749 v -0.702046 -0.160622 -0.69378 vn -0.00429543 -0.000925652 -0.00415246 v 0 0.273267 -0.961938 -vn 4.95797e-17 0.00172907 -0.00579317 +vn -3.95049e-17 0.00172907 -0.00579317 v -0.262866 0.16246 -0.951057 vn -0.00162875 0.000913358 -0.00574198 v -0.259892 -0.433889 -0.862668 @@ -210,7 +210,7 @@ vn -0.00149774 -0.00265472 -0.00522109 v -0.262866 -0.16246 -0.951057 vn -0.00162875 -0.000913358 -0.00574198 v 0 -0.273267 -0.961938 -vn -9.02482e-18 -0.00172907 -0.00579317 +vn 2.16255e-17 -0.00172907 -0.00579317 v 0.425325 0.587785 -0.688191 vn 0.00263538 0.00354874 -0.00411322 v 0.259892 0.433889 -0.862668 @@ -246,13 +246,13 @@ vn 0.00149774 -0.00265472 0.00522109 v 0.16246 -0.951057 0.262866 vn 0.000913358 -0.00574198 0.00162875 v 0.273267 -0.961938 0 -vn 0.00172907 -0.00579317 7.08363e-17 +vn 0.00172907 -0.00579317 6.60685e-17 v -0.160622 -0.69378 0.702046 vn -0.000925652 -0.00415246 0.00429543 v 0 -0.850651 0.525731 -vn -3.2864e-17 -0.00517749 0.0031066 +vn 4.25699e-17 -0.00517749 0.0031066 v -0.273267 -0.961938 0 -vn -0.00172907 -0.00579317 -6.60685e-17 +vn -0.00172907 -0.00579317 -6.19818e-17 v -0.16246 -0.951057 0.262866 vn -0.000913358 -0.00574198 0.00162875 v -0.433889 -0.862668 0.259892 @@ -268,7 +268,7 @@ vn -0.000913358 -0.00574198 -0.00162875 v 0.160622 -0.69378 -0.702046 vn 0.000925652 -0.00415246 -0.00429543 v 0 -0.850651 -0.525731 -vn -9.02482e-18 -0.00517749 -0.0031066 +vn 2.16255e-17 -0.00517749 -0.0031066 v -0.160622 -0.69378 -0.702046 vn -0.000925652 -0.00415246 -0.00429543 v 0.587785 -0.688191 -0.425325 @@ -286,19 +286,19 @@ vn 0.00411322 -0.00263538 -0.00354874 v 0.702046 -0.160622 -0.69378 vn 0.00429543 -0.000925652 -0.00415246 v 0.850651 -0.525731 0 -vn 0.00517749 -0.0031066 7.08363e-17 +vn 0.00517749 -0.0031066 2.24769e-17 v 0.961938 0 -0.273267 -vn 0.00579317 2.72447e-17 -0.00172907 +vn 0.00579317 5.55298e-17 -0.00172907 v 0.951057 -0.262866 -0.16246 vn 0.00574198 -0.00162875 -0.000913358 v 0.951057 -0.262866 0.16246 vn 0.00574198 -0.00162875 0.000913358 v 0.961938 0 0.273267 -vn 0.00579317 -2.07741e-17 0.00172907 +vn 0.00579317 3.33748e-17 0.00172907 v 0.262866 -0.16246 0.951057 vn 0.00162875 -0.000913358 0.00574198 v 0.525731 0 0.850651 -vn 0.0031066 1.02168e-18 0.00517749 +vn 0.0031066 1.1579e-17 0.00517749 v 0.262866 0.16246 0.951057 vn 0.00162875 0.000913358 0.00574198 v -0.587785 -0.688191 0.425325 @@ -314,7 +314,7 @@ vn -0.00354874 -0.00411322 -0.00263538 v -0.688191 -0.425325 -0.587785 vn -0.00411322 -0.00263538 -0.00354874 v 0.525731 0 -0.850651 -vn 0.0031066 1.63468e-17 -0.00517749 +vn 0.0031066 7.73256e-17 -0.00517749 v 0.262866 -0.16246 -0.951057 vn 0.00162875 -0.000913358 -0.00574198 v 0.262866 0.16246 -0.951057 @@ -324,7 +324,7 @@ vn 0.00574198 0.00162875 0.000913358 v 0.951057 0.262866 -0.16246 vn 0.00574198 0.00162875 -0.000913358 v 0.850651 0.525731 0 -vn 0.00517749 0.0031066 3.95049e-17 +vn 0.00517749 0.0031066 1.08979e-17 # Faces: 320 f 1//1 43//43 45//45 f 13//13 44//44 43//43 diff --git a/meshing/test/res/VTKArchMeshConvertedToITK.obj b/meshing/test/res/VTKArchMeshConvertedToITK.obj index 448268cd6..f077f557e 100644 --- a/meshing/test/res/VTKArchMeshConvertedToITK.obj +++ b/meshing/test/res/VTKArchMeshConvertedToITK.obj @@ -2,205 +2,205 @@ # VC OBJ Exporter v1.0 # Vertices: 100 v 5 0 0 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -2.51658e-18 v 4.75528 1.54508 0 -vn 0.923234 0.354805 0 +vn 0.923234 0.354805 -1.03699e-17 v 4.04508 2.93893 0 -vn 0.768407 0.622735 0 +vn 0.768407 0.622735 1.71919e-17 v 2.93893 4.04508 0 -vn 0.538363 0.829707 0 +vn 0.538363 0.829707 -4.24636e-19 v 1.54508 4.75528 0 -vn 0.25562 0.955461 0 +vn 0.25562 0.955461 -1.67772e-18 v 3.06162e-16 5 0 -vn -0.0521448 0.987688 0 +vn -0.0521448 0.987688 4.9736e-18 v -1.54508 4.75528 0 -vn -0.354805 0.923234 0 +vn -0.354805 0.923234 7.75683e-18 v -2.93893 4.04508 0 -vn -0.622735 0.768407 0 +vn -0.622735 0.768407 2.00762e-17 v -4.04508 2.93893 0 -vn -0.829707 0.538363 0 +vn -0.829707 0.538363 -9.72117e-18 v -4.75528 1.54508 0 vn -0.891007 0.45399 0 v 5 0 1 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 1 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 1 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 1 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 1 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 1 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 1 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 1 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 1 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 1 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 2 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 2 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 2 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 2 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 2 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 2 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 2 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 2 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 2 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 2 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 3 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 3 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 3 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 3 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 3 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 3 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 3 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 3 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 3 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 3 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 4 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 4 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 4 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 4 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 4 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 4 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 4 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 4 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 4 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 4 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 5 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 5 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 5 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 5 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 5 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 5 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 5 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 5 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 5 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 5 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 6 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 6 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 6 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 6 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 6 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 6 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 6 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 6 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 6 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 6 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 7 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 7 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 7 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 7 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 7 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 7 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 7 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 7 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 7 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 7 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 8 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -3.35545e-18 v 4.75528 1.54508 8 -vn 0.939347 0.305212 0 +vn 0.939347 0.305212 -1.12087e-17 v 4.04508 2.93893 8 -vn 0.799057 0.580549 0 +vn 0.799057 0.580549 1.2007e-17 v 2.93893 4.04508 8 -vn 0.580549 0.799057 0 +vn 0.580549 0.799057 8.17132e-18 v 1.54508 4.75528 8 -vn 0.305212 0.939347 0 +vn 0.305212 0.939347 -1.89004e-18 v 3.06162e-16 5 8 -vn 2.91434e-16 0.987688 0 +vn 2.91434e-16 0.987688 4.13474e-18 v -1.54508 4.75528 8 -vn -0.305212 0.939347 0 +vn -0.305212 0.939347 1.02436e-17 v -2.93893 4.04508 8 -vn -0.580549 0.799057 0 +vn -0.580549 0.799057 2.39547e-17 v -4.04508 2.93893 8 -vn -0.799057 0.580549 0 +vn -0.799057 0.580549 3.16945e-19 v -4.75528 1.54508 8 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -9.72117e-18 v 5 0 9 -vn 0.987688 0.156434 0 +vn 0.987688 0.156434 -5.03317e-18 v 4.75528 1.54508 9 -vn 0.955461 0.25562 0 +vn 0.955461 0.25562 -1.20476e-17 v 4.04508 2.93893 9 -vn 0.829707 0.538363 0 +vn 0.829707 0.538363 6.82205e-18 v 2.93893 4.04508 9 -vn 0.622735 0.768407 0 +vn 0.622735 0.768407 1.67673e-17 v 1.54508 4.75528 9 -vn 0.354805 0.923234 0 +vn 0.354805 0.923234 -2.10236e-18 v 3.06162e-16 5 9 -vn 0.0521448 0.987688 0 +vn 0.0521448 0.987688 3.29587e-18 v -1.54508 4.75528 9 -vn -0.25562 0.955461 0 +vn -0.25562 0.955461 1.27304e-17 v -2.93893 4.04508 9 -vn -0.538363 0.829707 0 +vn -0.538363 0.829707 2.78331e-17 v -4.04508 2.93893 9 -vn -0.768407 0.622735 0 +vn -0.768407 0.622735 1.03551e-17 v -4.75528 1.54508 9 -vn -0.891007 0.45399 0 +vn -0.891007 0.45399 -1.45818e-17 # Faces: 162 f 12//12 11//11 1//1 f 12//12 1//1 2//2 diff --git a/meshing/test/res/VTKConeMeshConvertedToITK.obj b/meshing/test/res/VTKConeMeshConvertedToITK.obj index 2cb9d0013..96e5352ce 100644 --- a/meshing/test/res/VTKConeMeshConvertedToITK.obj +++ b/meshing/test/res/VTKConeMeshConvertedToITK.obj @@ -2,11 +2,11 @@ # VC OBJ Exporter v1.0 # Vertices: 50 v 0 0 0 -vn -8.46545e-16 -3.46366e-16 -0.370705 +vn -8.39606e-16 -2.35922e-16 -0.370705 v 0 0 5 vn 0 0 1 v 2 0 5 -vn 0.463381 -4.56232e-16 0.314648 +vn 0.463381 -4.55365e-16 0.314648 v 1.98289 0.261052 5 vn 0.459417 0.0604834 0.314648 v 1.93185 0.517638 5 @@ -54,7 +54,7 @@ vn -0.447592 0.119932 0.314648 v -1.98289 0.261052 5 vn -0.459417 0.0604834 0.314648 v -2 2.02129e-15 5 -vn -0.463381 5.91541e-16 0.314648 +vn -0.463381 5.88071e-16 0.314648 v -1.98289 -0.261052 5 vn -0.459417 -0.0604834 0.314648 v -1.93185 -0.517638 5 @@ -78,7 +78,7 @@ vn -0.119932 -0.447592 0.314648 v -0.261052 -1.98289 5 vn -0.0604834 -0.459417 0.314648 v -5.69646e-15 -2 5 -vn -1.38257e-15 -0.463381 0.314648 +vn -1.38171e-15 -0.463381 0.314648 v 0.261052 -1.98289 5 vn 0.0604834 -0.459417 0.314648 v 0.517638 -1.93185 5 diff --git a/meshing/test/res/VTKCubeMeshConvertedToITK.obj b/meshing/test/res/VTKCubeMeshConvertedToITK.obj index 5a4d93bd9..ddd89a32e 100644 --- a/meshing/test/res/VTKCubeMeshConvertedToITK.obj +++ b/meshing/test/res/VTKCubeMeshConvertedToITK.obj @@ -2,31 +2,31 @@ # VC OBJ Exporter v1.0 # Vertices: 8 v 0 0 0 -vn 0 -0.2 -0.4 +vn -0.2 -0.4 -0.4 v 0 5 0 -vn 0.25 0 -0.25 +vn -0.5 0.25 -0.25 v 5 5 0 -vn 0 -0.2 -0.4 +vn 0.2 0.4 -0.4 v 5 0 0 -vn -0.25 0 -0.25 +vn 0.5 -0.25 -0.25 v 0 0 5 -vn -0.25 0 -0.25 +vn -0.5 -0.25 0.25 v 0 5 5 -vn 0 0.2 -0.4 +vn -0.2 0.4 0.4 v 5 5 5 -vn 0.25 0 -0.25 +vn 0.5 0.25 0.25 v 5 0 5 -vn 0 0.2 -0.4 +vn 0.2 -0.4 0.4 # Faces: 12 f 1//1 2//2 3//3 -f 1//1 2//2 6//6 f 1//1 3//3 4//4 -f 1//1 4//4 5//5 -f 1//1 5//5 6//6 -f 2//2 3//3 7//7 -f 2//2 6//6 7//7 -f 3//3 4//4 8//8 -f 3//3 7//7 8//8 -f 4//4 5//5 8//8 -f 5//5 6//6 8//8 -f 6//6 7//7 8//8 +f 4//4 3//3 7//7 +f 4//4 7//7 8//8 +f 8//8 7//7 6//6 +f 8//8 6//6 5//5 +f 5//5 6//6 2//2 +f 5//5 2//2 1//1 +f 1//1 4//4 8//8 +f 1//1 8//8 5//5 +f 6//6 7//7 3//3 +f 6//6 3//3 2//2 diff --git a/meshing/test/res/VTKSphereMeshConvertedToITK.obj b/meshing/test/res/VTKSphereMeshConvertedToITK.obj index 262764f92..c0b036017 100644 --- a/meshing/test/res/VTKSphereMeshConvertedToITK.obj +++ b/meshing/test/res/VTKSphereMeshConvertedToITK.obj @@ -2,29 +2,29 @@ # VC OBJ Exporter v1.0 # Vertices: 162 v -0.525731 0.850651 0 -vn -0.518109 0.838317 0 +vn -0.518109 0.838317 -8.60276e-18 v 0.525731 0.850651 0 -vn 0.518109 0.838317 0 +vn 0.518109 0.838317 3.05164e-18 v -0.525731 -0.850651 0 -vn -0.518109 -0.838317 0 +vn -0.518109 -0.838317 6.93889e-18 v 0.525731 -0.850651 0 -vn 0.518109 -0.838317 0 +vn 0.518109 -0.838317 -8.60276e-18 v 0 -0.525731 0.850651 vn 0 -0.518109 0.838317 v 0 0.525731 0.850651 -vn 0 0.518109 0.838317 +vn -6.93889e-18 0.518109 0.838317 v 0 -0.525731 -0.850651 vn 0 -0.518109 -0.838317 v 0 0.525731 -0.850651 -vn -2.77556e-18 0.518109 -0.838317 +vn 0 0.518109 -0.838317 v 0.850651 0 -0.525731 -vn 0.838317 0 -0.518109 +vn 0.838317 3.46945e-18 -0.518109 v 0.850651 0 0.525731 -vn 0.838317 0 0.518109 +vn 0.838317 -3.46945e-18 0.518109 v -0.850651 0 -0.525731 -vn -0.838317 0 -0.518109 +vn -0.838317 6.93889e-18 -0.518109 v -0.850651 0 0.525731 -vn -0.838317 0 0.518109 +vn -0.838317 1.38778e-17 0.518109 v -0.809017 0.5 0.309017 vn -0.796697 0.492386 0.304311 v -0.5 0.309017 0.809017 @@ -34,7 +34,7 @@ vn -0.304311 0.796697 0.492386 v 0.309017 0.809017 0.5 vn 0.304311 0.796697 0.492386 v 0 1 0 -vn 0 0.984772 9.25186e-18 +vn 4.64705e-19 0.984772 0 v 0.309017 0.809017 -0.5 vn 0.304311 0.796697 -0.492386 v -0.309017 0.809017 -0.5 @@ -44,7 +44,7 @@ vn -0.492386 0.304311 -0.796697 v -0.809017 0.5 -0.309017 vn -0.796697 0.492386 -0.304311 v -1 0 0 -vn -0.984772 -4.62593e-18 0 +vn -0.984772 -6.93889e-18 9.78962e-19 v 0.5 0.309017 0.809017 vn 0.492386 0.304311 0.796697 v 0.809017 0.5 0.309017 @@ -52,13 +52,13 @@ vn 0.796697 0.492386 0.304311 v -0.5 -0.309017 0.809017 vn -0.492386 -0.304311 0.796697 v 0 0 1 -vn 4.62593e-18 0 0.984772 +vn 0 -4.64705e-19 0.984772 v -0.809017 -0.5 -0.309017 vn -0.796697 -0.492386 -0.304311 v -0.809017 -0.5 0.309017 vn -0.796697 -0.492386 0.304311 v 0 0 -1 -vn 4.62593e-18 0 -0.984772 +vn 0 4.64705e-19 -0.984772 v -0.5 -0.309017 -0.809017 vn -0.492386 -0.304311 -0.796697 v 0.809017 0.5 -0.309017 @@ -74,7 +74,7 @@ vn 0.304311 -0.796697 0.492386 v -0.309017 -0.809017 0.5 vn -0.304311 -0.796697 0.492386 v 0 -1 0 -vn 0 -0.984772 9.25186e-18 +vn -4.64705e-19 -0.984772 0 v -0.309017 -0.809017 -0.5 vn -0.304311 -0.796697 -0.492386 v 0.309017 -0.809017 -0.5 @@ -84,7 +84,7 @@ vn 0.492386 -0.304311 -0.796697 v 0.809017 -0.5 -0.309017 vn 0.796697 -0.492386 -0.304311 v 1 0 0 -vn 0.984772 4.62593e-18 0 +vn 0.984772 6.93889e-18 9.78962e-19 v -0.69378 0.702046 0.160622 vn -0.676851 0.700156 0.150881 v -0.587785 0.688191 0.425325 @@ -106,13 +106,13 @@ vn -0.244131 0.43272 0.851037 v -0.16246 0.951057 0.262866 vn -0.148877 0.935942 0.265487 v -0.273267 0.961938 0 -vn -0.281839 0.944287 0 +vn -0.281839 0.944287 -6.93889e-18 v 0.160622 0.69378 0.702046 vn 0.150881 0.676851 0.700156 v 0 0.850651 0.525731 -vn 0 0.843931 0.506376 +vn -3.04696e-18 0.843931 0.506376 v 0.273267 0.961938 0 -vn 0.281839 0.944287 0 +vn 0.281839 0.944287 6.93889e-18 v 0.16246 0.951057 0.262866 vn 0.148877 0.935942 0.265487 v 0.433889 0.862668 0.259892 @@ -128,7 +128,7 @@ vn 0.148877 0.935942 -0.265487 v -0.160622 0.69378 -0.702046 vn -0.150881 0.676851 -0.700156 v 0 0.850651 -0.525731 -vn 0 0.843931 -0.506376 +vn 5.78241e-18 0.843931 -0.506376 v 0.160622 0.69378 -0.702046 vn 0.150881 0.676851 -0.700156 v -0.587785 0.688191 -0.425325 @@ -146,15 +146,15 @@ vn -0.670456 0.429567 -0.578444 v -0.702046 0.160622 -0.69378 vn -0.700156 0.150881 -0.676851 v -0.850651 0.525731 0 -vn -0.843931 0.506376 0 +vn -0.843931 0.506376 1.73472e-17 v -0.961938 0 -0.273267 -vn -0.944287 -4.62593e-18 -0.281839 +vn -0.944287 0 -0.281839 v -0.951057 0.262866 -0.16246 vn -0.935942 0.265487 -0.148877 v -0.951057 0.262866 0.16246 vn -0.935942 0.265487 0.148877 v -0.961938 0 0.273267 -vn -0.944287 9.25186e-18 0.281839 +vn -0.944287 6.93889e-18 0.281839 v 0.587785 0.688191 0.425325 vn 0.578444 0.670456 0.429567 v 0.69378 0.702046 0.160622 @@ -172,13 +172,13 @@ vn 0.700156 0.150881 0.676851 v -0.262866 0.16246 0.951057 vn -0.265487 0.148877 0.935942 v 0 0.273267 0.961938 -vn -9.25186e-18 0.281839 0.944287 +vn 6.93889e-18 0.281839 0.944287 v -0.702046 -0.160622 0.69378 vn -0.700156 -0.150881 0.676851 v -0.525731 0 0.850651 -vn -0.506376 0 0.843931 +vn -0.506376 3.04696e-18 0.843931 v 0 -0.273267 0.961938 -vn 4.62593e-18 -0.281839 0.944287 +vn 6.93889e-18 -0.281839 0.944287 v -0.262866 -0.16246 0.951057 vn -0.265487 -0.148877 0.935942 v -0.259892 -0.433889 0.862668 @@ -194,15 +194,15 @@ vn -0.935942 -0.265487 -0.148877 v -0.69378 -0.702046 0.160622 vn -0.676851 -0.700156 0.150881 v -0.850651 -0.525731 0 -vn -0.843931 -0.506376 0 +vn -0.843931 -0.506376 -1.15648e-17 v -0.69378 -0.702046 -0.160622 vn -0.676851 -0.700156 -0.150881 v -0.525731 0 -0.850651 -vn -0.506376 0 -0.843931 +vn -0.506376 -5.78241e-18 -0.843931 v -0.702046 -0.160622 -0.69378 vn -0.700156 -0.150881 -0.676851 v 0 0.273267 -0.961938 -vn 4.62593e-18 0.281839 -0.944287 +vn 6.93889e-18 0.281839 -0.944287 v -0.262866 0.16246 -0.951057 vn -0.265487 0.148877 -0.935942 v -0.259892 -0.433889 -0.862668 @@ -210,7 +210,7 @@ vn -0.244131 -0.43272 -0.851037 v -0.262866 -0.16246 -0.951057 vn -0.265487 -0.148877 -0.935942 v 0 -0.273267 -0.961938 -vn -9.25186e-18 -0.281839 -0.944287 +vn 6.93889e-18 -0.281839 -0.944287 v 0.425325 0.587785 -0.688191 vn 0.429567 0.578444 -0.670456 v 0.259892 0.433889 -0.862668 @@ -246,13 +246,13 @@ vn 0.244131 -0.43272 0.851037 v 0.16246 -0.951057 0.262866 vn 0.148877 -0.935942 0.265487 v 0.273267 -0.961938 0 -vn 0.281839 -0.944287 0 +vn 0.281839 -0.944287 -6.93889e-18 v -0.160622 -0.69378 0.702046 vn -0.150881 -0.676851 0.700156 v 0 -0.850651 0.525731 -vn 0 -0.843931 0.506376 +vn 3.04696e-18 -0.843931 0.506376 v -0.273267 -0.961938 0 -vn -0.281839 -0.944287 0 +vn -0.281839 -0.944287 6.93889e-18 v -0.16246 -0.951057 0.262866 vn -0.148877 -0.935942 0.265487 v -0.433889 -0.862668 0.259892 @@ -268,7 +268,7 @@ vn -0.148877 -0.935942 -0.265487 v 0.160622 -0.69378 -0.702046 vn 0.150881 -0.676851 -0.700156 v 0 -0.850651 -0.525731 -vn 0 -0.843931 -0.506376 +vn -5.78241e-18 -0.843931 -0.506376 v -0.160622 -0.69378 -0.702046 vn -0.150881 -0.676851 -0.700156 v 0.587785 -0.688191 -0.425325 @@ -286,19 +286,19 @@ vn 0.670456 -0.429567 -0.578444 v 0.702046 -0.160622 -0.69378 vn 0.700156 -0.150881 -0.676851 v 0.850651 -0.525731 0 -vn 0.843931 -0.506376 0 +vn 0.843931 -0.506376 1.73472e-17 v 0.961938 0 -0.273267 -vn 0.944287 4.62593e-18 -0.281839 +vn 0.944287 0 -0.281839 v 0.951057 -0.262866 -0.16246 vn 0.935942 -0.265487 -0.148877 v 0.951057 -0.262866 0.16246 vn 0.935942 -0.265487 0.148877 v 0.961938 0 0.273267 -vn 0.944287 -9.25186e-18 0.281839 +vn 0.944287 -6.93889e-18 0.281839 v 0.262866 -0.16246 0.951057 vn 0.265487 -0.148877 0.935942 v 0.525731 0 0.850651 -vn 0.506376 0 0.843931 +vn 0.506376 -3.04696e-18 0.843931 v 0.262866 0.16246 0.951057 vn 0.265487 0.148877 0.935942 v -0.587785 -0.688191 0.425325 @@ -314,7 +314,7 @@ vn -0.578444 -0.670456 -0.429567 v -0.688191 -0.425325 -0.587785 vn -0.670456 -0.429567 -0.578444 v 0.525731 0 -0.850651 -vn 0.506376 0 -0.843931 +vn 0.506376 5.78241e-18 -0.843931 v 0.262866 -0.16246 -0.951057 vn 0.265487 -0.148877 -0.935942 v 0.262866 0.16246 -0.951057 @@ -324,7 +324,7 @@ vn 0.935942 0.265487 0.148877 v 0.951057 0.262866 -0.16246 vn 0.935942 0.265487 -0.148877 v 0.850651 0.525731 0 -vn 0.843931 0.506376 0 +vn 0.843931 0.506376 -1.15648e-17 # Faces: 320 f 1//1 43//43 45//45 f 13//13 44//44 43//43 From 40e8a77c5fbccbbb05978e7040369041c08f8f1a Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 15:01:57 -0400 Subject: [PATCH 09/12] (meshing) Add OrientNormals tests --- apps/src/GeneratePPM.cpp | 2 +- core/CMakeLists.txt | 1 - core/include/vc/core/shapes/Cube.hpp | 2 +- meshing/CMakeLists.txt | 1 + meshing/test/ITK2VTKTest.cpp | 4 +- meshing/test/OrientNormalsTest.cpp | 77 ++++++++++++++++++++++++++++ 6 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 meshing/test/OrientNormalsTest.cpp diff --git a/apps/src/GeneratePPM.cpp b/apps/src/GeneratePPM.cpp index 393ff4059..0dc5f39f9 100644 --- a/apps/src/GeneratePPM.cpp +++ b/apps/src/GeneratePPM.cpp @@ -5,9 +5,9 @@ #include "vc/core/io/MeshIO.hpp" #include "vc/core/types/PerPixelMap.hpp" #include "vc/core/util/Logging.hpp" +#include "vc/meshing/OrientNormals.hpp" #include "vc/texturing/AngleBasedFlattening.hpp" #include "vc/texturing/PPMGenerator.hpp" -#include "vc/meshing/OrientNormals.hpp" namespace vc = volcart; namespace vcm = volcart::meshing; diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 5f49a83ae..1f211f9e5 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -61,7 +61,6 @@ set(util_srcs set(logging_srcs src/Logging.cpp - include/vc/core/util/Json.hpp ) configure_file(src/Version.cpp.in Version.cpp) diff --git a/core/include/vc/core/shapes/Cube.hpp b/core/include/vc/core/shapes/Cube.hpp index 14c2863db..483b0ae40 100644 --- a/core/include/vc/core/shapes/Cube.hpp +++ b/core/include/vc/core/shapes/Cube.hpp @@ -43,7 +43,7 @@ class Cube : public ShapePrimitive addCell_(0, 1, 2); addCell_(0, 2, 3); addCell_(3, 2, 6); - addCell_(3,6,7); + addCell_(3, 6, 7); addCell_(7, 6, 5); addCell_(7, 5, 4); addCell_(4, 5, 1); diff --git a/meshing/CMakeLists.txt b/meshing/CMakeLists.txt index 813681bb9..95be48e88 100644 --- a/meshing/CMakeLists.txt +++ b/meshing/CMakeLists.txt @@ -71,6 +71,7 @@ set(test_srcs test/ScaleMeshTest.cpp test/SmoothNormalsTest.cpp test/OrderedPointSetMesherTest.cpp + test/OrientNormalsTest.cpp ) # Add a test executable for each src diff --git a/meshing/test/ITK2VTKTest.cpp b/meshing/test/ITK2VTKTest.cpp index 85dc542d8..a47b1b07b 100644 --- a/meshing/test/ITK2VTKTest.cpp +++ b/meshing/test/ITK2VTKTest.cpp @@ -15,8 +15,8 @@ using namespace volcart; /* * The following five fixture build test inputs for the ITK2VTK tests * - * Comments are included in the Plane Fixture only...the remainder of the fixture - * copy the same ideas + * Comments are included in the Plane Fixture only...the remainder of the + * fixture copy the same ideas */ class ITK2VTKPlaneFixture : public ::testing::Test diff --git a/meshing/test/OrientNormalsTest.cpp b/meshing/test/OrientNormalsTest.cpp new file mode 100644 index 000000000..de0b41d36 --- /dev/null +++ b/meshing/test/OrientNormalsTest.cpp @@ -0,0 +1,77 @@ +#include + +#include "vc/core/shapes/Cube.hpp" +#include "vc/core/shapes/Plane.hpp" +#include "vc/meshing/OrientNormals.hpp" + +using namespace volcart; +using namespace volcart::shapes; +using namespace volcart::meshing; + +inline void ExpectNormalEq( + const ITKMesh::Pointer& result, const ITKMesh::Pointer& expected) +{ + for (auto it = result->GetPoints()->Begin(); + it != result->GetPoints()->End(); ++it) { + ITKPixel resultN; + ITKPixel expectedN; + result->GetPointData(it.Index(), &resultN); + expected->GetPointData(it.Index(), &expectedN); + + EXPECT_DOUBLE_EQ(resultN[0], expectedN[0]); + EXPECT_DOUBLE_EQ(resultN[1], expectedN[1]); + EXPECT_DOUBLE_EQ(resultN[2], expectedN[2]); + } +} + +inline void ExpectNormalInverse( + const ITKMesh::Pointer& result, const ITKMesh::Pointer& expected) +{ + for (auto it = result->GetPoints()->Begin(); + it != result->GetPoints()->End(); ++it) { + ITKPixel resultN; + ITKPixel expectedN; + result->GetPointData(it.Index(), &resultN); + expected->GetPointData(it.Index(), &expectedN); + + EXPECT_DOUBLE_EQ(resultN[0], -expectedN[0]); + EXPECT_DOUBLE_EQ(resultN[1], -expectedN[1]); + EXPECT_DOUBLE_EQ(resultN[2], -expectedN[2]); + } +} + +TEST(OrientNormals, Centroid) +{ + auto input = Cube().itkMesh(); + + OrientNormals orient; + orient.setReferenceMode(OrientNormals::ReferenceMode::Centroid); + orient.setMesh(input); + auto output = orient.compute(); + + ExpectNormalInverse(output, input); +} + +TEST(OrientNormals, ManualPositive) +{ + auto input = Plane().itkMesh(); + + OrientNormals orient; + orient.setReferencePoint({0, 1, 0}); + orient.setMesh(input); + auto output = orient.compute(); + + ExpectNormalEq(output, input); +} + +TEST(OrientNormals, ManualNegative) +{ + auto input = Plane().itkMesh(); + + OrientNormals orient; + orient.setReferencePoint({0, -1, 0}); + orient.setMesh(input); + auto output = orient.compute(); + + ExpectNormalInverse(output, input); +} \ No newline at end of file From 2e4eda339366fed5f687dce9ff704c3b377499eb Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 21:23:07 -0400 Subject: [PATCH 10/12] Fix bug where we were passing the tests by changing the input mesh --- apps/src/Render.cpp | 16 ++++++++-------- meshing/src/OrientNormals.cpp | 8 ++++---- meshing/test/OrientNormalsTest.cpp | 9 +++++++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/apps/src/Render.cpp b/apps/src/Render.cpp index 0be602a07..afef94b2a 100644 --- a/apps/src/Render.cpp +++ b/apps/src/Render.cpp @@ -480,14 +480,6 @@ auto main(int argc, char* argv[]) -> int smooth->input = *results["mesh"]; results["mesh"] = &smooth->output; } - - // Save the intermediate mesh - if (parsed.count("intermediate-mesh") > 0) { - fs::path meshPath = parsed["intermediate-mesh"].as(); - auto writer = graph->insertNode(); - writer->path = meshPath; - writer->mesh = *results["mesh"]; - } } ///// Reorient the mesh normals ///// @@ -498,6 +490,14 @@ auto main(int argc, char* argv[]) -> int results["mesh"] = &orient->output; } + ///// Save the intermediate mesh ///// + if (parsed.count("intermediate-mesh") > 0) { + fs::path meshPath = parsed["intermediate-mesh"].as(); + auto writer = graph->insertNode(); + writer->path = meshPath; + writer->mesh = *results["mesh"]; + } + ///// Flattening ///// if (needResample and results.count("uvMap") > 0) { Logger()->warn( diff --git a/meshing/src/OrientNormals.cpp b/meshing/src/OrientNormals.cpp index 2da44a1fc..564e81ff6 100644 --- a/meshing/src/OrientNormals.cpp +++ b/meshing/src/OrientNormals.cpp @@ -91,13 +91,13 @@ auto OrientNormals::compute() -> ITKMesh::Pointer // Flip the normals as required if (flip) { - for (auto it = input_->GetPoints()->Begin(); - it != input_->GetPoints()->End(); ++it) { + for (auto it = output_->GetPoints()->Begin(); + it != output_->GetPoints()->End(); ++it) { // Convert point data to cv::Vec3d ITKPixel normal; - input_->GetPointData(it.Index(), &normal); + output_->GetPointData(it.Index(), &normal); normal *= -1; - input_->SetPointData(it.Index(), normal); + output_->SetPointData(it.Index(), normal); } } diff --git a/meshing/test/OrientNormalsTest.cpp b/meshing/test/OrientNormalsTest.cpp index de0b41d36..a6bbe309c 100644 --- a/meshing/test/OrientNormalsTest.cpp +++ b/meshing/test/OrientNormalsTest.cpp @@ -49,7 +49,10 @@ TEST(OrientNormals, Centroid) orient.setMesh(input); auto output = orient.compute(); + // Check the output has changed ExpectNormalInverse(output, input); + // Check that the input hasn't changed + ExpectNormalEq(input, Cube().itkMesh()); } TEST(OrientNormals, ManualPositive) @@ -61,7 +64,10 @@ TEST(OrientNormals, ManualPositive) orient.setMesh(input); auto output = orient.compute(); + // Check the output hasn't changed ExpectNormalEq(output, input); + // Check that the input hasn't changed + ExpectNormalEq(input, Plane().itkMesh()); } TEST(OrientNormals, ManualNegative) @@ -73,5 +79,8 @@ TEST(OrientNormals, ManualNegative) orient.setMesh(input); auto output = orient.compute(); + // Check the output has changed ExpectNormalInverse(output, input); + // Check that the input hasn't changed + ExpectNormalEq(input, Plane().itkMesh()); } \ No newline at end of file From be8fcbdba94109a3bf55fb7f577308e826afbd46 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 21:29:46 -0400 Subject: [PATCH 11/12] Revert other node changes. Will come back in a diff PR --- graph/src/meshing.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/graph/src/meshing.cpp b/graph/src/meshing.cpp index 063b59a6d..f08f5fcec 100644 --- a/graph/src/meshing.cpp +++ b/graph/src/meshing.cpp @@ -33,7 +33,7 @@ MeshingNode::MeshingNode() { registerInputPort("points", points); registerOutputPort("mesh", mesh); - compute = [this]() { mesh_ = mesher_.compute(); }; + compute = [=]() { mesh_ = mesher_.compute(); }; } auto MeshingNode::serialize_(bool useCache, const fs::path& cacheDir) @@ -63,7 +63,7 @@ ScaleMeshNode::ScaleMeshNode() registerInputPort("scaleFactor", scaleFactor); registerOutputPort("output", output); - compute = [this]() { + compute = [=]() { if (input_) { output_ = ScaleMesh(input_, scaleFactor_); } @@ -102,7 +102,7 @@ CalculateNumVertsNode::CalculateNumVertsNode() registerInputPort("density", density); registerOutputPort("numVerts", numVerts); - compute = [this]() { + compute = [=]() { using meshmath::SurfaceArea; static constexpr double UM_TO_MM{0.000001}; static constexpr std::size_t MIN_NUM{100}; @@ -134,7 +134,7 @@ LaplacianSmoothMeshNode::LaplacianSmoothMeshNode() { registerInputPort("input", input); registerOutputPort("output", output); - compute = [this]() { mesh_ = smoother_.compute(); }; + compute = [=]() { mesh_ = smoother_.compute(); }; } auto LaplacianSmoothMeshNode::serialize_( @@ -187,7 +187,7 @@ ResampleMeshNode::ResampleMeshNode() registerInputPort("subsampleThreshold", subsampleThreshold); registerInputPort("quadricsOptimizationLevel", quadricsOptimizationLevel); registerOutputPort("output", output); - compute = [this]() { mesh_ = acvd_.compute(); }; + compute = [=]() { mesh_ = acvd_.compute(); }; } auto ResampleMeshNode::serialize_(bool useCache, const fs::path& cacheDir) @@ -234,7 +234,7 @@ UVMapToMeshNode::UVMapToMeshNode() registerInputPort("scaleToUVDimensions", scaleToUVDimensions); registerOutputPort("outputMesh", outputMesh); - compute = [this]() { + compute = [=]() { mesher_.setScaleToUVDimensions(scaleDims_); output_ = mesher_.compute(); }; @@ -272,7 +272,7 @@ OrientNormalsNode::OrientNormalsNode() registerInputPort("referenceMode", referenceMode); registerInputPort("referencePoint", referencePoint); registerOutputPort("output", output); - compute = [this]() { output_ = orientNormals_.compute(); }; + compute = [&]() { output_ = orientNormals_.compute(); }; } auto OrientNormalsNode::serialize_(bool useCache, const fs::path& cacheDir) From 332fac37285d2e4b446c45bede6fb64e18803b4d Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 2 Nov 2023 21:49:42 -0400 Subject: [PATCH 12/12] Small docs change --- meshing/include/vc/meshing/OrientNormals.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshing/include/vc/meshing/OrientNormals.hpp b/meshing/include/vc/meshing/OrientNormals.hpp index add06200b..e4f6f5d36 100644 --- a/meshing/include/vc/meshing/OrientNormals.hpp +++ b/meshing/include/vc/meshing/OrientNormals.hpp @@ -19,8 +19,8 @@ class OrientNormals public: /** @brief Reference point mode */ enum class ReferenceMode { - Centroid, /** Mesh centroid reference point for convex meshes. */ - Manual /** Point provided by setReferencePoint(). */ + Centroid, ///< Mesh centroid reference point for convex meshes. + Manual ///< Point provided by setReferencePoint(). }; /** @brief Default constructor */