Ali11H
Ali11H

Reputation: 23

how to control the color of a section in trimesh?

How can I control the color of the section of a trimesh object, as When I do a section and display it the color seems to be missing. for example:

hexagon_with_pores = create_hexagon_with_pores(edge_length, height, pore_radius)
face_colors = np.zeros_like(hexagon_with_pores.faces)
face_colors = [0.7, 0.7, 0.7]
hexagon_with_pores.visual.face_colors = face_colors
scene = trimesh.Scene([hexagon_with_pores])
scene.show()
# Sections
section_top = hexagon_with_pores.section(plane_origin=[0, 0, height/2], plane_normal= 
[0, 0, 1])
section_side = hexagon_with_pores.section(plane_origin=[0, 0, height/2], plane_normal= 
[0, 1, 0])

sections

Basically how can I make the parts around the cylinder appear in colors in the sections like the one above?

Upvotes: 0

Views: 132

Answers (0)

Related Questions