Author Topic: Draw and color triangles/polygons  (Read 160 times)

btyukodi

  • Newbie
  • *
  • Posts: 6
Draw and color triangles/polygons
« on: December 29, 2018, 12:51:12 AM »
Dear users,

I'm trying to accomplish the following in Ovito: I have particles and bonds such that the particles are the vertices, whereas the bonds are the edges of polygons. In this particular case, I have a quasi triangular lattice. Now, I would need to color the polygons/triangles according to some property (local energy density, for example). The closest I got is to use the Coordination Polyhedra modifier to selected particles. The such generated polyhedra, however, all have the same color, I cannot assign a color coding. One workaround could be to only select one particle at a time, get its coordination polyhedra and color them and repeat the process for all the particles. This, however, seems awfully inefficient and it doesn't give me the option to color each triangle separately (it will color all the triangles meeting at the selected particle). Also, the coordination polyhedra looks funny at the edges of the lattice where the coordination number is smaller than 6.

Is there a possibility to just draw and color triangles/polygons on the top of the existing visualization? Or to color each triangle from a SurfaceMeshDisplay separately? If not, what would you recommend?

Thank you,
Botond

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 577
Re: Draw and color triangles/polygons
« Reply #1 on: December 29, 2018, 10:39:54 AM »
Hi Botond,

Where are the data values coming from that you want to use for coloring the triangles? Are they derived from some atomic property of the vertex atoms, or should they be loaded from a separate data file?

-Alex

btyukodi

  • Newbie
  • *
  • Posts: 6
Re: Draw and color triangles/polygons
« Reply #2 on: December 29, 2018, 05:01:23 PM »
Hi Alex,

Thank you for your quick response. I compute the data for coloring in my simulation. It could be, for instance, a local energy density that I dump during the simulation but I need to compute it outside Ovito. Since I wrote my own simulation code, I can choose any file format, but currently I'm using Lammps datafile. So ideally I would like to dump the values for coloring in the Lammps file and use later on to color my triangles. If this doesn't work, I am open to use another format or dump them to a different file.

I'm just about to reply to my other (related) post.
Thank you very much,
Botond