Class Confmap

All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class Confmap extends AlgorithmBase
MIT License Copyright (c) 2022 Ruslan Guseinov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Implementation of conformal mapping methods CETM and BFF. Based on papers [Conformal Equivalence of Triangle Meshes](https://dl.acm.org/doi/10.1145/1360612.1360676), B. Springborn, P. Schröder, U. Pinkall, *ACM Transactions on Graphics* (2008) and [Boundary First Flattening](https://dl.acm.org/doi/10.1145/3132705), R. Sawhney, K. Crane, *ACM Transactions on Graphics* (2018). ## Usage example Read an OBJ file from data folder, generate a minimum distortion conformal map using BFF method, and output the original mesh with the UV conformal map as a new OBJ file. vertices, faces = read_obj('../data/bumpcap.obj') cm = BFF(vertices, faces) image = cm.layout() write_obj('bumpcap_with_uv.obj', cm.vertices, cm.faces, image.vertices, image.faces)
  • Field Details

    • _clausen1

      double[] _clausen1
    • _clausen2

      double[] _clausen2
    • _MX

      double[][] _MX
  • Constructor Details

    • Confmap

      public Confmap()
      Confmap - default constructor.
  • Method Details

    • finalize

      public void finalize()
      finalize -
      Overrides:
      finalize in class AlgorithmBase
    • runAlgorithm

      public void runAlgorithm()
      Starts the program.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • test_quantize_value

      public void test_quantize_value()
    • test_clausen

      public void test_clausen()
    • test_tri_angles

      public void test_tri_angles()
    • test_read_write_obj

      public void test_read_write_obj()
    • test_boundary_loops

      public void test_boundary_loops()
    • test_face_face_adjacency

      public void test_face_face_adjacency()
    • quantize_value

      double[] quantize_value(double[] value, double quant)
    • quantize_value

      double quantize_value(double value, double quant)
    • isclose

      boolean isclose(double a, double b, double rtol, double atol, boolean equal_nan)
    • chebyshev

      double[] chebyshev(double[] x, double[] coeff)
    • remainder

      double[] remainder(double[] x, double val)
    • remainder

      double remainder(double x, double val)
    • clausen

      double[] clausen(double[] x)
    • lobachevsky

      double[] lobachevsky(double[] x)
    • tri_angles

      public double[][] tri_angles(double[][] lengths, boolean ineq_violation)
    • compute_exterior_angles_2d

      double[] compute_exterior_angles_2d(double[][] points, boolean ccw)
    • mobius_normalize_layout

      double[][] mobius_normalize_layout(double[][] uvoriginal, double eps, int max_iter)
    • inverse3by3

      double[][] inverse3by3(double[][] A)
    • median

      double median(double[] nums)
    • quasi_conformal_error_map

      public double[] quasi_conformal_error_map(double[][][] source_points, double[][][] image_points)
    • conformal_equivalence

      void conformal_equivalence(double[] u, double[] u_err, double[][] points, int[][] faces, double[][][] image_points)
    • read_obj

      public void read_obj(Vector<double[]> vertices, Vector<int[]> faces, String file_path)
    • write_obj

      public void write_obj(Vector<double[]> vertices, Vector<int[]> faces, String file_path)
    • write_obj

      public void write_obj(String file_path, double[][] vertices, int[][] faces, double[][] uvs, int[][] uv_faces)
    • compute_mesh_edges

      public int[][] compute_mesh_edges(int[][] face_edges, Vector<int[]> boundary_loops, int[][] faces, boolean only_manifold)
    • face_face_adjacency

      public void face_face_adjacency(int[][] face_face, int[][] face_face_ind, int[][] faces)
    • get_vertex_faces

      public int[] get_vertex_faces(int[][] ff, int[][] ffi, int[] vf, int[] vfi, int vertex_id)
    • cut_faces

      public int[][] cut_faces(int[][] original_faces, Vector<Integer> start_vertices, HashMap<Integer,HashSet<Integer>> cut_tree)
    • simple_demo

      public void simple_demo()
    • main_demo

      public void main_demo()
    • demo_tools

      public void demo_tools(String file_name, String method, String output)
    • make_BFF_confmap

      public Confmap.BFF make_BFF_confmap(String file_name, String mode)
    • make_CETM_confmap

      public Confmap.CETM make_CETM_confmap(String file_name, String mode)