To explain the modus operandi of pyFormex, the WireStent.py script is parsed step by step. To start, all required modules to run the WireStent.py script are imported (e.g. the math module to use the mathematical constant
). Subsequently, the class DoubleHelixStent is defined which allows the simple use of the geometrical model in other scripts for e.g. parametric, optimization and finite element analyses of braided wire stents. Consequently, the latter scripts do not have to contain the wire stent geometry building and can be condensed and conveniently arranged. The definition of the class starts with a
documentation string
, explaining its aim and functioning.
from formex import *
class DoubleHelixStent:
"""Constructs a double helix wire stent.
A stent is a tubular shape such as used for opening obstructed
blood vessels. This stent is made frome sets of wires spiraling
in two directions.
The geometry is defined by the following parameters:
L : length of the stent
De : external diameter of the stent
D : average stent diameter
d : wire diameter
be : pitch angle (degrees)
p : pitch
nx : number of wires in one spiral set
ny : number of modules in axial direction
ds : extra distance between the wires (default is 0.0 for
touching wires)
dz : maximal distance of wire center to average cilinder
nb : number of elements in a strut (a part of a wire between two
crossings), default 4
The stent is created around the z-axis.
By default, there will be connectors between the wires at each
crossing. They can be switched off in the constructor.
The returned formex has one set of wires with property 1, the
other with property 3. The connectors have property 2. The wire
set with property 1 is winding positively around the z-axis.
"""
The constructor __init__ of the DoubleHelixStent class requires 8 arguments:
connectors=True, extra elements are created at the positions where there is physical contact between the crossing wires. These elements are required to enable contact between these wires in finite element analyses.
The virtual construction of the wire stent structure is defined by the following sequence of four operations: (i) Creation of a nearly planar base module of two crossing wires; (ii) Extending the base module with a mirrored and translated copy; (iii) Replicating the extended base module in both directions of the base plane; and (iv) Rolling the nearly planar grid into the cylindrical stent structure, which is easily parametric adaptable.