Commit Graph

1003 Commits

Author SHA1 Message Date
Sebastien Loriot be305f320f
[Small Feature] VTK IO support for Linear_cell_complex (#8998)
## Summary

This small feature adds the ability to read and write `.vtk` files
(legacy ASCII)
for 3D Linear_cell_complex (dimension 3, ambient dimension 3). 

It supports per-vertex and per-volume scalar fields and handles various
VTK cell types.

## Motivation

Enable import/export of mesh structures and scalar fields between CGAL
and VTK-based visualization tools
(ParaView, VisIt, etc.). Simplifies debugging and integration into
scientific pipelines.

## API Changes

- New functions in `Linear_cell_complex_vtk_io.h`:
  - `read_lcc_from_vtk()`
  - `write_lcc_to_vtk()`

Header-only implementation, no external dependency.

## Included

- Full implementation in `Linear_cell_complex_vtk_io.h` (merged `.impl`)
- Minimal example with `.3map` and `.vtk` files
- Unit test with scalar field preservation and structure comparison

## Maintainers

Feel free to suggest naming adjustments or style corrections. The
feature is scoped cleanly and does not affect other packages.


* Feature/Small Feature (if any):
[Read_write_vtk_for_LCC](https://cgalwiki.geometryfactory.com/CGAL/Members/wiki/Features/Small_Features/Read_write_vtk_for_LCC)
2025-12-03 11:50:01 +01:00
Andreas Fabri 92a896abb9 Fix anchor 2025-11-25 16:39:10 +00:00
Andreas Fabri 1b3556184a Fix warning in read_las_points.h 2025-11-25 07:35:10 +00:00
Andreas Fabri 884e9fc4ee Document a @param 2025-11-20 14:02:31 +00:00
Andreas Fabri cee9effe09 Document a @param 2025-11-20 13:56:43 +00:00
Andreas Fabri 970f16913b Merge remote-tracking branch 'cgal/main' into Point_set-reduce_dependencies-GF 2025-11-20 10:14:49 +00:00
Sebastien Loriot bf25dd27b8
Stream support: Fix for Epeck (#9072)
## Summary of Changes

For file formats that expect floating point coordinates we convert on
the fly so that `CGAL::io::write_polygon_soup()` also works for polygon
soups with ` FT` which are non-float/double, e.g.
`Exact_predicates_exact_constructions_kernel`.
Additionally, we document the named parameter `point_map` as it was
missing.

## Release Management

* Affected package(s): Stream_support
* Issue(s) solved (if any): fix #9071
* License and copyright ownership: unchanged 
* upon integration update and test #9109
2025-11-20 10:27:33 +01:00
Sébastien Loriot f98d968ed0 Merge remote-tracking branch 'cgal/6.1.x-branch' into 'cgal/main' 2025-11-19 14:46:33 +01:00
Sébastien Loriot 9bd1705bf8 Merge remote-tracking branch 'cgal/6.0.x-branch' into 'cgal/6.1.x-branch' 2025-11-19 14:45:21 +01:00
Andreas Fabri 1dc39039e9 merge cgal/main 2025-11-13 08:48:43 +00:00
Sebastien Loriot 1673cd0f9e
Fix OBJ loader crashing the demo on reading failure (#9128)
## Release Management

* Affected package(s): `Lab`
* Issue(s) solved (if any): a few entries in #6690 
* Feature/Small Feature (if any): n/a
* License and copyright ownership: no change
2025-11-13 09:40:07 +01:00
Sebastien Loriot dfc5fb5065
IO: write_PLY() for Epeck (#7874)
## Summary of Changes

As reported in #7868 the function `CGAL::IO::write_PLY()` used in binary
mode does not correctly write the coordinates if the points are from a
kernel with exact constructions.
~~This PR applies `to_double()" to the coordinates.~~

~~After a discussion with @MaelRL we decided that the user is in charge
to pass a `vertex_point_map` as named parameter that does the
conversion. This is straightforward as we offer the
[`Cartesian_converter_property_map`](https://doc.cgal.org/latest/Property_map/structCGAL_1_1Cartesian__converter__property__map.html).~~

Moving back to the previous proposal: hardcode some to_double and
to_float casts such that we meet the requirements of the file format,
whatever the input.

As the problem is the same for the vertex normals we add a named
parameter `vertex_normal_map`.

### Todo
- [x] Fix the generic function `write_polygon_mesh()`. Currently it is
fixed for `Surface_mesh`

## Release Management

* Affected package(s): Stream_support
* Issue(s) solved (if any): fix #7868 and fix
https://github.com/CGAL/cgal/issues/7327
* License and copyright ownership:  unchanged
* upcoming integration, update #9072 and test it
2025-11-13 09:38:55 +01:00
Mael Rouxel-Labbé 333a15584f Handle (invalid) zero vertex index in face 2025-11-07 22:02:20 +01:00
Mael Rouxel-Labbé 3ef43324bb Fix bad 'if' condition & warning 2025-11-07 17:05:21 +01:00
Guillaume Damiand 6f2c3d819e
Merge branch 'main' into Small_feature/read_write_vtk_for_LCC 2025-11-06 09:38:10 +01:00
Andreas Fabri 25844edf50 examples/tests/demo 2025-10-31 16:47:53 +01:00
Andreas Fabri 6bd5ec4f8b Move guards in low level file 2025-10-31 13:08:07 +01:00
Andreas Fabri eaa25c500b fix CI 2025-10-31 12:39:55 +01:00
Andreas Fabri 64e33bd6cb fix links 2025-10-31 12:25:24 +01:00
Andreas Fabri f28e643ed0 move read_points.h 2025-10-31 10:54:27 +01:00
Andreas Fabri 2d39ab4dd8 cleanup 2025-10-31 09:40:05 +01:00
Andreas Fabri 2fb9a2d832 doc links 2025-10-30 22:44:47 +01:00
Andreas Fabri 7c3b2302b5 doc links 2025-10-30 22:28:15 +01:00
Andreas Fabri 8b4e81ab5c doc links 2025-10-30 22:26:00 +01:00
Andreas Fabri 44306e981a doc 2025-10-30 18:11:15 +01:00
Andreas Fabri 25060734a0 forward declarations must come first 2025-10-30 17:46:45 +01:00
Andreas Fabri e70e2109f4 XYZ 2025-10-30 15:05:58 +01:00
Andreas Fabri fb748f6442 Move LAS 2025-10-30 14:51:26 +01:00
Andreas Fabri 5050b54bfe robustify normal computation for STL 2025-10-30 12:03:22 +01:00
Andreas Fabri 35613b984f Deal with generic version 2025-10-30 11:45:28 +01:00
Andreas Fabri 00f5ae061d Use Simple_cartesian<Exact_rational> 2025-10-30 09:36:53 +01:00
Andreas Fabri f766834601 Use CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT 2025-10-25 11:00:50 +01:00
Andreas Fabri 5e26465b2c fix 2025-10-25 10:28:36 +01:00
Andreas Fabri 67220b911b fix 2025-10-25 10:17:18 +01:00
Andreas Fabri 37b6a7214d R/W for points in OFF format is now in CGAL/IO/OFF.h 2025-10-25 09:58:21 +01:00
Andreas Fabri 592b8824ec Add forwarding include files 2025-10-24 15:49:55 +01:00
Andreas Fabri 6d011a62ae Point_set: move IO code to Stream_support 2025-10-23 08:52:04 +01:00
Andreas Fabri 8623f28bb0 Use internal::construct_normal_of_STL_face() 2025-10-22 10:32:00 +01:00
Andreas Fabri 4c27d08372
Apply suggestions from code review
Co-authored-by: Mael <mael.rouxel.labbe@geometryfactory.com>
2025-10-22 11:17:31 +02:00
Andreas Fabri 0217e30573 Stream_Support: typos 2025-10-22 09:31:56 +01:00
Andreas Fabri 5d82eed3ea
Update Stream_support/include/CGAL/IO/STL.h 2025-10-21 17:26:45 +02:00
Andreas Fabri 3706528a0c
Update Stream_support/include/CGAL/IO/PLY/PLY_writer.h
Co-authored-by: Mael <mael.rouxel.labbe@geometryfactory.com>
2025-10-17 11:20:06 +02:00
Andreas Fabri 62a9c9e04f cleanup 2025-10-15 16:23:59 +01:00
Sébastien Loriot 67349ccbe1 include for boost range 2025-10-15 16:49:15 +02:00
Sébastien Loriot 8215abd980 fix compilation and warnings 2025-10-15 09:57:32 +02:00
Andreas Fabri 358a588eae Deal with binary VTP for non-double kernel 2025-10-14 14:21:39 +01:00
Andreas Fabri c43058de26 Changes after Mael's comments 2025-10-14 09:24:44 +01:00
Guillaume Damiand 2ca338068b doc for read/write_vtk lcc in stream support 2025-10-10 10:22:11 +02:00
Sven Oesau 0ffa81d3c4 fix warnings 2025-10-08 13:36:35 +02:00
Andreas Fabri 865c1d2ed7 Fix error in test case 2025-10-06 13:05:32 +01:00