Tesseract 0.28.4
Loading...
Searching...
No Matches
sdf_interpolation_benchmark.cpp File Reference

Speed and accuracy of the Bullet signed distance field paths. More...

#include <tesseract/common/macros.h>
#include <algorithm>
#include <chrono>
#include <array>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <functional>
#include <iterator>
#include <memory>
#include <random>
#include <string>
#include <vector>
#include <BulletCollision/CollisionShapes/btCollisionShape.h>
#include <tinyvdb_io.h>
#include <tinyvdb_nanovdb.h>
#include <tinyvdb_sparse_tree.h>
#include <tesseract/collision/bullet/bullet_utils.h>
#include <tesseract/collision/bullet/tesseract_sdf_collision_shape.h>
#include <tesseract/collision/implicit_sdf_collision_solver.h>
#include <tesseract/geometry/geometries.h>
#include <tesseract/geometry/impl/signed_distance_field_utils.h>

Classes

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

Enumerations

enum class  SignedDistanceFieldInterpolation
 How a grid-backed or sparse field is read between its samples. More...

Functions

int main (int argc, char **argv)

Detailed Description

Speed and accuracy of the Bullet signed distance field paths.

Compares the ways TesseractSdfCollisionShape can read a field in place (trilinear, tricubic Catmull-Rom, and split: trilinear distance with tricubic direction), for dense and sparse (NanoVDB) fields. Every query goes through the same helpers Bullet's SDF algorithms use (querySdfShapePoint, makeImplicitSdfShape + collideImplicitSDF), so only the field representation differs.

Accuracy is measured against exact analytic distances on curved surfaces (a sphere, a cylindrical bore) and sharp features (a box's edges and creases, and a 90 degree inside corner). The inside corner is the hardest of these: where two surfaces meet at 90 degrees, the distance has a crease along their bisector and its gradient flips across it. It is also where a tool often works, for example along the seam between two plates in welding.

Usage: sdf_interpolation_benchmark [spacing_m] (default 0.001) sdf_interpolation_benchmark field.nvdb (a real field, mm)

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.

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.