NavMap
Loading...
Searching...
No Matches
Simplify.hpp
Go to the documentation of this file.
1// Copyright 2026 Intelligent Robotics Lab
2//
3// This file is part of the project Easy Navigation (EasyNav in short)
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
21
22#ifndef NAVMAP_CORE__SIMPLIFY_HPP_
23#define NAVMAP_CORE__SIMPLIFY_HPP_
24
25#include <cstddef>
26#include <limits>
27#include <string>
28#include <vector>
29
31
32namespace navmap
33{
34
37{
40 float max_error{0.02f};
42 float max_edge_length{std::numeric_limits<float>::infinity()};
44 float min_quality{0.15f};
46 float max_normal_change{30.0f};
48 std::vector<std::string> layers;
51 std::vector<std::string> ignore_layers;
52};
53
56{
57 std::size_t navcels_before{0}, navcels_after{0};
58 std::size_t vertices_before{0}, vertices_after{0};
59};
60
71SimplifyStats simplify(NavMap & nm, const SimplifyParams & params = {});
72
73} // namespace navmap
74
75#endif // NAVMAP_CORE__SIMPLIFY_HPP_
Core container and data structures for EasyNav navigable meshes.
Definition NavMap.hpp:561
Definition Combine.hpp:39
SimplifyStats simplify(NavMap &nm, const SimplifyParams &params={})
Simplify nm in place by half-edge collapses, cheapest first.
Definition Simplify.cpp:403
Parameters of simplify().
Definition Simplify.hpp:37
std::vector< std::string > layers
Layers whose values must not change anywhere; empty: all the layers of the map.
Definition Simplify.hpp:48
float max_edge_length
No edge longer than this (m). Bounds the NavCel size, e.g. to keep marking obstacles fine.
Definition Simplify.hpp:42
float max_normal_change
Maximum rotation (deg) of a NavCel's normal with respect to the original one.
Definition Simplify.hpp:46
float max_error
Geometric error (m): every vertex stays within this distance of the planes of the original NavCels it...
Definition Simplify.hpp:40
float min_quality
Minimum NavCel quality, 4·sqrt(3)·area / sum of squared edges (1 equilateral, 0 flat).
Definition Simplify.hpp:44
std::vector< std::string > ignore_layers
Layers left out of the above (e.g.
Definition Simplify.hpp:51
Sizes before and after simplify().
Definition Simplify.hpp:56
std::size_t navcels_after
Definition Simplify.hpp:57
std::size_t navcels_before
Definition Simplify.hpp:57
std::size_t vertices_before
Definition Simplify.hpp:58
std::size_t vertices_after
Definition Simplify.hpp:58