cgal icon indicating copy to clipboard operation
cgal copied to clipboard

Get the last picked item

Open sloriot opened this issue 4 months ago • 5 comments

You can now do:

  Random_points_in_triangle_mesh_3<TriangleMesh> g(mesh, r);
  Point c = *g;
  face_descriptor fc = g.last_item_picked();

to get the normal of the picked point

cc @huang46u

sloriot avatar Sep 12 '25 08:09 sloriot

"picked_item" sounds strange. Could the value type be a struct with a conversion operator to point/face_descriptor/pair<point/face_descriptor> ?

afabri avatar Sep 15 '25 10:09 afabri

Do we want the equivalent functionality for tetrahedral mesh boundaries ? On this page the word Mesh_complex_3_in_triangulation_3 should be replaced with MeshComplexWithFeatures_3

afabri avatar Sep 15 '25 10:09 afabri

"picked_item" sounds strange. Could the value type be a struct with a conversion operator to point/face_descriptor/pair<point/face_descriptor> ?

what's the problem with the value type?

The function is available only for generators that first need to select an item within a range and then sample the point in the picked item. I'm OK with whatever better name you could come up with.

sloriot avatar Sep 16 '25 07:09 sloriot

Do we want the equivalent functionality for tetrahedral mesh boundaries ? On this page the word Mesh_complex_3_in_triangulation_3 should be replaced with MeshComplexWithFeatures_3

It is already here. See https://github.com/CGAL/cgal/pull/9066/files#diff-0d2d36f802470003ce212fc13d25eddff587acac6c3864488f104e31aaec8f75R692

sloriot avatar Sep 16 '25 07:09 sloriot

what @afabri meant is to make operator* return a struct that will have an operator to convert to Point type.

sloriot avatar Sep 17 '25 07:09 sloriot