Commit Graph
866 Commits
Author SHA1 Message Date
Sébastien Loriot 9040d88eb8 Merge pull request #8856 from MaelRL/AW2-GF
New package: 2D Alpha Wrapping
2026-03-20 16:43:00 +01:00
Sébastien Loriot 6f86581dd9 Merge pull request #9096 from soesau/Intersection-Circle_Sphere_consistency-GF
Intersections: Consistent behavior of Circle_2 and Sphere_3
2026-03-18 19:29:07 +01:00
Sébastien Loriot 8ae8f780bc Merge pull request #6557 from sloriot/CH3-do_intersect
Add do_intersect for convex hulls
2026-03-17 15:22:43 +01:00
Sébastien Loriot c04efc3a51 fix has_on_unbounded_side for circle vs segment
+ remove newly added Has_on_bounded_side overloads
2026-03-06 20:08:25 +01:00
Sébastien Loriot 9486495f59 Merge remote-tracking branch 'cgal/main' into 'MaelRL/AW2-GF' 2026-03-05 18:29:53 +01:00
Laurent Rineau 03ac87abaf Merge 'cgal/main' to fix conflicts
Conflicts:
	Mesh_3/include/CGAL/Labeled_mesh_domain_3.h
	Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h
2026-02-25 14:48:01 +01:00
Laurent Rineau 1c4a6de517 Refactor Mesh_domain_with_polyline_features_3
- Updated `Mesh_domain_with_polyline_features_3` to support API versioning, allowing for different output types based on the version.
- Adjusted the implementation of `construct_point_on_curve` and related methods in `Protect_edges_sizing_field`.
  All those methods are now in a dedicated class helper `Protect_edges_sizing_field_versioned_API`.
- Renamed `Point_and_location` to `Point_and_position` in Polyline.h for clarity.
- Wrapped assertions in `#if CGAL_MESH_3_PROTECTION_DEBUG` to enable debug checks conditionally.

That is still a WIP: I would like to move the caching map `vertex_to_polyline_iterator_`  from the domain class to
the class `Protect_edges_sizing_field`. That would avoid those member functions in the domain:
  - `Domain::set_polyline_iterator`
  - `Domain::remove_polyline_iterator`
  - `Domain::clear_point_to_polyline_iterator_cache`
