Table of Contents
Fetching ...

PyFRep: Shape Modeling with Differentiable Function Representation

Pierre-Alain Fayolle, Evgenii Maltsev

TL;DR

This work addresses differentiable geometric modeling by leveraging Function Representation ($f:\mathbb{R}^3\to\mathbb{R}$) to define solids via the zero level-set $\{x\,|\,f(x)=0\}$ and extends it with reverse-mode automatic differentiation to compute space- and parameter-derivatives. The authors introduce PyFRep, a Python-based framework (backed by libraries like PyTorch) that supports SDF and non-SDF primitives, periodic functions, and parametric modeling, enabling curvature computations, distance-function normalization, redistancing, and parametric shape fitting $E(\mathbf{p}) = \frac{1}{N}\sum_i f(\mathbf{x}_i; \mathbf{p})^2$ via gradients. Key contributions include differentiable curvature formulas (mean, Gaussian, principal) derived from $\nabla f$ and the Hessian, robust SDF-based workflows, and a practical pipeline for inverse geometric design through gradient-based optimization and evolutionary methods. The framework emphasizes open-source accessibility, backend flexibility, and applicability to CAD, modeling, and graphics pipelines, highlighting the practical impact of differentiable geometric kernels in design optimization and shape interrogation. Overall, PyFRep provides a differentiable, modular, and extensible approach to implicit shape modeling that integrates with modern autodiff ecosystems for tasks ranging from curvature analysis to data-driven shape fitting.

Abstract

We propose a framework for performing differentiable geometric modeling based on the Function Representation (FRep). The framework is built on top of modern libraries for performing automatic differentiation allowing us to obtain derivatives w.r.t. space or shape parameters. We demonstrate possible applications of this framework: Curvature estimation for shape interrogation, signed distance function computation and approximation and fitting shape parameters of a parametric model to data. Our framework is released as open-source.

PyFRep: Shape Modeling with Differentiable Function Representation

TL;DR

This work addresses differentiable geometric modeling by leveraging Function Representation () to define solids via the zero level-set and extends it with reverse-mode automatic differentiation to compute space- and parameter-derivatives. The authors introduce PyFRep, a Python-based framework (backed by libraries like PyTorch) that supports SDF and non-SDF primitives, periodic functions, and parametric modeling, enabling curvature computations, distance-function normalization, redistancing, and parametric shape fitting via gradients. Key contributions include differentiable curvature formulas (mean, Gaussian, principal) derived from and the Hessian, robust SDF-based workflows, and a practical pipeline for inverse geometric design through gradient-based optimization and evolutionary methods. The framework emphasizes open-source accessibility, backend flexibility, and applicability to CAD, modeling, and graphics pipelines, highlighting the practical impact of differentiable geometric kernels in design optimization and shape interrogation. Overall, PyFRep provides a differentiable, modular, and extensible approach to implicit shape modeling that integrates with modern autodiff ecosystems for tasks ranging from curvature analysis to data-driven shape fitting.

Abstract

We propose a framework for performing differentiable geometric modeling based on the Function Representation (FRep). The framework is built on top of modern libraries for performing automatic differentiation allowing us to obtain derivatives w.r.t. space or shape parameters. We demonstrate possible applications of this framework: Curvature estimation for shape interrogation, signed distance function computation and approximation and fitting shape parameters of a parametric model to data. Our framework is released as open-source.

Paper Structure

This paper contains 27 sections, 17 equations, 10 figures.

Figures (10)

  • Figure 1: Example of a program defining a simple shape (left) and the corresponding solid (right).
  • Figure 2: Different shapes obtained by varying the radius of the cylinders (from left to right, $r=0.35,0.5,0.65$).
  • Figure 3: Computation of $\nabla f(\textit{x})$.
  • Figure 4: Computation of the divergence of a vector field $\textit{y}=\textit{v}(\textit{x})$
  • Figure 5: Left: Mean curvature on a minimal surface (the Schwarz D minimal surface). Right: Distribution of the mean curvature values.
  • ...and 5 more figures