# Glitches when assigning colors

**URL:** https://discourse.kitware.com/t/glitches-when-assigning-colors/1643
**Category:** Computational Model Builder (CMB)
**Created:** [November 12, 2025, 10:33am UTC](https://discourse.kitware.com/t/glitches-when-assigning-colors/1643 "2025-11-12T10:33:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@CsatiZoltan](https://discourse.kitware.com/u/CsatiZoltan)
#### Post date: [November 12, 2025, 10:33am UTC](https://discourse.kitware.com/t/glitches-when-assigning-colors/1643/1 "2025-11-12T10:33:21Z")

</div>

I use the operation `smtk::operation::AssignColors` in the _Operations_ panel of CMB to assign colors to selected faces. As demonstrated in the video below on the example data file _data/model/3d/netcdf/pillbox.ncdf_ of SMTK, there are glitches.

Do you have an idea what causes it?

There is no such glitch in other files, such as _data/model/3d/smtk/coarse-knee.smtk_.

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [November 12, 2025, 2:45pm UTC](https://discourse.kitware.com/t/glitches-when-assigning-colors/1643/2 "2025-11-12T14:45:31Z")

</div>

The “glitch” is called z-fighting because there are two meshes colored differently which share the same surface. As OpenGL renders each (overlapping) triangle, some pixels have a green triangle on top and some have a grey triangle on top. Using the visibility controls, you should be able to hide all but one of the overlapping objects.

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@CsatiZoltan](https://discourse.kitware.com/u/CsatiZoltan)
#### Post date: [November 12, 2025, 4:21pm UTC](https://discourse.kitware.com/t/glitches-when-assigning-colors/1643/3 "2025-11-12T16:21:35Z")

</div>

Do they really share a common surface? When I open the model in CMB, `surface 1` and `surface 2` are disjoint. More precisely, they meet in a common edge. How can be there overlapping triangles?

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [November 12, 2025, 5:25pm UTC](https://discourse.kitware.com/t/glitches-when-assigning-colors/1643/4 "2025-11-12T17:25:37Z")

</div>

There is an object representing the volume mesh and several other surface-mesh objects representing the boundaries of the volume mesh (to which boundary conditions are applied). Either hide the volumetric object or the surface objects.

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@CsatiZoltan](https://discourse.kitware.com/u/CsatiZoltan)
#### Post date: [November 12, 2025, 5:27pm UTC](https://discourse.kitware.com/t/glitches-when-assigning-colors/1643/5 "2025-11-12T17:27:48Z")

</div>

I forgot about the volume, thank you. It works fine.