2026-02-25 12:09:55 +01:00
Sebastien Loriot f60daf05e4 Mesh_2: fix degenerate cases (#9290)
## Summary of Changes

This PR fixes the error reported in issue #781. The main two changes
are:

- in `Refine_edges.h`: allow the refinement point of a constrained edge
to be an existing close encroaching vertex,
- in `Refine_faces.h`: skip tiny bad faces when their bbox are smaller
than a few ulp.

## Release Management

* Affected package(s): Triangulation_2, Mesh_2
* Issue(s) solved (if any): fix #781
* Feature/Small Feature (if any):
* Link to compiled documentation (obligatory for small feature) [*wrong
link name to be changed*](httpssss://wrong_URL_to_be_changed/Manual/Pkg)
* License and copyright ownership: maintenance by GeometryFactory, now
copyright change
2026-02-12 15:01:59 +01:00
Laurent Rineau 93fa24e252 Mesh_2: fix bug with Mesh_2/test/Mesh_2/triwild-10070-min1.obj
The bug was reproduced by

```shell
/path/to/build/test/Mesh_2/test_mesh_obj Mesh_2/test/Mesh_2/triwild-10070-min1.obj
```

The log of the error, with all the debug options of Mesh_2 was:

```plain
Before conforming Gabriel: 4 vertices.
  Smallest squared distance between constraint endpoints: 0.010522898628224919
  edge #1= 453.57378188125 445.0501073328125 -- #3= 454.05836694375 445.48749872343745 is encroached by #2= 453.77453855000005 445.23131233749996
  add_constrained_edge_to_be_conformed(#1= 453.57378188125 445.0501073328125, #3= 454.05836694375 445.48749872343745)
  edge #2= 453.77453855000005 445.23131233749996 -- #0= 453.49763280000002 444.98137439999999 is encroached by #1= 453.57378188125 445.0501073328125
  add_constrained_edge_to_be_conformed(#2= 453.77453855000005 445.23131233749996, #0= 453.49763280000002 444.98137439999999)
split_cluster_point(454.05836694375 445.48749872343745 , 453.57378188125 445.0501073328125)
  reduced: 0
result:  453.77453855000005 445.23131233750001
  edge #1= 453.57378188125 445.0501073328125 -- #3= 454.05836694375 445.48749872343745 is encroached by #2= 453.77453855000005 445.23131233749996
Refine_edges_with_clusters::refinement_point_impl(Edge: (#1= 453.57378188125 445.0501073328125, #3= 454.05836694375 445.48749872343745) = 453.77453855000005 445.23131233750001
(453.77453855000005 445.23131233750001) accepted
on edge, insert(453.77453855000005 445.23131233750001): 3 boundary edges in the zone
 inserted new vertex #4= 453.77453855000005 445.23131233750001
update_clusters
va_has_a_cluster=0
vb_has_a_cluster=1
clusters.size()=2
E  edge #3= 454.05836694375 445.48749872343745 -- #2= 453.77453855000005 445.23131233749996 is encroached by #4= 453.77453855000005 445.23131233750001
  add_constrained_edge_to_be_conformed(#3= 454.05836694375 445.48749872343745, #2= 453.77453855000005 445.23131233749996)
  edge #1= 453.57378188125 445.0501073328125 -- #4= 453.77453855000005 445.23131233750001 is encroached by #2= 453.77453855000005 445.23131233749996
  add_constrained_edge_to_be_conformed(#1= 453.57378188125 445.0501073328125, #4= 453.77453855000005 445.23131233750001)
Cluster at #3= 454.05836694375 445.48749872343745 is updated.
  vm: #4= 453.77453855000005 445.23131233750001
  reduction: 1
  min_sq_len: 0.1461900214383674
clusters.size() after update_cluster=2
split_cluster_point(453.49763280000002 444.98137439999999 , 453.77453855000005 445.23131233749996)
  reduced: 0
result:  453.64993096249998 445.11884026562501
  edge #2= 453.77453855000005 445.23131233749996 -- #0= 453.49763280000002 444.98137439999999 is encroached by #1= 453.57378188125 445.0501073328125
Refine_edges_with_clusters::refinement_point_impl(Edge: (#2= 453.77453855000005 445.23131233749996, #0= 453.49763280000002 444.98137439999999) = 453.64993096249998 445.11884026562501
(453.64993096249998 445.11884026562501) accepted
on edge, insert(453.64993096249998 445.11884026562501): 0 boundary edges in the zone
terminate called after throwing an instance of 'CGAL::Precondition_exception'
  what():  CGAL ERROR: precondition violation!
Expr: i >= 0 && i < 3
```

The following edge `(#1, #3)` is encroached by the vertex `#2`:

```plain
  edge #1= 453.57378188125 445.0501073328125 -- #3= 454.05836694375 445.48749872343745 is encroached by #2= 453.77453855000005 445.23131233749996
```

The inserted vertex `#4= 453.77453855000005 445.23131233750001` is the projection of the vertex `#2= 453.77453855000005 445.23131233749996` (rules to refine a segment part of a cluster.

The distance between `#2` and its projection `#4` is:

- `0` on the x-axis,
- `ulp(v2.y()))` on the y-axis.

... and then, Mesh_2 cannot do anything with that.

The fix is to implement a snapping strategy: if the encroaching vertex is close enough, then chose it be the refinement point of the encroached segment. "Close enough" means:

- create tiny `Bbox_2` centered on the encroaching vertex, with snaps equal to 8 ulp on both axis,
- if that tiny bbox intersects the encroached segment, then the refinement is the encroaching vertex.
2026-02-06 16:59:37 +01:00
Valque Léo 4bc7f698c5 Add test for compare_scalar_product and fix the testsuite 2026-02-06 09:41:03 +01:00
Sven Oesau a4fc33a819 fix Has_on_unbounded_side_2/3 for Circle_2 and Sphere_3 2026-02-04 16:16:29 +01:00
Sebastien Loriot c5ce7e753a Adding 3D barycentric coordinates for convex polyhedra (#8267)
## Summary of Changes

New package for 3D barycentric coordinates in a convex polyhedron

## Release Management

* Affected package(s): New package
* Feature/Small Feature (if any):
[here](https://cgal.geometryfactory.com/CGAL/Members/wiki/Features/Barycentric_coordinates_3)
* Link to compiled documentation (obligatory for small feature) [*wrong
link name to be changed*](httpssss://wrong_URL_to_be_changed/Manual/Pkg)
* License and copyright ownership: GF

## TODO
- [x] check branch size (@sloriot)
- [x] check usage of `get_tolerance()` from
`Barycentric_coordinates_3/include/CGAL/Barycentric_coordinates_3/internal/utils_3.h`
2026-02-03 15:13:25 +01:00
Valque Léo 504e4227db Complete reorganisation of the PR and modification of the API 2026-01-30 18:27:58 +01:00
Sven Oesau d209d4b8f7 wrong point type 2026-01-29 14:53:45 +01:00
Sven Oesau e822fb0b2c added Has_on_unbounded_side_2/3 operators for Circle_2/Segment_2, Circle_2/Iso_rectangle_2 and Sphere_3/Iso_cuboid_3 2026-01-29 14:46:53 +01:00
Sven Oesau 2bbbe600c8 removed Boolean type (replaced by auto)
fixed concepts (review)
changed Has_on_bounded_side_2/3 to require Segment_2, Iso_rectangle_2 and Iso_cuboid_3 to be fully inside the Circle_2/Sphere_3
2026-01-28 10:45:27 +01:00
Sven Oesau a9cd49c95c added Has_on_bounded_side_2::operator() for Circle_2 and Iso_rectangle_2 including static filter
added intersected_nodes for disk/ball to Orhtree
2026-01-22 13:03:23 +01:00
Sven Oesau ee211c3630 Merge branch 'main' into Intersection-Circle_Sphere_consistency-GF 2026-01-22 10:23:16 +01:00
Sven Oesau 74867a472f moved on_bounded_side check into Has_on_bounded_side_2/3
added static filter for Sphere_3 and Iso_cuboid_3
2026-01-21 16:01:56 +01:00
Laurent Rineau a48e7ee74d Mesh_2: ignore microscopic bad faces 2026-01-20 21:08:12 +01:00
Sven Oesau 6003f957d4 ci fix 2026-01-20 17:03:37 +01:00
Sven Oesau 3bd1fb9573 ci fix 2026-01-20 16:48:43 +01:00
Sven Oesau 2aaebf01c2 added Sphere_3::has_on_bounded_side(Iso_cuboid_3) 2026-01-20 16:32:25 +01:00
Sven Oesau 3f2b8caecb added Circle_2::has_on_bounded_side(Segment_2) 2026-01-20 13:11:27 +01:00
Sven Oesau ba42c7c37a adding Equal_2 to Projection_traits_base_3 2026-01-09 16:40:08 +01:00
Mael 94899cd165 Merge branch 'main' into AW2-GF 2026-01-06 14:59:59 +01:00
Mael Rouxel-Labbé 40d9f17aab Merge remote-tracking branch 'mine/Polygon_repair-Fix_is_valid-GF' into AW2-GF 2025-12-23 12:39:07 +01:00
Sven Oesau 3e01c496dd Merge branch 'main' into SD_RG_face_normal_map 2025-12-07 11:30:52 +01:00
Sven Oesau b4fa97c745 integrating review 2025-11-12 16:03:46 +01:00
Laurent RineauandCopilot 2a5351cc0a Update Kernel_23/include/CGAL/Kernel/hash_functions.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-31 15:40:42 +01:00
Laurent Rineau 07e0ea785d CDT_3: fix for Epeck 2025-10-29 14:12:50 +01:00
Sven Oesau 0a604075d3 moved typedefs into method 2025-10-17 18:04:39 +02:00
Mael Rouxel-Labbé bc304f4951 Add trivial Point_2 / Point_2 projection overload 2025-04-20 15:03:49 +02:00
Mael Rouxel-Labbé 52842e68d1 Add 2D Robust_weighted_circumcenter filtered traits 2025-04-20 15:01:46 +02:00
Mael Rouxel-Labbé 7b2c8b40e1 Add Kernel_23::Compare_squared_radius_2 2025-04-20 15:00:24 +02:00
Sven Oesau 7e2b312994 merge fix 2025-04-09 10:51:24 +02:00
Sven Oesau 4d39793b1d Merge branch 'master' into SD_RG_face_normal_map 2025-04-09 10:10:29 +02:00
Sébastien Loriot 09564a6d7b do not use result_type 2025-04-03 16:13:27 +02:00
Sébastien Loriot a4170b1fb9 Merge pull request #8586 from MaelRL/Kernel_23-Fix_dangling_ref_in_CC3-GF
Do not rely on result_type definitions in kernels
2025-04-03 16:12:09 +02:00
Sébastien Loriot b6719fc3be Merge remote-tracking branch 'cgal/6.0.x-branch' into cgal/master 2025-04-03 16:09:51 +02:00
Mael Rouxel-Labbé b4422374a0 Fix Compare_xy_2 for the generic 3D projection traits
The previous implementation defined Compare_xy_2 as
simply Compare_xyz_3. This does define an order
over the projected points, but it has a strong downside:
it ignores the direction of the normal, so its order
can be the opposite of the lexicographical order
would give. This new order is in conflict with
the existing Compare_x_2 and Compare_y_2, which
take the normal's direction into account.

(Also with the Less_x_2, Less_y_2, and Less_xy_2
family, which also exist for the projection traits).
2025-03-28 12:51:07 +01:00
Sven Oesau b176ed48ae Merge branch 'master' into SD_RG_face_normal_map 2025-03-27 12:49:44 +01:00
Mael Rouxel-Labbé 0c35489bbe Merge remote-tracking branch 'cgal/master' into Kernel_23-Fix_dangling_ref_in_CC3-GF 2025-03-27 12:28:35 +01:00
Mael Rouxel-Labbé 7bc1bbd842 Add a comment 2025-03-18 12:05:06 +01:00
Mael Rouxel-Labbé 1ae7960a43 Simplify and enhance Type_mapper
There is also a stronger need because now we really need to map
types whereas before it could rely on result_type's to avoid
some tricky cases like CGAL::Sphere_point
2025-03-16 21:45:23 +01:00
Mael Rouxel-Labbé a98d5149de Remove useless header includes 2025-03-16 13:33:44 +01:00
Mael Rouxel-Labbé f9001833b1 Merge remote-tracking branch 'cgal/master' into Kernel_23-Fix_dangling_ref_in_CC3-GF 2025-03-15 14:09:28 +01:00
Léo Valque 91f29df106 Cleaning of the files, remove useless comments, correct indent and tab 2025-02-28 13:58:12 +01:00
Léo Valque 0436efa118 macro for global_function_distance 2025-02-19 19:26:09 +01:00
Léo Valque d7c9cce0b9 Compare squared distance with point 2025-02-19 12:03:06 +01:00