Add velocity for standard conveyor from tutorial

+1 vote
43 views

Hi,

I started from the standard conveyor example on p78 of the Woo Documentation of Feb 29, 2016 (see below):

In summary, the conveyor code looks like this, in a compact way:
botWd=.3; sideWd=.2; sideHt=.1; x1=2; xDiv=5
import woo; from woo.core import *; from woo.dem import*; import woo.utils; import numpy; import math
S=woo.master.scene=Scene(fields=[DemField()])
xx=numpy.linspace(0,x1,num=xDiv)
pts=[[(x,-.5*botWd-sideWd,sideHt),(x,-.5*botWd,0),(x,.5*botWd,0),(x,.5*botWd+sideWd,sideHt)] for x in xx]
node=Node(pos=(.2,.2,.2),ori=((0,0,1),math.pi/3))
surf=woo.pack.sweptPolylines2gtsSurface(pts,localCoords=node)

Then on p79 it says that:

Note: Motion integration is performed on nodes (page 259), which are usually attached to particles
(page 303). There are also nodes not attached to any particle but used by some engines (e.g. Conveyor);
those nodes, if added S.dem.nodes (usually via S.dem.nodesAppend), will move just the same. This
will be shown below.

I am simply trying to add a velocity to the conveyor surface so that particles dropping onto the conveyor travels at the belt speed. The surface itself will remain in place, but the particles dropping onto it must be accellerated in the direction of the belt. The following extract from my code draws the conveyor profile, but then I can't get from surf2 to a facet/node to which I can add velovity (some examples of my attempts added as comments at the end).

# Conveyor 2 profile
yy1=numpy.linspace(0,y1,num=yDiv)
yy2=numpy.linspace(0,transD,num=yDiv)
pts2=[[(-.5*beltW/1000+(.5*beltW/1000-sideWd-.5*botWd)*y/transD,y-transD,sideHt*y/transD),(-.5*botWd,y-transD,0),(.5*botWd,y-transD,0),(.5*beltW/1000-(.5*beltW/1000-sideWd-.5*botWd)*y/transD,y-transD,sideHt*y/transD)] for y in yy2]
pts2=pts2+[[(-.5*botWd-sideWd,y+beltW/1000,sideHt),(-.5*botWd,y+beltW/1000,0),(.5*botWd,y+beltW/1000,0),(.5*botWd+sideWd,y+beltW/1000,sideHt)] for y in yy1]
node2=Node(pos=(c1x+offS+transD,c1y,c1z+tfH),ori=((0,0,1),-math.pi/2))
surf2=woo.pack.sweptPolylines2gtsSurface(pts2,localCoords=node2)
surf2.angVel=(0,2,0)
#conv2=Facet.make(surf2)
#S.dem.nodesAppend(conv2,surf2)
#conv2.facet.fakeVel(1,0,0)
#surf2.Facet.fakeVel(1,0,0)

There is probably a simple answer, but I can't seem to get the syntax right.

Thanks.

commented May 13, 2016 by (210 points)

Not to worry. I figured facets and fakeVel() out.

Still learning, but improving. :)

ff=woo.pack.gtsSurface2Facets(surf2)
S.dem.par.add(ff)