functionalize.functionalize_scene

functionalize.functionalize_scene(geometry)

Compile a geometry SDF tree to pure (sdf, material_fn) closures.

Returns a curried function::

scene_fn = functionalize_scene(geometry)
sdf, material_fn = scene_fn(free_params, fixed_params)
distance = sdf(point)
mat_dict = material_fn(point)

Both sdf and material_fn are pure JAX functions. This helper is for geometry and material evaluation; the forward image renderer deliberately has a separate, non-differentiable API.

The node counter matches extract_parameters exactly (same DFS order, same counter increments for every Fluent node), so path-keyed fixed params align correctly — including for a node reached twice, which is numbered twice there and built only once here.

Parameters

Name Type Description Default
geometry Root SDF node of the geometry tree. required

Returns

Name Type Description
Callable (free_params, fixed_params) -> (sdf_fn, material_fn)