You could consider adding an option to display all the names defined for the geometry faces (3D) and edges (2D). Furthermore, have a toggle option that would color differently named faces with different colors.
pallete = [
("red", (1.0, 0.0, 0.0)),
("green", (0.0, 0.8, 0.0)),
("blue", (0.0, 0.0, 1.0)),
("yellow", (1.0, 1.0, 0.0)),
#...
]
def visualize_boundaries(mesh, geo):
bnds = list(set(mesh.GetBoundaries()))
shape = geo.shape
tags = {}
for face in shape.faces:
for i, bnd_name in enumerate(bnds):
if face.name == bnd_name:
face.col = pallete[i][1]
color_name = pallete[i][0]
tags[bnd_name] = color_name
break
webgui.Draw(shape)
You could consider adding an option to display all the names defined for the geometry faces (3D) and edges (2D). Furthermore, have a toggle option that would color differently named faces with different colors.
Here is a MWE for 3D that I use with webgui: