yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #27624
Re: [Question #701566]: Two material
Question #701566 on Yade changed:
https://answers.launchpad.net/yade/+question/701566
Jan Stránský proposed the following answer:
Hello,
> My simulation works with single material
please provide the code
> the difference is the radius and the density.
only?
what about the makeCloud?
> sp_PH101=pack.SpherePack()
> sp_PH101.makeCloud(...)
> sp_PH101.toSimulation(material=matPH101,color=(0,1,1))
> sp_CCS=pack.SpherePack()
> sp_CCS.makeCloud(...)
> sp_CCS.toSimulation(material=matCCS,color=(1,0,1))
Why do you use two SpherePack instances? The you get independent clouds
possibly with overlapping spheres pushing them with non-realistic speed,
possibly causing "flying away".
Try with one SpherePack instance, then spheres are not overlapping.
Something like:
###
sp=pack.SpherePack()
sp.makeCloud(...)
n1 = len(sp)
sp.makeCloud(...)
for i,(c,r) in snumerate(sp):
mat = matPH101 if i < n1 else matCSS
color = (0,1,1) if i < n1 else (1,0,1)
O.bodies.append(sphere(c,r,material=mat,color=color)
###
Cheers
Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.