Tesseract 0.28.4
Loading...
Searching...
No Matches
signed_distance_field.h File Reference

Tesseract Signed Distance Field Geometry. More...

#include <tesseract/common/macros.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <cstdint>
#include <functional>
#include <memory>
#include <vector>
#include <tesseract/common/fwd.h>
#include <tesseract/geometry/geometry.h>

Classes

class  tesseract::geometry::SignedDistanceField
 A volumetric signed distance field geometry. More...

Typedefs

using tesseract::geometry::SignedDistanceFunction = std::function<double(const Eigen::Vector3d&)>
 Evaluate the signed distance at a single point in the field's local frame.
using tesseract::geometry::BatchedSignedDistanceFunction = std::function<std::vector<double>(const std::vector<Eigen::Vector3d>&)>
 Evaluate the signed distance at many points at once.

Enumerations

enum class  tesseract::geometry::SignedDistanceFieldInterpolation : std::uint8_t { TRILINEAR , TRICUBIC }
 How a grid-backed or sparse field is read between its samples. More...

Functions

template<class Archive>
void tesseract::geometry::serialize (Archive &ar, SignedDistanceField &obj)
 Format version 1, the first with a version: the interpolation settings, then the band clamp of each NanoVDB grid and the grids as one NanoVDB file, as writeSignedDistanceFieldNVDB writes it. A sparse field has one grid and a multi-level field one per level, finest first; their domain and dimensions follow from the grids, and a field with one level loads as a plain sparse field. A field without grids is dense and stores its sample grid instead. Then the scale. A later format bumps SIGNED_DISTANCE_FIELD_ARCHIVE_VERSION and branches on it here.

Detailed Description

Tesseract Signed Distance Field Geometry.

Author
Joel Kang
Date
June 10, 2026
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ BatchedSignedDistanceFunction

using tesseract::geometry::BatchedSignedDistanceFunction = std::function<std::vector<double>(const std::vector<Eigen::Vector3d>&)>

Evaluate the signed distance at many points at once.

Receives every sample point in one call and must return one distance per point, in the same order. Use this overload to vectorize / offload the evaluation (e.g. a batched nvblox ESDF GPU query) instead of paying a per-point call.

Enumeration Type Documentation

◆ SignedDistanceFieldInterpolation

How a grid-backed or sparse field is read between its samples.

Both pass through the samples and reproduce a linear field exactly. They differ in how many samples a read uses and whether the gradient is continuous across cell faces.

Enumerator
TRILINEAR 

2x2x2 samples. Passes through the samples; the gradient jumps at cell faces. The default.

TRICUBIC 

4x4x4 samples, Catmull-Rom. Passes through the samples; the gradient is continuous.

Function Documentation

◆ serialize()

template<class Archive>
void tesseract::geometry::serialize ( Archive & ar,
SignedDistanceField & obj )

Format version 1, the first with a version: the interpolation settings, then the band clamp of each NanoVDB grid and the grids as one NanoVDB file, as writeSignedDistanceFieldNVDB writes it. A sparse field has one grid and a multi-level field one per level, finest first; their domain and dimensions follow from the grids, and a field with one level loads as a plain sparse field. A field without grids is dense and stores its sample grid instead. Then the scale. A later format bumps SIGNED_DISTANCE_FIELD_ARCHIVE_VERSION and branches on it here.

Note
An explicit field rather than CEREAL_CLASS_VERSION: cereal also matches the base class's unversioned serialize for this type and rejects the pair as ambiguous.