Softy
Simulation tools and libraries for animating rigid and soft objects (including cloth) subject to frictional contacts against smooth implicit surfaces.
This repository includes a reference implementation for [1].
Softy and its documentation is a work in progress and contains loads of experimental code and unfinished prototypes for future works.
Some relatively independent utilities have already been factored out of this repo in an effort to simplify the implementation and make parts of it useful for other purposes. Beware that some of these are documented (e.g. autodiff
, hdkrs
), but some are not (e.g. gut
).
Overview
The included tools and libraries are organized in directories as follows
- implicits --- A Rust crate to generate local and global implicit surfaces.
- implicits-hdk --- A Houdini plugin for the implicits Rust crate.
- cimplicits --- A C wrapper for the implicits crate.
- softy --- A Rust crate for simulating interacting soft (both solid and shell) and rigid objects.
- softy-hdk --- A Houdini plugin for the softy Rust crate.
These tools are mainly written in Rust with C/C++ wrappers.
Implicit Surfaces
TBD
Finite element simulation of soft tissues and cloth
TBD
Houdini Plugins
TBD
References
C API conventions
This section outlines the naming conventions for any public C symbols exposed from Rust libraries.
Let pfx
be the desired prefix for the library at hand. For instance we may chose hr
as the prefix for hdkrs. The following conventions apply to all public facing C API symbols. This includes Rust code with a C public API. Private symbols in Rust code need not be prefixed.
- Function names should be in
snake_case
and prefixed withpfx_
. - Struct names should be in
TitleCase
and prefixed withPFX_
. - C Enums should be in
TitleCase
and prefixed withPFX
. Note that some Rust enums will be bound to C structs, in which case their prefix should bePFX_
. - Enum variants should be in
SCREAMING_SNAKE_CASE
and prefixed withPFX_
.
Note that we must set the language for cbindgen to be Cxx
or set cpp_compat=true
. Otherwise, without proper extern
annotations in the generated C headers, the exported function symbols will be mangled by the C++ compiler and effectively lost.
Ideally we would want to wrap any raw C calls in safer C++ wrappers.
License
This repository is licensed under the Mozilla Public License, v. 2.0.
Contributing
See CONTRIBUTING.md for details.