Skip to content

novaphy.HydroelasticSdfConfig

Runtime configuration for hydroelastic SDF contact generation and reduction. Pass it to CollisionPipeline as sdf_hydroelastic_config=....

This top-level class is the validated, executable configuration used by the C++ collision pipeline. It is distinct from novaphy.geometry.HydroelasticSDF.Config, a Python compatibility dataclass that only stores option values.

Constructor

HydroelasticSdfConfig(
    *,
    reduce_contacts=True,
    pre_prune_contacts=True,
    normal_matching=True,
    anchor_contact=False,
    moment_matching=False,
    buffer_fraction=1.0,
    buffer_mult_broad=1,
    buffer_mult_iso=1,
    buffer_mult_contact=1,
    contact_buffer_fraction=0.5,
    margin_contact_area=1.0e-2,
    contact_reduction_hashtable_size_factor=0.25,
    grid_size=262144,
    mc_edge_clamp_min=0.02,
    pressure_func=None,
    pressure_data=None,
)

Attributes

Attribute Description
reduce_contacts Enable hydroelastic contact reduction.
pre_prune_contacts Prune candidate contacts before reduction.
normal_matching Include normal agreement when reducing contacts.
anchor_contact Retain an anchor contact for reduction.
moment_matching Match contact moments; normalization also enables anchor_contact.
buffer_fraction Broad reduction-buffer fraction, validated in (0, 1].
buffer_mult_broad, buffer_mult_iso, buffer_mult_contact Positive integer capacity multipliers.
contact_buffer_fraction Contact-buffer fraction, validated in (0, 1].
margin_contact_area Positive contact-area margin.
contact_reduction_hashtable_size_factor Positive hash-table capacity factor.
grid_size Positive hydroelastic grid capacity.
mc_edge_clamp_min Marching-cubes edge clamp in [0, 0.5].
pressure_func Original Python pressure-law function, or None.
pressure_data Scalar/array data object supplied to the pressure law, or None.
has_pressure_func Read-only flag indicating that a pressure law has been compiled.

pressure_func and pressure_data must either both be supplied or both be None. See pressure_func for the supported function subset and device-array rules.

Methods

Method Description
normalize() Enable anchor_contact when moment_matching is enabled.

Example

import novaphy

hydro = novaphy.HydroelasticSdfConfig(
    reduce_contacts=True,
    moment_matching=True,
)
pipeline = novaphy.CollisionPipeline(
    model,
    sdf_hydroelastic_config=hydro,
)

When editing a configuration retrieved from an existing pipeline, assign it back through pipeline.sdf_hydroelastic_config = config to synchronize the C++ pipeline.

See Also