Replies: 30 comments 20 replies
-
Could you please provide code & input data? |
Beta Was this translation helpful? Give feedback.
-
Yes. Please wait, I deleted the OFF file and I have to redo it. In the meantime I applied the Loop subdivision to my half cube and here are the UV coordinates: That looks better. But there's still a lot o (0,0). |
Beta Was this translation helpful? Give feedback.
-
Here is the half cube: And the code : #ifndef _HEADER_
#include "cgalMesh.h"
#endif
#include <CGAL/Surface_mesh_parameterization/parameterize.h>
#include <CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h>
namespace SMP = CGAL::Surface_mesh_parameterization;
typedef K::Point_2 Point2;
// [[Rcpp::export]]
Rcpp::NumericMatrix testparam() {
const std::string filename = "halfcube.off";
Mesh3 sm;
if(!CGAL::IO::read_polygon_mesh(filename, sm))
{
std::cerr << "Invalid input file." << std::endl;
return EXIT_FAILURE;
}
// A halfedge on the border
halfedge_descriptor bhd = CGAL::Polygon_mesh_processing::longest_border(sm).first;
// The 2D points of the uv parametrisation will be written into this map
typedef Mesh3::Property_map<vertex_descriptor, Point2> UV_pmap;
UV_pmap uv_map = sm.add_property_map<vertex_descriptor, Point2>("v:uv").first;
typedef SMP::Discrete_conformal_map_parameterizer_3<Mesh3> Parameterizer;
SMP::Error_code err = SMP::parameterize(sm, Parameterizer(), bhd, uv_map);
if(err != SMP::OK) {
std::cerr << "Error: " << SMP::get_error_message(err) << std::endl;
return EXIT_FAILURE;
}
const size_t nvertices = sm.number_of_vertices();
Rcpp::NumericMatrix out(nvertices, 2);
int i = 0;
for(Mesh3::Vertex_index v : sm.vertices()) {
Point2 pt = uv_map[v];
out(i, 0) = pt.x();
out(i, 1) = pt.y();
i++;
}
return out;
} |
Beta Was this translation helpful? Give feedback.
-
What's this joke? There's a lot of duplicated vertices. |
Beta Was this translation helpful? Give feedback.
-
And here is the half torus, without duplicated vertices, clean. Error: no one-to-one mapping. |
Beta Was this translation helpful? Give feedback.
-
This works with this human face |
Beta Was this translation helpful? Give feedback.
-
Here is another half-torus, splitted in another direction. And it works. > mesh$isValid()
[1] TRUE
> mesh$isValidFaceGraph()
Halfedge Graph Structure is valid.
Face Graph Structure is valid.
[1] TRUE
> mesh$isValidHalfedgeGraph()
Halfedge Graph Structure is valid.
[1] TRUE
> mesh$isValidPolygonMesh()
Halfedge Graph Structure is valid.
Face Graph Structure is valid.
Polygon Mesh Structure is valid.
[1] TRUE |
Beta Was this translation helpful? Give feedback.
-
Now, what am I supposed to do? I assigned a black color to each vertex with |
Beta Was this translation helpful? Give feedback.
-
Now I tried with an hemisphere. Only one border, guaranteed. But here is what I get: |
Beta Was this translation helpful? Give feedback.
-
OH MY GOD I KNOW: THE ORDER OF THE VERTICES IS PERTURBED WHEN I WRITE THE OFF FILE !!!!! |
Beta Was this translation helpful? Give feedback.
-
Here are my first 6 mesh faces: > head(mesh$getFaces())
[,1] [,2] [,3]
[1,] 31 2 1
[2,] 32 3 2
[3,] 33 4 3
[4,] 34 5 4
[5,] 35 6 5
[6,] 36 7 6 Then I observed that the first 6 vertices in the OFF file are vertices 31, 32, 33, 34, 35, 36. |
Beta Was this translation helpful? Give feedback.
-
I think I know: that's because I do a |
Beta Was this translation helpful? Give feedback.
-
And by the way, since the upgrade to 5.5.2, I cannot read anymore a PLY/OFF file, this crashes the session. This perfectly worked with 5.4.2. |
Beta Was this translation helpful? Give feedback.
-
Here is the disk of uv-coordinates for the Enneper surface: As you can see, I colored it with a checkerboard, by grouping the points in squares Is there a way to make the lines regular? Of course the quality increases if I add some vertices, but is there another way? |
Beta Was this translation helpful? Give feedback.
-
Wow, I did an isotropic remeshing (but not with CGAL yet) before the parameterization, top! |
Beta Was this translation helpful? Give feedback.
-
Now I did it with CGAL. But why do we see "radial" lines (especially in the blue)? |
Beta Was this translation helpful? Give feedback.
-
Look at this twisted horn. The UV-circle is fully textured with a checkerboard. But the blue squares appear only at the bottom of the horn. Any idea why? |
Beta Was this translation helpful? Give feedback.
-
I have some plans for today: some animated textures. A rotating radial checkerboard, and a checkerboard transformed by a Möbius transformation. Prepare your eyes. I still tried ARAP, it has always crashed. Wondering whether it is bugged. |
Beta Was this translation helpful? Give feedback.
-
First, here is a small experiment. There is a conformal map between the square and the disk. So I did a checkerboard on the square and I transported it to the disk with this map. The result is the right figure: Then I mapped these two circular checkerboards to the Enneper surface, with the conformal parameterization: Do you see any striking difference? Not very conclusive... Time to go to the next experiment. |
Beta Was this translation helpful? Give feedback.
-
Here is the first promised animation. |
Beta Was this translation helpful? Give feedback.
-
The second promised animation. I take a Möbius transformation of order 2 (i.e. Then I use |
Beta Was this translation helpful? Give feedback.
-
Costa surface. It has several borders but the DCP works. |
Beta Was this translation helpful? Give feedback.
-
I mapped an image! Terrific!! |
Beta Was this translation helpful? Give feedback.
-
Togliatti surface |
Beta Was this translation helpful? Give feedback.
-
Hmm, something strange. Usually when I do a parameterization with a circular border, the UV space I get is a disk centered at (0.5, 0.5) and having radius 0.5. But now, I've just done an ARAP parameterization, and I get a different disk: Is it normal? |
Beta Was this translation helpful? Give feedback.
-
The Sudanese Möbius band. Unfortunately, this mesh has a "cut", and it breaks the harmony. In fact this cut separates the back side from the front side. |
Beta Was this translation helpful? Give feedback.
-
I started to write a vignette for my package, about the parameterizations. A vignette of a R package is a short documentation. There is some documentation inside the package but the vignette allows to write more details and is more convenient. If you want to take a look, and if you have some feedback it would be welcome. This is a HTML document converted to PDF, this is why there are some breaks. |
Beta Was this translation helpful? Give feedback.
-
I've just tried the orbifold borderless parameterization. I used this mesh, with the three cones shown in red: Then I got this uv-space: How can I use such a parameterization? The points do not fill a nice shape. Maybe I did something bad? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I tried the
Discrete_conformal_map_parameterizer_3
. I firstly tried with the mesh of a half torus, and I got "Error: no one-to-one mapping". So I tried with the mesh of a half cube. Then I got a matrix of UV coordinates full of (0, 0) except 4 points:What can I do with that?
That's not the first time I tried the surface parameterizations, and I always got strange results. I thought the UV coordinates could help to map for example a checkeboard texture on the mesh, but I don't see how to do that.
Beta Was this translation helpful? Give feedback.
All reactions