Add a Gouraud triangle shading. Parameters ---------- points : np.ndarray Triangle vertices, shape (n, 3, 2) where n = number of triangles, 3 = vertices, 2 = x, y. colors : np.ndarray Vertex colors, shape (n, 3, 1) or (n,
(self, points, colors)
| 1518 | self.writeObject(self.hatchObject, hatchDict) |
| 1519 | |
| 1520 | def addGouraudTriangles(self, points, colors): |
| 1521 | """ |
| 1522 | Add a Gouraud triangle shading. |
| 1523 | |
| 1524 | Parameters |
| 1525 | ---------- |
| 1526 | points : np.ndarray |
| 1527 | Triangle vertices, shape (n, 3, 2) |
| 1528 | where n = number of triangles, 3 = vertices, 2 = x, y. |
| 1529 | colors : np.ndarray |
| 1530 | Vertex colors, shape (n, 3, 1) or (n, 3, 4) |
| 1531 | as with points, but last dimension is either (gray,) |
| 1532 | or (r, g, b, alpha). |
| 1533 | |
| 1534 | Returns |
| 1535 | ------- |
| 1536 | Name, Reference |
| 1537 | """ |
| 1538 | name = Name('GT%d' % len(self.gouraudTriangles)) |
| 1539 | ob = self.reserveObject(f'Gouraud triangle {name}') |
| 1540 | self.gouraudTriangles.append((name, ob, points, colors)) |
| 1541 | return name, ob |
| 1542 | |
| 1543 | def writeGouraudTriangles(self): |
| 1544 | gouraudDict = dict() |
no test coverage detected