-
Notifications
You must be signed in to change notification settings - Fork 1.6k
local feature size for point set processing #8006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bizerfr
wants to merge
39
commits into
CGAL:main
Choose a base branch
from
bizerfr:psp-lfs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
ecd26eb
lfs-v1
bizerfr c5ce18e
remove comments
bizerfr ed49e41
cmakelists for lfs_example
bizerfr 772f36f
code style
bizerfr 7240a15
code style-2
bizerfr bf2c0ed
fixes so that it compiles
afabri aa9f1cb
Pass property map as parameter
afabri c885e08
lfs_map v2
bizerfr 7d4d040
reference
bizerfr 9b1788d
doxygen & point_set example
bizerfr 2baa49b
change reference back to copy
bizerfr f79f71a
put lfs_map in the back
bizerfr e722097
CGAL::data_file_path(points_3/kitten.xyz
bizerfr d9d84af
Update Point_set_processing_3/examples/Point_set_processing_3/lfs-exa…
bizerfr 3607da4
Update Point_set_processing_3/examples/Point_set_processing_3/lfs-exa…
bizerfr b28da76
doxygen
bizerfr c2afd8c
cmakelists for examples
bizerfr 962d3b1
cmakelists & doxygen
bizerfr 5afb5af
trivial fixes
afabri 4da4046
point_push_map instead of point_map, otherwise, read points will not …
bizerfr d20626d
Use CGAL::IO::read_point_set()
afabri 2a18b4e
check normals are normalized or not
bizerfr 6b3af0d
fix lfs_example_tuple
bizerfr d76a894
remove trailing whitespace
bizerfr e4b0152
remove trailing whitespace
bizerfr 73fffec
remove trailing whitespace
bizerfr 8733f9b
remove trailing whitespace
bizerfr 78499bb
read_point_set() adds the property
afabri 0358747
doc fixes
afabri 8e44202
Update Point_set_processing_3/doc/Point_set_processing_3/Point_set_pr…
bizerfr 3cb7ed6
Update Point_set_processing_3/include/CGAL/estimate_lfs.h
bizerfr 9c7cb50
rename header file
bizerfr 9a8f017
fix doc
bizerfr 793b3a3
smooth
bizerfr d935d2b
doxygen
bizerfr 7207ebc
test
bizerfr 71ceedc
remove trailing whitespaces
bizerfr 03b3d6c
remove trailing whilespace
bizerfr a81bfbf
remove trailing whilespace
bizerfr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
Point_set_processing_3/examples/Point_set_processing_3/lfs_example_pointset.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> | ||
| #include <CGAL/estimate_lfs.h> | ||
| #include <CGAL/IO/read_points.h> | ||
| #include <CGAL/Point_set_3.h> | ||
| #include <CGAL/Point_set_3/IO.h> | ||
|
|
||
| #include <vector> | ||
|
|
||
|
|
||
|
|
||
| // types | ||
| typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; | ||
| typedef Kernel::FT FT; | ||
| typedef Kernel::Point_3 Point; | ||
| typedef Kernel::Vector_3 Vector; | ||
|
|
||
| typedef CGAL::Point_set_3<Point, Vector> Point_set; | ||
| typedef Point_set::Property_map<Point> Point_map; | ||
| typedef Point_set::Property_map<FT> FT_map; | ||
|
|
||
| // types for K nearest neighbors search structure | ||
| typedef CGAL::Point_set_processing_3::internal::Neighbor_query<Kernel, Point_set&, Point_map> Neighbor_query; | ||
|
|
||
| // Concurrency | ||
| typedef CGAL::Parallel_if_available_tag Concurrency_tag; | ||
|
|
||
| int main(void) | ||
| { | ||
| // read xyz | ||
| const std::string filename = CGAL::data_file_path("points_3/kitten.xyz"); | ||
|
|
||
| Point_set point_set; | ||
| point_set.add_normal_map(); | ||
|
|
||
| FT_map lfs_map; | ||
| boost::tie (lfs_map, boost::tuples::ignore) = point_set.add_property_map<FT> ("LFS", 0.); | ||
|
|
||
| if (!CGAL::IO::read_point_set(filename, point_set)) | ||
| { | ||
| std::cerr << "Error: cannot read file " << filename<< std::endl; | ||
| return EXIT_FAILURE; | ||
| } | ||
|
|
||
|
|
||
| unsigned int jet_k = 24; | ||
| std::size_t N_rays = 60; | ||
| FT apex_angle = 30; | ||
| CGAL::estimate_local_feature_size<Concurrency_tag>(point_set, jet_k, N_rays, apex_angle, lfs_map, | ||
| CGAL::parameters::point_map(point_set.point_map()) | ||
| .normal_map(point_set.normal_map())); | ||
| for (Point_set::iterator it = point_set.begin(); it != point_set.end(); ++ it) | ||
| { | ||
| // Point p = point_set.point(*it); | ||
| // Vector n = point_set.normal(*it); | ||
| FT lfs = lfs_map[*it]; | ||
| std::cerr << lfs << std::endl; | ||
| } | ||
|
|
||
| return EXIT_SUCCESS; | ||
| } |
52 changes: 52 additions & 0 deletions
52
Point_set_processing_3/examples/Point_set_processing_3/lfs_example_tuple.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> | ||
| #include <CGAL/estimate_lfs.h> | ||
| #include <CGAL/IO/read_points.h> | ||
|
|
||
| #include <vector> | ||
| #include <utility> | ||
| #include <tuple> | ||
|
|
||
| // types | ||
| typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; | ||
| typedef Kernel::FT FT; | ||
| typedef Kernel::Point_3 Point; | ||
| typedef Kernel::Vector_3 Vector; | ||
|
|
||
| typedef std::tuple<Point, Vector, FT> Point_with_normal_and_lfs; | ||
|
|
||
| // Concurrency | ||
| typedef CGAL::Parallel_if_available_tag Concurrency_tag; | ||
|
|
||
| int main(void) | ||
| { | ||
| // read xyz | ||
| const std::string filename = CGAL::data_file_path("points_3/kitten.xyz"); | ||
|
|
||
| std::vector<Point_with_normal_and_lfs> points; | ||
| if(!CGAL::IO::read_points(filename, | ||
| std::back_inserter(points), | ||
| CGAL::parameters::point_map(CGAL::Nth_of_tuple_property_map<0, Point_with_normal_and_lfs>()) | ||
| .normal_map(CGAL::Nth_of_tuple_property_map<1, Point_with_normal_and_lfs>()))) | ||
| { | ||
| std::cerr << "Error: cannot read file " << filename<< std::endl; | ||
| return EXIT_FAILURE; | ||
| } | ||
|
|
||
| unsigned int jet_k = 24; | ||
| std::size_t N_rays = 60; | ||
| FT apex_angle = 30; | ||
| auto lfs_map = CGAL::Nth_of_tuple_property_map<2, Point_with_normal_and_lfs>(); | ||
| CGAL::estimate_local_feature_size<Concurrency_tag>(points, | ||
| jet_k, | ||
| N_rays, | ||
| apex_angle, | ||
| lfs_map, | ||
| CGAL::parameters::point_map(CGAL::Nth_of_tuple_property_map<0, Point_with_normal_and_lfs>()) | ||
| .normal_map(CGAL::Nth_of_tuple_property_map<1, Point_with_normal_and_lfs>())); | ||
|
|
||
| for (const auto &pts : points){ | ||
| std::cerr << std::get<2>(pts) << std::endl; | ||
| } | ||
|
|
||
| return EXIT_SUCCESS; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.