DeepSDFStruct#

DeepSDFStruct - Differentiable Framework for 3D Microstructured Materials#

DeepSDFStruct is a comprehensive library for creating, manipulating, and optimizing 3D microstructured geometries using Signed Distance Functions (SDFs) and spline-based lattices. The framework integrates classical geometric representations with deep learning approaches, enabling differentiable design and optimization workflows.

Key Components#

SDF Representations
  • DeepSDFStruct.SDF: Abstract base class and core SDF utilities

  • DeepSDFStruct.sdf_primitives: Geometric primitives (spheres, cylinders, etc.)

  • DeepSDFStruct.lattice_structure: Periodic lattice microstructures

Mesh Operations
  • DeepSDFStruct.mesh: Mesh generation, processing, and export

  • DeepSDFStruct.flexicubes: Advanced dual contouring (3D)

  • DeepSDFStruct.flexisquares: Dual contouring for 2D cross-sections

Deep Learning
  • DeepSDFStruct.deep_sdf: Neural network models and training

  • DeepSDFStruct.sampling: Data generation and sampling strategies

Optimization
  • DeepSDFStruct.optimization: MMA and gradient-based optimization

  • DeepSDFStruct.parametrization: Spatially-varying parameter functions

Utilities
  • DeepSDFStruct.torch_spline: Differentiable B-spline operations

  • DeepSDFStruct.plotting: Visualization tools

  • DeepSDFStruct.utils: General utility functions

Examples

Create a simple sphere and generate a mesh:

from DeepSDFStruct.sdf_primitives import SphereSDF
from DeepSDFStruct.mesh import create_3D_mesh

sphere = SphereSDF(center=[0, 0, 0], radius=0.5)
mesh = create_3D_mesh(sphere, resolution=64)

Create a lattice structure:

from DeepSDFStruct.lattice_structure import LatticeSDFStruct
from DeepSDFStruct.torch_spline import TorchSpline

# Define deformation spline and unit cell
# ... (see documentation for details)

lattice = LatticeSDFStruct(
    tiling=[3, 3, 3],
    deformation_spline=deformation,
    microtile=unit_cell
)

For comprehensive examples, see the example notebook in the repository.

Modules

SDF

deep_sdf

Deep Learning for Signed Distance Functions (DeepSDF)

design_of_experiments

flexicubes

flexisquares

lattice_structure

Lattice Structure Generation

local_shapes

mesh

Mesh Generation and Processing

optimization

Structural Optimization Utilities

parametrization

Parametrization Functions for Spatially-Varying Properties

plotting

Visualization and Plotting Utilities

pretrained_models

sampling

SDF Sampling and Dataset Generation

sdf_primitives

Primitive SDF Shapes

splinepy_unitcells

torch_spline

PyTorch-Compatible B-Spline Operations

utils

Utility Functions