Commit 58683fe0 authored by YIxin-Hu's avatar YIxin-Hu
Browse files

add scalar field in output mesh

parent 9be2b6a1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -10,8 +10,10 @@ namespace floatTetWild
	public:
		static bool load_mesh(const std::string &path, std::vector<Vector3> &points, std::vector<Vector3i> &faces, GEO::Mesh& input, std::vector<int> &flags);

		static void write_mesh(const std::string &path, const Mesh &mesh, const bool only_interior = true, const std::vector<Scalar> &color = std::vector<Scalar>(), const bool binary = true);
		static void write_mesh(const std::string &path, const Mesh &mesh, const std::vector<int> &t_ids, const bool only_interior = true, const bool binary = true);
		static void write_mesh(const std::string &path, const Mesh &mesh,
		        const bool do_filter = true, const std::vector<Scalar> &color = std::vector<Scalar>(), const bool binary = true);
		static void write_mesh(const std::string &path, const Mesh &mesh, const std::vector<int> &t_ids,
		        const bool do_filter = true, const bool binary = true);
		static void write_surface_mesh(const std::string &path, const Mesh &mesh, const bool only_interior=true);

		static void extract_volume_mesh(const Mesh &mesh, MatrixXs &V, Eigen::MatrixXi &T, bool only_interior = true);
+9 −1
Original line number Diff line number Diff line
@@ -393,7 +393,15 @@ int main(int argc, char **argv) {
//    else
//        MeshIO::write_mesh(params.output_path + "_" + params.postfix + ".msh", mesh, false);

    MeshIO::write_mesh(output_mesh_name, mesh, false);
    //fortest
    std::vector<Scalar> colors(mesh.tets.size(), -1);
    for (int i = 0; i < mesh.tets.size(); i++) {
        if (mesh.tets[i].is_removed)
            continue;
        colors[i] = mesh.tets[i].quality;
    }
    //fortest
    MeshIO::write_mesh(output_mesh_name, mesh, false, colors);
    MeshIO::write_surface_mesh(params.output_path + "_" + params.postfix + "_sf.obj", mesh, false);

    std::ofstream fout(params.log_path + "_" + params.postfix + ".csv");