Computerised Muscle Modelling and Simulation For Interactive Applications
Computerised Muscle Modelling and Simulation For Interactive Applications
Applications*
Martin Cervenka1,∗ a
, Ondrej Havlicek2 b
, Josef Kohout1 c
and Libor Váša1 d
1 The University of West Bohemia, Faculty of Applied Sciences, Department of Computer Science and Engineering,
Czech Republic
2 The University of West Bohemia, Faculty of Applied Sciences, NTIS - New Technologies for the Information Society,
Czech Republic
Keywords: Muscle Modelling, Collision Detection, Collision Response, Position Based Dynamics, Discregrid, Scalar
Distance Field, as-Rigid-as-Possible, Radial Basis Functions.
Abstract: The main challenges of collision detection and handling in muscle modelling are demonstrated. Then, a colli-
sion handling technique is tested, exploiting the issue of muscle penetrating the bone in some circumstances,
mainly when the movement is too rapid or the displacement of the bone is too high. Our approach also de-
tects the problem, using Discregrid to see the immediate direction change towards the penetrated bone. Some
alternatives to the described PBD (Position-Based dynamics) technique are presented: PBD with As-Rigid-
As-Possible modification and radial basis function approach.
214
Cervenka, M., Havlicek, O., Kohout, J. and Váša, L.
Computerised Muscle Modelling and Simulation for Interactive Applications.
DOI: 10.5220/0011688000003417
In Proceedings of the 18th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications (VISIGRAPP 2023) - Volume 1: GRAPP, pages
214-221
ISBN: 978-989-758-634-7; ISSN: 2184-4321
Copyright c 2023 by SCITEPRESS – Science and Technology Publications, Lda. Under CC license (CC BY-NC-ND 4.0)
Computerised Muscle Modelling and Simulation for Interactive Applications
215
GRAPP 2023 - 18th International Conference on Computer Graphics Theory and Applications
They adopt ”Particle simulation using CUDA” from sation approach in terms of accuracy. However, there
(Green, 2010) for collision detection between rods is still some work because even those methods only
and response. Again, the problem of muscle-bone work correctly in extreme conditions, mainly if the
penetration is not addressed, though in this case, the movement is rapid.
extension is relatively straightforward. The collision response is a complicated task
The position-based dynamics for muscle mod- as well. Assume that two bones move towards
elling is also described in the paper ”Fast and Real- each other and narrowly miss each other (like shear
istic Approach to Virtual Muscle Deformation.” (Cer- blades). If a muscle is attached to both of the bones
venka. and Kohout., 2020) where the PBD approach and appears to be in between the bones, there is no
has been proposed (finished the same year as Romeo’s such room for the bones to move into. This problem
article (Romeo et al., 2018), working concurrently on often happens on a smaller scale, near joints, espe-
the same). The paper ”Muscle Deformation using cially where two bones move close. Our former so-
Position Based Dynamics” (Kohout and Červenka, lution (Cervenka and Skala, 2020) was to assume, in
2021) follows, which tests the approach and compares this particular case, only one of the bones and move
the results to an existing FEM technique. The primary a muscle in the direction opposite of it, but it proved
benefit of our suggested system is that no interior is insufficient. Havlicek (Havlicek et al., 2022) targets
needed. The anisotropy is computed on the surface this problem primarily, and he proposed a better ap-
of the mesh only, utilising muscle fibres on the mesh proach of considering all adjacent bones and moving
surface, representing the fibre direction. The voxeli- opposite to the sum of all collision vectors. Even this
sation technique has been used for collision detection approach, however, does not always guarantee colli-
and response purposes. sion resolution.
Our current contribution, proposed in this paper,
follows our recent articles, mainly (Cervenka. and
4 COLLISION DETECTION AND Kohout., 2020; Kohout and Červenka, 2021) and also
(Havlicek et al., 2022).In the first article, we devel-
RESPONSE oped a PBD-based approach for muscle modelling.
The issue with a muscle stuck inside a joint was
Various approaches to detect and respond to an oc- shown in that article. We believed that ”better col-
curring collision have been proposed. The most com- lision detection can fix the issue” (Cervenka. and Ko-
mon algorithms exploit the D&C (divide & conquer) hout., 2020). In the second article, the voxelisation
paradigm. The bounding volume hierarchy is one of collision detection approach was proven inaccurate in
them (Teschner et al., 2005), using a primitive (of- some cases, mainly in the case of more ”complicated”
ten an axis-aligned bounding box AABB or a sphere) (e.g. concave) bone surfaces, which are located near
hierarchy to enclose the model and its parts. The spa- the joint areas more frequently. The last article ex-
tial hashing (Turk, 1990) is its generalisation over the plores two existing collision detection algorithms for
whole model space. the PBD approach: Discregrid and Flexible Collision
If there is a necessity to know not only if the col- Library. The Discregrid was shown to be more suit-
lision occurs but how far from the collision the model able for the problem.
is, the (signed) distance field approach is an excel-
lent way to go. Numerous techniques can be used
to construct such a field. The vast majority use vox-
4.1 Discregrid
elisation to obtain a cell array and then use an inter-
Discregrid library can be considered a Signed Dis-
polation method to determine the value between the
tance Field generator written in C++. The algorithm
cells. Some of these techniques are well described in
computes for each point in 3D space the shortest dis-
an older work by (Bærentzen and Aanæs, 2002).
tance and direction towards a given nearby surface
In our research of the PBD approach, the first de-
represented by a triangular mesh. Also, assuming
cision was to use a simple voxelisation method to
that the input mesh is at least watertight, the method
simplify the collision detection problem. This sim-
can make the inside/outside decision because the al-
ple idea, however, leads to some things that could be
gorithm provides the sign. A finite bounded subspace
improved. Luckily, some ideas have emerged to en-
is required for the approach to work.
tirely improve or even fix some problems, using more
The bounded surface is firstly divided (like in the
complex collision detection algorithms. Havlicek
voxelisation method) into a rectangular grid with a
(Havlicek et al., 2022) changed the collision detec-
user-defined resolution, where each voxel is a 32-
tion to Discregrid (using a signed distance field) and
node Serendipity type (Koschier and Bender, 2017).
FLC (using a binary search tree), beating the voxeli-
216
Computerised Muscle Modelling and Simulation for Interactive Applications
For each node, the distance and the direction to- with the approximate degree of 1◦ ) and hip adduction
wards the nearest bounded surface are computed, see (from 0◦ to +60◦ with the approximate step of 2◦ ).
(Bærentzen and Aanæs, 2002). The article describes The results of hip flexion are shown in Fig. 3.
the problem of discontinuity of the mesh (where the Near the joint area, the muscle nearly touches the fe-
normal vectors have to be estimated differently). mur bone; however, no collision occurs. Fig. 4 shows
The field creation process is time-consuming the results for the rotational motion. As before, the
(about half a minute for bone meshes consisting of muscle nearly touches the femur’s upper extremity
up to 45 000 vertices with the grid resolution of without collisions. The adduction is demonstrated in
64 × 64 × 64 on standard hardware) and unfeasible Fig. 5. In this case, the muscle is further from the hip
for deformable objects like muscles, where recalcu- joint, lowering the possibility of collisions. The col-
lation is often needed. There is no such problem with lision detection and response approach solved all the
the bone models because their movement is only rigid apriori collisions, so no collisions happened.
(allowing for Discregrid results to be transformed us-
ing a global transformation). 5.2 Test of Motion Speeds
In the case of muscle modelling, a situation may
happen when the muscle collides with a bone or an- To test for bone movement speed impact, we chose
other muscle, even at the start of the simulation. This the extension movement. The initial step of 2◦ was
situation is caused by the different modalities used for increased to 4◦ , 5◦ and finally 10◦ . We also increased
the data measurements (see section 2). To fix the is- the target angle to +80◦ for rapid movement to have
sue, the colliding surface vertices are pushed accord- time and space to show up fully.
ing to the Discregrid result directional vectors so no In this case, when the angle finally reaches 72◦
collision would occur at the start of the simulation. with the angle step of 4◦ , first bone penetration occurs
(see Fig. 6). The muscle is not as fast as needed to
keep up with the bone movement, causing the distal
5 MUSCLE SIMULATION part of the muscle to enter the bone volume and go
through the whole cross-section. The muscle is also
In this paper, we experimented with more types of being unnaturally pushed into itself by the bone.
motion of the hip joint, not just flexion but also ro-
tation and adduction. We also tested a hip extension
scenario in the described PBD approach to find the
maximum amount of problematic cases possible. The
tests will be done on muscles and bones depicted in
Fig. 1.
217
GRAPP 2023 - 18th International Conference on Computer Graphics Theory and Applications
arccos di · d′i 2
> 135◦ (1)
di · d′i 2 > −0.75
218
Computerised Muscle Modelling and Simulation for Interactive Applications
can be selected by their initial distance and kept in a fectively slowing down the simulation, which
list. This list could also be updated if the PBD dis- would become no longer interactive (Kohout and
placement of a particular vertex away from the other Červenka, 2021);
muscle would be greater than its initial distance, let- • uses the eXtended PBD, which converges more
ting the point go. Similarly, collecting more vertices consistently (the iteration count is not as signifi-
into this list could be achieved via checking, for ex- cant) but does not solve the penetration issues;
ample, the neighbourhood vertices, which would be • uses a different muscle model.
the likely candidates.
In case the PBD forces are less in magnitude than 6.1 RBF Representation
this attraction force but still point away from the mus-
cle, the vertex would be pushed in the closest direc- The radial basis function model opens a new possi-
tion to the other muscle surface, effectively making bility to develop a new approach to the deformation
the point slide along the other muscle surface and of this model, which would allow smooth and rapid
hopefully preventing it from colliding or unrealisti- muscle simulation. Collision detection and response,
cally spanning out, as illustrated in Fig. 2. volume preservation, and muscle anisotropy are the
This functionality is implemented preliminarily, challenges for future work.
using the Discregrid library to preserve the distances The critical decision for the suitable model is to
between a bone and a muscle. The resulting vir- select the suitable radial basis function and shape pa-
tual edges can be seen in Figure 7. The reason for rameters (if any). A comprehensive study of some
this measure is that the original idea implementation well-known RBFs has already been made (see, e.g.
would be beyond the scope of this paper. (Majdisova and Skala, 2017)), and the shape param-
eters were explored (e.g. in (Skala and Cervenka,
2019) or (Afiatdoust and Esmaeilbeigi, 2015)).
219
GRAPP 2023 - 18th International Conference on Computer Graphics Theory and Applications
ACKNOWLEDGEMENTS
The authors thank their colleagues and students at the
University of West Bohemia for their discussions and
suggestions. This work was supported by the Ministry
of Education, Youth and Sports of the Czech Repub-
lic, project SGS-2022-015 New Methods for Medical,
Spatial, and Communication Data.
REFERENCES
Afiatdoust, F. and Esmaeilbeigi, M. (2015). Optimal vari-
able shape parameters using genetic algorithm for ra-
dial basis function approximation. Ain Shams Engi-
neering Journal, 6(2):639–647.
Angles, B., Rebain, D., Macklin, M., Wyvill, B., Barthe,
L., Lewis, J., Von Der Pahlen, J., Izadi, S., Valentin,
Figure 8: ARAP approach with a simple volume preserva- J., Bouaziz, S., and Tagliasacchi, A. (2019). Viper:
tion constraint. The initial model is in white, the user de- Volume invariant position-based elastic rods. Proc.
formation is in yellow. The volume preserving model with ACM Comput. Graph. Interact. Tech., 2(2).
user defined constraint is in lime blue, the green model is Aubel, A. and Thalmann, D. (2001). Interactive modeling
the simple interweaving approach of the ARAP and PBD. of the human musculature. In Proceedings Computer
Animation 2001. Fourteenth Conference on Computer
ematical reformulation of the shape constraint and Animation (Cat. No.01TH8596), pages 167 – 255.
finding a gradient expression would be required for Barzan, M., Carty, C., Maine, S., Brito da Luz, S., Lloyd,
the ARAP shape preservation constraint. The other D., and Modenese, L. (2017). Subject-specific knee
option is to start with ARAP and replace the interleav- kinematics during walking in children and adolescents
with recurrent patellar dislocation. In 23rd Australian
ing approach with gradient descent from PBD. Then, & New Zealand Orthopaedic Research Society.
a volume constraint can be added. Either way, both Burzyński, S., Sabik, A., Witkowski, W., and Łuczkiewicz,
methods should end up with the same result. P. (2021). Influence of the femoral offset on the mus-
cles passive resistance in total hip arthroplasty. PLOS
ONE, 16(5):1–12.
7 CONCLUSION Bærentzen, A. and Aanæs, H. (2002). Generating Signed
Distance Fields From Triangle Meshes. Informatics
and Mathematical Modelling.
All of the described techniques for muscle mod- Cervenka., M. and Kohout., J. (2020). Fast and realistic
elling provide good outcomes; however, each has approach to virtual muscle deformation. In Proceed-
some drawbacks. Some are inaccurate (Hill-type ings of the 13th International Joint Conference on
model (Hill, 1938), incorrect according to (Burzyński Biomedical Engineering Systems and Technologies -
et al., 2021), Via-points too approximate according HEALTHINF,, pages 217–227. INSTICC, SciTePress.
to (Modenese and Kohout, 2020)), some are accu- Cervenka, M. and Skala, V. (2020). Behavioral study of
rate but difficult to set up or simply too slow to be various radial basis functions for approximation and
useful (Finite element methods used by, e.g. (Delp interpolation purposes. In 2020 IEEE 18th World Sym-
posium on Applied Machine Intelligence and Infor-
and Blemker, 2005), proved difficult to set up by matics (SAMI), pages 135–140.
(Romeo et al., 2018)). Other methods are ”com- Delp, S. and Blemker, S. (2005). Three-dimensional repre-
promise solutions” in terms of accuracy and com- sentation of complex muscle architectures and geome-
putational complexity (Mass-Spring system, (Georgii tries. Annals of biomedical engineering, 33:661–73.
and Westermann, 2005; Aubel and Thalmann, 2001; Dvořák, J., Káčereková, Z., Vaněček, P., Hruda, L., and
Janák, 2012), PBD, As-Rigid-As-Possible (Sorkine Váša, L. (2022). As-rigid-as-possible volume track-
and Alexa, 2007; Fasser et al., 2021; Wang et al., ing for time-varying surfaces. Computers & Graphics,
102:329–338.
220
Computerised Muscle Modelling and Simulation for Interactive Applications
Fasser, M. ., Jokeit, M., Kalthoff, M., Gomez Romero, use in personalised musculoskeletal models. Annals
D. A., Trache, T., Snedeker, J. G., Farshad, M., of Biomedical Engineering, 48.
and Widmer, J. (2021). Subject-specific alignment Müller, M., Heidelberger, B., Hennix, M., and Ratcliff,
and mass distribution in musculoskeletal models of J. (2007). Position based dynamics. Journal of
the lumbar spine. Frontiers in Bioengineering and Visual Communication and Image Representation,
Biotechnology, 9. Cited By :2. 18(2):109–118.
Fukuda, N., Otake, Y., Takao, M., Yokota, F., Ogawa, T., Oatis, C. A. (2017). Biomechanics of skeletal muscle. Lip-
Uemura, K., Nakaya, R., Tamura, K., Grupp, R., Far- pincott Williams & Wilkins.
vardin, A., Sugano, N., and Sato, Y. (2017). Estima- Romeo, M., Monteagudo, C., and Sánchez-Quirós, D.
tion of attachment regions of hip muscles in ct im- (2018). Muscle Simulation with Extended Position
age using muscle attachment probabilistic atlas con- Based Dynamics. In Garcı́a-Fernández, I. and Ureña,
structed from measurements in eight cadavers. Inter- C., editors, Spanish Computer Graphics Conference
national Journal of Computer Assisted Radiology and (CEIG). The Eurographics Association.
Surgery, 12.
Skala, V. and Cervenka, M. (2019). Novel rbf approxima-
Georgii, J. and Westermann, R. (2005). Mass-spring sys- tion method based on geometrical properties for sig-
tems on the gpu. Simulation Modelling Practice and nal processing with a new rbf function: Experimental
Theory, 13:693–702. comparison. In 2019 IEEE 15th International Scien-
Green, S. (2010). Particle simulation using cuda. In Particle tific Conference on Informatics.
Simulation using CUDA. Sorkine, O. and Alexa, M. (2007). As-Rigid-As-Possible
Havlicek, O., Cervenka, M., and Kohout, J. (2022). Colli- Surface Modeling. In Belyaev, A. and Garland, M.,
sion detection and response approaches for computer editors, Geometry Processing. The Eurographics As-
muscle modelling. accepted for the IEEE 16th Inter- sociation.
national Scientific Conference on Informatics. Teschner, M., Kimmerle, S., Heidelberger, B., Zachmann,
Hill, A. (1938). The heat of shortening and the dynamic G., Raghupathi, L., Fuhrman, A., Cani, M.-P., Faure,
constants of muscle. Proc. R. Soc. Lond. B, 126:612– F., Magnenat-Thalmann, N., Strasser, W., and Volino,
745. P. (2005). Collision Detection for Deformable Ob-
Janák, T. (2012). Fast soft-body models for musculoskele- jects. Computer Graphics Forum.
tal modelling. Technical report, University of West Turk, G. (1990). Interactive collision detection for molec-
Bohemia, Faculty of Applied Sciences. ular graphics. Technical report, University of North
Kohout, J. and Červenka, M. (2021). Muscle deformation Carolina at Chapel Hill, USA.
using position based dynamics. In Ye, X., Soares, Wade, S., Strader, C., Fitzpatrick, L., Anthony, M., and
F., De Maria, E., Gómez Vilda, P., Cabitza, F., Fred, O’Malley, C. (2014). Estimating prevalence of os-
A., and Gamboa, H., editors, Biomedical Engineer- teoporosis: Examples from industrialized countries.
ing Systems and Technologies, pages 486–509, Cham. Archives of osteoporosis, 9:182.
Springer International Publishing. Wang, B., Matcuk, G., and Barbič, J. (2021). Modeling
Koschier, D. and Bender, J. (2017). Density maps for im- of personalized anatomy using plastic strains. ACM
proved sph boundary handling. In Proceedings of Trans. Graph., 40(2).
the ACM SIGGRAPH / Eurographics Symposium on Zhang, G., Wang, C., Liu, Q., Wei, J., Luo, C., Duan, L.,
Computer Animation, SCA ’17, New York, NY, USA. Long, J., Zhang, X., and Wang, G. (2021). Develop-
Association for Computing Machinery. ment of skeletal muscle model for bridge-style move-
Lee, D., Li, Z., Sohail, Q. Z., Jackson, K., Fiume, E., and ment rehabilitation. Journal of Physics: Conference
Agur, A. (2014). A three-dimensional approach to Series, 2026:012061.
pennation angle estimation for human skeletal mus- Zhang, S.-X., Heng, P.-A., Liu, Z.-J., Tan, L.-W., Qiu, M.-
cle. Computer methods in biomechanics and biomed- G., Li, Q.-Y., Liao, R.-X., Li, K., Cui, G.-Y., Guo,
ical engineering, 18:1–11. Y.-L., Yang, X.-P., Liu, G.-J., Shan, J.-L., Liu, J.-J.,
Li, H., Sumner, R., and Pauly, M. (2008). Global correspon- Zhang, W.-G., Chen, X.-H., Chen, J.-H., Wang, J.,
dence optimization for non-rigid registration of depth Chen, W., Lu, M., You, J., Pang, X.-L., Xiao, H., Xie,
scans. Computer Graphics Forum, 27. Y.-M., and Cheng, J. C.-Y. (2004). The chinese vis-
Macklin, M., Müller, M., and Chentanez, N. (2016). Xpbd: ible human (cvh) datasets incorporate technical and
Position-based simulation of compliant constrained imaging advances on earlier digital humans. Journal
dynamics. In Proceedings of the 9th International of Anatomy, 204(3):165–173.
Conference on Motion in Games, MIG ’16, page Zhao, Y., Clapworthy, G., Kohout, J., Dong, F., Tao, Y.,
49–54, New York, NY, USA. Association for Com- Wei, S., and Mcfarlane, N. (2013). Laplacian muscu-
puting Machinery. loskeletal deformation for patient-specific simulation
Majdisova, Z. and Skala, V. (2017). Radial basis function and visualisation. In 2013 17th International Confer-
approximations: comparison and applications. Ap- ence on Information Visualisation, pages 505–510.
plied Mathematical Modelling, 51:728–743.
Modenese, L. and Kohout, J. (2020). Automated generation
of three-dimensional complex muscle geometries for
221