"""Wire Stent with circle sweeping """ from examples.WireStent import DoubleHelixStent def sweepStent(stent,wirediam): """Sweep a circle of diameter wirediam along the axes of a WireStent The swept """ # Create the section from simple import circle c = circle(20.,0,360) # The default circle has radius 1, diameter 2, scale to wire diameter d c = c.scale(0.5*d) # Turn into a Mesh, and put in the y,z plane c = c.toMesh().swapAxes(0,2) # Get the stent wire axes WA = stent.getWireAxes() # Sweep the circle around each curve # Note that you need to specify the normal on the section! M = [ [ c.sweep(w) for w in wires ] for wires in WA ] return M def run(): """Sweep a circular section along the stent wires.""" clear() smoothwire() stent = DoubleHelixStent(L=40.,De=10.,nx=6,be=30.,d=0.2) M = sweepStent(stent,0.2) draw(M,color=red) if __name__ == 'draw': run() # End