Closed kmindspark closed 3 years ago
This functionality is not available in the config files, but you can create an animation script in C++. The file to look at and extend is src/AnimScripter.cpp
.
If you look at the stretch and squash script: https://github.com/ipc-sim/IPC/blob/7697cbbb81cca99a842e514e35753e836d13a342/src/AnimScripter.cpp#L1618 hopefully you can get an idea of how it works. Basically, you initialize the action in AnimScripter<dim>::initAnimScript
and dynamically change it in AnimScripter<dim>::stepAnimScript
.
There are a couple of animation scripts in there. AST_NULL
is the general case used for config txt files. To specify a script to run add the line script <scriptname>
to your config file, where all scriptname
s can be found here: https://github.com/ipc-sim/IPC/blob/7697cbbb81cca99a842e514e35753e836d13a342/src/AnimScripter.cpp#L33
One other option that is exposed in the config files is the usage of DBCTimeRange
and NBCTimeRange
to specify the time range for which the BCs are active. For example, DBCTimeRange 1 10
will start applying DBC after 1 second and stop after 10 seconds of simulation.
Yeah I saw those, but I needed to script the motion of some particular vertices at different points in time. Thanks for the first suggestion, I will take a closer look at that.
I ended up modifying the source code to take in 2 additional numbers (start & end time) per DBC command so I could easily script motions. Resolved!
Cool. Pull request welcome, if you want. I know this was something others had asked for.
I just pushed a change that allows for start and end times to each DBC and NBC. More information can be found here: https://github.com/ipc-sim/IPC/wiki#timed-boundary-conditions
Thanks for the heads up. Sorry I didn't have time to make a pull request.
This is more of a feature request, but is there currently no way to apply some DBCs for some time intervals and others for other time intervals?