yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #27297
Re: [Question #700931]: How to colour in the particles in my own specific way (sequence)
Question #700931 on Yade changed:
https://answers.launchpad.net/yade/+question/700931
Status: Needs information => Answered
Bruno Chareyre proposed the following answer:
Hi,
That's how bodies are colored based on their subdomain in the mpi
module, it should apply for anything else with appropriate tuning:
import colorsys
colorScale = [Vector3(colorsys.hsv_to_rgb(value*1.0/numThreads, 1, 1)) for value in range(0, numThreads)]
for b in O.bodies:
b.shape.color = colorScale[b.subdomain]
Bruno
--
You received this question notification because your team yade-users is
an answer contact for Yade.