Convert self to a list of locations.
(self)
| 1904 | return self.__class__(rv) |
| 1905 | |
| 1906 | def toLocs(self) -> list[Location]: |
| 1907 | """ |
| 1908 | Convert self to a list of locations. |
| 1909 | """ |
| 1910 | |
| 1911 | rv: list[Location] = [] |
| 1912 | t = self.ShapeType() |
| 1913 | |
| 1914 | if t == "Compound": |
| 1915 | for el in self: |
| 1916 | rv.extend(el.toLocs()) |
| 1917 | elif t == "Face": |
| 1918 | u0, u1, v0, v1 = tcast(Face, self).uvBounds() |
| 1919 | rv.append(tcast(Face, self).locationAt((u1 + u0) / 2, (v1 + v0) / 2)) |
| 1920 | elif t == "Edge": |
| 1921 | u0, u1 = tcast(Edge, self).bounds() |
| 1922 | rv.append(tcast(Edge, self).locationAt((u1 + u0) / 2, mode="parameter")) |
| 1923 | else: |
| 1924 | rv.append(Location(self.Center())) |
| 1925 | |
| 1926 | return rv |
| 1927 | |
| 1928 | def filter(self, f: Callable[[Shape], bool]) -> Compound: |
| 1929 |