| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
FEM · Shells · Rigid Bodies · Frictional Contact · Strong Coupling
Docs · PDF · IEEE Page
STARK is a C++ and Python simulation platform for strongly coupled simulation of rigid and deformable bodies with frictional contact. It provides a broad set of physics models, including volumetric FEM, discrete shells, rods, rigid body joints, attachments, and IPC-based frictional contact. STARK is built on top of SymX, a symbolic differentiation and JIT compilation engine that automates derivative generation, evaluation, and much of the solver plumbing.
STARK is very easy to use and it is great for research. It has been validated through real-world, challenging cases of interactions between robots and deformable objects, see the STARK ICRA'24 paper.
import numpy as np
import pystark
# 1. Configure output and solver settings
settings = pystark.Settings()
settings.output.simulation_name = "spinning_box_cloth"
settings.output.output_directory = "output_folder"
settings.output.codegen_directory = "codegen_folder"
# 2. Create the simulation
simulation = pystark.Simulation(settings)
# 3. Set global contact parameters
contact_params = pystark.EnergyFrictionalContact.GlobalParams()
contact_params.default_contact_thickness = 0.0025
simulation.interactions().contact().set_global_params(contact_params)
# 4. Add a deformable cloth surface
cV, cT, cH = simulation.presets().deformables().add_surface_grid(
"cloth",
size=np.array([0.4, 0.4]),
subdivisions=np.array([32, 32]),
params=pystark.Surface.Params.Cotton_Fabric()
)
# 5. Add a rigid body box
bV, bT, bH = simulation.presets().rigidbodies().add_box("box", mass=1.0, size=0.08)
bH.rigidbody.add_translation(np.array([0.0, 0.0, -0.08]))
fix_handler = simulation.rigidbodies().add_constraint_fix(bH.rigidbody)
# 6. Script: spin the box over time
duration = 10.0
def script(t):
fix_handler.set_transformation(
np.array([0.0, 0.0, -0.08]),
90.0*t,
np.array([0.0, 0.0, 1.0])
)
# 7. Run
simulation.run(duration, script)The native C++ scene definition follows the same API structure. Output is written as VTK files; you can open them in ParaView or in Blender with the Sequence Loader Addon.
STARK physics models are SymX symbolic definitions of energy potentials. You can add custom physics without worrying about differentiation or other implementation details.
The following example adds an strongly coupled implicit magnetic attraction to deformable vertices, just with a small symbolic energy definition:
stark::Stark& stark_core = simulation.get_stark();
stark::PointDynamics* dyn = simulation.deformables->point_sets.get();
stark_core.global_potential->add_potential("EnergyMagneticAttraction", magnetic_vertices,
[&](MappedWorkspace<double>& mws, Element& elem)
{
Vector v1 = mws.make_vector(dyn->v1.data, elem["point"]);
Vector x0 = mws.make_vector(dyn->x0.data, elem["point"]);
Scalar dt = mws.make_scalar(stark_core.dt);
Scalar k = mws.make_scalar(magnet_force);
Vector m = mws.make_vector(magnet_center);
Vector x1 = stark::time_integration(x0, v1, dt);
Vector r = x1 - m;
return -k / r.norm();
}
);The repository includes C++ and Python examples to get you started.
C++ examples (examples/main.cpp):
Python examples (pystark/examples/):
STARK requires CMake 3.18+, a C++20 compiler, and OpenMP.
cmake -S . -B build
cmake --build build --parallel
build/examples/examples # run C++ examplesSee the setup documentation for the full integration guide.
Build from source with CMake:
cmake -S . -B build \
-DSTARK_BUILD_PYTHON_BINDINGS=ON \
-DSTARK_PYTHON_EXECUTABLE=$(which python)
cmake --build build --parallel --target pystark
export PYTHONPATH=/path/to/stark/pystark:$PYTHONPATHSee the setup documentation for Conda/virtualenv instructions and Windows notes.
Full documentation: https://stark.physics-simulation.org/
If STARK contributes to your research, please cite the paper.
@InProceedings{FLL+24,
author={Fern\'{a}ndez-Fern\'{a}ndez, Jos\'{e} Antonio and Lange, Ralph and Laible, Stefan and Arras, Kai O. and Bender, Jan},
booktitle={2024 IEEE International Conference on Robotics and Automation (ICRA)},
title={STARK: A Unified Framework for Strongly Coupled Simulation of Rigid and Deformable Bodies with Frictional Contact},
year={2024},
pages={16888-16894},
doi={10.1109/ICRA57147.2024.10610574}
}STARK benefits from real use in demanding simulation environments.
If you are:
then feel free to reach out!
|
|
Robert Bosch GmbH is acknowledged for generous financial support of the development of the initial version of STARK from 2019 to 2021. |
Contributors to the codebase:
| Back | FazBrowse Home | New Git URL |