Convert a given mesh into a sequence of `.Path` objects. This function is primarily of use to implementers of backends that do not directly support quadmeshes.
(coordinates)
| 2418 | |
| 2419 | @staticmethod |
| 2420 | def _convert_mesh_to_paths(coordinates): |
| 2421 | """ |
| 2422 | Convert a given mesh into a sequence of `.Path` objects. |
| 2423 | |
| 2424 | This function is primarily of use to implementers of backends that do |
| 2425 | not directly support quadmeshes. |
| 2426 | """ |
| 2427 | if isinstance(coordinates, np.ma.MaskedArray): |
| 2428 | c = coordinates.data |
| 2429 | else: |
| 2430 | c = coordinates |
| 2431 | points = np.concatenate([ |
| 2432 | c[:-1, :-1], |
| 2433 | c[:-1, 1:], |
| 2434 | c[1:, 1:], |
| 2435 | c[1:, :-1], |
| 2436 | c[:-1, :-1] |
| 2437 | ], axis=2).reshape((-1, 5, 2)) |
| 2438 | return [mpath.Path(x) for x in points] |
| 2439 | |
| 2440 | def _convert_mesh_to_triangles(self, coordinates): |
| 2441 | """ |
no outgoing calls
no test coverage detected