Names and Colors
With more complicated geometries, it is desired to be able to name individual parts of the model.
This can be achieved via name
property.
Naming a shape
pt1 = Point(0, 0, 0)
pt2 = Point(1, 0, 0)
pt3 = Point(0, 1, 0)
triangle = Face(Polygon([pt1, pt2, pt3]).wire())
vec = Vector(0, 0, 1)
solid = triangle.extrude(vec)
solid.name = 'triangle'
To help users to understand the model, color can be assigned to individual parts of the model.
Assign a color
solid.color = colors.light_blue
The following colors are available in figura: