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 set_name
method.
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 = extrude(triangle, vec)
solid.set_name('triangle')
To help users to understand the model, color can be assigned to individual parts of the model.
Assign a color
solid.set_color(colors.light_blue)
The following colors are available in formo: