How to make a propeller spin?
Hi, everyone!
I’m building a blender and I meet a question. Please run my code and open the Primary view. We can see that the blender rotates on the central axis. However, I hope the four propellers can rotate on their own while spin with the blender. How could I achieve it ?
Next is my script
import random
import math
from yade import geom, pack, utils, plot, ymport, export
import numpy as np
#particle parameters
Density = 3000
FrictionAngle = 0
PoissonRatio = 0.5
Young = 300e6
Damp = 0.7
AvgRadius1 = 0.02
N_particles1 = 15000
AvgRadius2 = 0.024
N_particles2 = 10000
#Wall constants
WDensity = 3000
WFrictionAngle = 0.0
WPoissonRatio = 0.5
WYoung = 600e7
SphereMat = O.materials.
WallMat = O.materials.
### tank
center = (0, 0, 0.5)
diameter = 1
height = 1
cylinder = geom.facetCylin
O.bodies.
### blender
## bottom beam
totallist=[]
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
## intermediate beam
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
## top beam
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
## pillar
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
## propeller 1
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (0,1,0)
angle = pi/3
box.state.ori = axis,angle
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (0,1,0)
angle = -pi/3
box.state.ori = axis,angle
box.state.pos = (0.16,-0.1,0.75)
boxid = O.bodies.
totallist.
## propeller 2
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (0,1,0)
angle = pi/3
box.state.ori = axis,angle
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (0,1,0)
angle = -pi/3
box.state.ori = axis,angle
box.state.pos = (-0.16,0.1,0.65)
boxid = O.bodies.
totallist.
## propeller 3
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (1,0,0)
angle = -pi/3
box.state.ori = axis,angle
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (1,0,0)
angle = pi/3
box.state.ori = axis,angle
box.state.pos = (0.1,0.16,0.35)
boxid = O.bodies.
totallist.
## propeller 4
box = utils.box(
box.mat=
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (1,0,0)
angle = -pi/3
box.state.ori = axis,angle
boxid = O.bodies.
totallist.
box = utils.box(
box.mat=
axis = (1,0,0)
angle = pi/3
box.state.ori = axis,angle
box.state.pos = (-0.1,-0.16,0.25)
boxid = O.bodies.
totallist.
totalclump = O.bodies.
s1=O.bodies[-1]
s1.state.
O.engines=[
ForceResetter(),
InsertionSo
Interaction
[Ig2_
[Ip2_
[Law2_
),
NewtonIntegr
CombinedKine
]
O.dt=0.
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: