Replace old subshape with new subshapes.
(self, old: Shape, *new: Shape)
| 1870 | self.forConstruction = data[1] |
| 1871 | |
| 1872 | def replace(self, old: Shape, *new: Shape) -> Self: |
| 1873 | """ |
| 1874 | Replace old subshape with new subshapes. |
| 1875 | """ |
| 1876 | |
| 1877 | tools: list[Shape] = [] |
| 1878 | |
| 1879 | for el in new: |
| 1880 | if isinstance(el, Compound): |
| 1881 | tools.extend(el) |
| 1882 | else: |
| 1883 | tools.append(el) |
| 1884 | |
| 1885 | bldr = BRepTools_ReShape() |
| 1886 | bldr.Replace(old.wrapped, compound(tools).wrapped) |
| 1887 | |
| 1888 | rv = bldr.Apply(self.wrapped) |
| 1889 | |
| 1890 | return self.__class__(rv) |
| 1891 | |
| 1892 | def remove(self, *subshape: Shape) -> Self: |
| 1893 | """ |