Loading the stored the position of plank, but it wrong
Dear friend:
It is me again. Sorry. The new problem.
I design five plank(window), and they rotates around a axis. So I storage the position of them, and hope display the rotation process of them, but the reload location is wrong.
# (1) Define the plank:
temp = [
]
Wind1 = pack.sweptPolyl
Wind2 = pack.sweptPolyl
Wind3 = pack.sweptPolyl
Wind4 = pack.sweptPolyl
Wind5 = pack.sweptPolyl
WindList = IDWind1 + IDWind2 +IDWind3 + IDWind4 + IDWind5
# (2) Rotation the plank(window) in the O.engines
RotationEng
RotationEng
RotationEng
RotationEng
RotationEng
# (3) Control the speed and direction of the windows
def WindowsAction(
global WinAction, windPosition
RotationW = [RotationW1, RotationW2, RotationW3, RotationW4, RotationW5]
for nW in range(0, numWinds):
## action
Pos_z = sum(O.bodies[
if WinAction[nW] == 0:
else:
NegtiveStop = (RotationW[
PostiveStop = (RotationW[
if NegtiveStop: windPosition[nW] = windPositionNeg
elif PostiveStop: windPosition[nW] = windPositionPos
else: windPosition[nW] = 0
if NegtiveStop | PostiveStop:
# (4) save the location of windows
def SaveProcessLoca
global WindList
outputDir = "Output/location/"
if not os.path.
PositonWind = []
for i in WindList:
temp = [i, o.bodies[
wind_name = outputDir + 'wind_' + str(Episode) + '_' + str(iter)
np.
#(5) display the location of the windows
def Relocation():
global nEpisode, nIter, index
path = 'Output/location/'
wind_name = path + 'wind_' + str(nEpisode) + '_' + str(nIter) + '.npy'
if nIter >= index[nEpisode, 1]:
nIter = 0
nEpisode += 1
else:
nIter += 1
if nEpisode >= len(index):
O.pause()
locationWind = np.load(wind_name, allow_pickle=True)
for i in range(0, len(locationWind)):
n = locationWind[i][0]
Problem: the each window constitute of 2 triangle. So if reload the location, the 2 triangles comes off. and the rotation angle does not look right.
Thank you very much
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask yang yi for more information if necessary.