Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
This one is much faster, as it first calls import felupe as fem
import numpy as np
diameter = 100
radius = 10
height = 25
line = fem.mesh.Line(b=3.5, n=101)
x = diameter / 2 * np.cos(2 * np.pi * line.x)
y = diameter / 2 * np.sin(2 * np.pi * line.x)
z = height * line.x
helix = line.copy(points=np.array([x, y, z]).T)
ax = helix.imshow(line_width=5)
sect = fem.Circle(radius=radius, n=4).expand(n=1)
sect = sect.translate(move=diameter / 2, axis=0)
sect = sect.rotate(90, axis=0)
alpha = np.rad2deg(np.arctan(height / (diameter * np.pi)))
sect = sect.rotate(alpha, axis=0)
sects = [sect.rotate(np.rad2deg(2 * np.pi * phi), axis=2) for phi in line.x]
sects = [s.translate(zi, axis=2) for s, zi in zip(sects, z)]
mesh = sects[0].fill_between(sects[-1], n=len(sects))
mesh.update(points=np.vstack([m.points for m in sects]))
mesh.plot().show() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions