6.1.1 Creating the base module

Depending on the specified arguments in the constructor, the mean stent diameter $D$, the average stent radius $r$, the bump or curvature of the wires $dz$, the pitch $p$ and the number of base modules in the axial direction $ny$ are calculated with the following script. As the wire stent structure is obtained by braiding, the wires have an undulating course and the bump dz corresponds to the amplitude of the wave. If no extra distance $ds$ is specified, there will be exactly one wire diameter between the centre lines of the crossing wires. The number of modules in the axial direction $ny$ is an integer, therefore, the actual length of the stent model might differ slightly from the specified, desired length $L$. However, this difference has a negligible impact on the numerical results.


    def __init__(self,De,L,d,nx,be,ds=0.0,nb=4,connectors=True):
        """Create the Wire Stent."""
        D = De - 2*d - ds
        r = 0.5*D
        dz = 0.5*(ds+d)
        p = math.pi*D*tand(be)
        nx = int(nx)
        ny = int(round(nx*L/p))  # The actual length may differ
		 a bit from L

Of now, all parameters to describe the stent geometry are specified and available to start the construction of the wire stent. Initially a simple Formex is created using the pattern()-function: a straigth line segment of length 1 oriented along the X-axis (East or $1$-direction). The replic()-functionality replicates this line segment $nb$ times with step 1 in the X-direction ($0$-direction). Subsequently, these $nb$ line segments form a new Formex which is given a one-dimensional bump with the bump1()-function. The Formex undergoes a deformation in the Z-direction ($2$-direction), forced by the point [0,0,dz]. The bump intensity is specified by the quadratic bump_z function and varies along the X-axis ($0$-axis). The creation of this single bumped strut, oriented along the X-axis is summarized in the next script and depicted in Figure 6.1.


        # a single bumped strut, oriented along the x-axis
        bump_z=lambda x: 1.-(x/nb)**2
        base = Formex(pattern('1')).replic(nb,1.0).bump1
		(2,[0.,0.,dz],bump_z,0)

Figure 6.1: Creation of single bumped strut (c) from a straight (a) and replicated (b) line segment.
 
WireStentDemot2Step01.png WireStentDemot2Step02.png WireStentDemot2Step03.png

The single bumped strut (base) is rescaled homothetically in the XY-plane to size one with the scale()-function. Subsequently, the shear()-functionality generates a new NE Formex by skewing the base Formex in the Y-direction ($1$-direction) with a skew factor of $1$ in the YX-plane. As a result, the Y-coordinates of the base Formex are altered according to the following rule: $y_2 = y_1 + skew * x_1$. Similarly a SE Formex is generated by a shear() operation on a mirrored copy of the base Formex. The base copy, mirrored in the direction of the XY-plane (perpendicular to the $2$-axis), is obtained by the reflect() command. Both Formices are given a different property number by the setProp()-function, visualised by the different color codes in Figure 6.2 This number can be used as an entry in a database, which holds some sort of property. The Formex and the database are two seperate entities, only linked by the property numbers. The rosette()-function creates a unit cell of crossing struts by $2$ rotational replications with an angular step of [180]$\deg$ around the Z-axis (the original Formex is the first of the $2$ replicas). If specified in the constructor, an additional Formex with property $2$ connects the first points of the NE and SE Formices.

        # scale back to size 1.
        base = base.scale([1./nb,1./nb,1.])
        # NE and SE directed struts
        NE = base.shear(1,0,1.)
        SE = base.reflect(2).shear(1,0,-1.)
        NE.setProp(1)
        SE.setProp(3)
        # a unit cell of crossing struts
        cell1 = (NE+SE).rosette(2,180)
        # add a connector between first points of NE and SE
        if connectors:
            cell1 += Formex([[NE[0][0],SE[0][0]]],2)

Figure 6.2: Creation of unit cell of crossing and connected struts (c) from a rescaled (a) and mirrored, skewed (b) bumped strut.
 
WireStentDemot2Step04.png WireStentDemot2Step07.png WireStentDemot2Step09.png