Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fossils
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Boman Romain
fossils
Commits
49304bbe
Commit
49304bbe
authored
11 months ago
by
Boman Romain
Browse files
Options
Downloads
Patches
Plain Diff
update script
parent
922e630d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
new loads
Pipeline
#23794
passed
11 months ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/view_cylinder_T.py
+19
-13
19 additions, 13 deletions
models/view_cylinder_T.py
with
19 additions
and
13 deletions
models/view_cylinder_T.py
+
19
−
13
View file @
49304bbe
...
...
@@ -3,12 +3,16 @@
#
# Test of the "boneload.create_loads" subroutine
# with a simple geometry (cylinder)
# The force vectors are computed according to the 'Tangential-Traction Model'
# and displayed with VTK
# The force vectors are computed according to a chosen model
# and displayed with VTK
#
# RUN THIS FILE from the "models" directory:
# cd models
# python view_cylinder_T.py
from
boneload
import
*
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
# load meshes (main mesh, selection and focal point)
surface
,
_
,
_
=
SurfMesh
.
load
(
'
cylinder/cylinder.ply
'
,
vertices
=
False
)
...
...
@@ -16,8 +20,11 @@ if __name__=="__main__":
muscleF
,
focalnodes
,
_
=
SurfMesh
.
load
(
'
cylinder/muscleF.off
'
)
# calls 'create_loads'
loads
=
create_loads
(
nodes
,
tris
,
\
total_force
=
10.
,
target
=
focalnodes
[
0
],
method
=
'
T
'
)
loads
=
create_loads
(
nodes
,
tris
,
total_force
=
10.
,
target
=
focalnodes
[
0
],
method
=
'
T
'
)
# <= change loading model here
# among 'U', 'T', 'T+N', 'N' or 'D'
# add vector field to the surface for display
muscle
.
add_vectors
(
loads
)
...
...
@@ -26,21 +33,20 @@ if __name__=="__main__":
# configure 3D display
view
=
View
()
view
.
addActors
(
surface
.
actor
)
view
.
addActors
(
muscle
.
actor
)
view
.
addActors
(
muscleF
.
actor
)
view
.
addActors
(
forces
.
actor
)
view
.
addActors
(
surface
.
actor
)
view
.
addActors
(
muscle
.
actor
)
view
.
addActors
(
muscleF
.
actor
)
view
.
addActors
(
forces
.
actor
)
surface
.
actor
.
GetProperty
().
SetOpacity
(
0.3
)
muscle
.
mapper
.
SetResolveCoincidentTopologyToPolygonOffset
()
muscle
.
actor
.
GetProperty
().
SetColor
(
colors
.
GetColor3d
(
'
red
'
)
)
muscle
.
actor
.
GetProperty
().
SetColor
(
colors
.
GetColor3d
(
'
red
'
))
muscle
.
actor
.
GetProperty
().
SetOpacity
(
0.5
)
muscle
.
actor
.
GetProperty
().
EdgeVisibilityOn
()
muscle
.
actor
.
GetProperty
().
SetPointSize
(
1.0
)
muscleF
.
actor
.
GetProperty
().
SetPointSize
(
15.0
)
muscleF
.
actor
.
GetProperty
().
SetColor
(
colors
.
GetColor3d
(
'
green
'
)
)
muscleF
.
actor
.
GetProperty
().
SetColor
(
colors
.
GetColor3d
(
'
green
'
))
view
.
interact
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment