From 0995af83f970cb218069a2ace2bc56321c0177f1 Mon Sep 17 00:00:00 2001 From: Alessio Quaglino Date: Tue, 29 Oct 2024 05:31:13 -0700 Subject: [PATCH] Add documentation for SdfLib plugin. Fixes #2182. PiperOrigin-RevId: 690980373 Change-Id: Ifc94f928e9cfbdbef3cb6f11ad4bffed542bf49a --- plugin/sdf/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugin/sdf/README.md b/plugin/sdf/README.md index 11ca621b..4646e1d9 100644 --- a/plugin/sdf/README.md +++ b/plugin/sdf/README.md @@ -62,6 +62,16 @@ Parameters: - `radius1` [m]: major radius (default `0.35`). - `radius1` [m]: minor radius (default `0.15`). +### SdfLib + +Implemented in [sdflib.cc](sdflib.cc). Example usage in [cow.xml](../../model/plugin/sdf/cow.xml). + +This plugin uses the library [SdfLib](https://github.com/UPC-ViRVIG/SdfLib) to compute a voxel-based approximation of a +user-specified mesh. The mesh can be arbitrary and not necessarily convex. This offers an alternative to +convex-decomposed meshes. The performance is likely to be slower than that of analytic SDFs, since a cubic +approximation has to be evaluated on the convex grid. However, the SDF generation is done automatically, simplifying the +task of creating an SDF, which can be difficult for complex shapes. + ### How to make your own SDF Create your `MySDF.h` and `MySDF.cc` files in the SDF folder, where this README is located. Implement your SDF using the @@ -98,3 +108,10 @@ class MySDF { MySDF(const mjModel* m, mjData* d, int instance); }; ``` + + + + + + +