Construct a face from a wire or edges.
(
self: T,
b: Union[Wire, Iterable[Edge], Shape, T],
angle: Real = 0,
mode: Modes = "a",
tag: Optional[str] = None,
ignore_selection: bool = False,
)
| 188 | |
| 189 | # face construction |
| 190 | def face( |
| 191 | self: T, |
| 192 | b: Union[Wire, Iterable[Edge], Shape, T], |
| 193 | angle: Real = 0, |
| 194 | mode: Modes = "a", |
| 195 | tag: Optional[str] = None, |
| 196 | ignore_selection: bool = False, |
| 197 | ) -> T: |
| 198 | """ |
| 199 | Construct a face from a wire or edges. |
| 200 | """ |
| 201 | |
| 202 | res: Union[Face, Sketch, Compound] |
| 203 | |
| 204 | if isinstance(b, Wire): |
| 205 | res = Face.makeFromWires(b) |
| 206 | elif isinstance(b, Sketch): |
| 207 | res = b |
| 208 | elif isinstance(b, Shape): |
| 209 | res = Compound.makeCompound(b.Faces()) |
| 210 | elif isinstance(b, Iterable): |
| 211 | wires = edgesToWires(tcast(Iterable[Edge], b)) |
| 212 | res = Face.makeFromWires(*(wires[0], wires[1:])) |
| 213 | else: |
| 214 | raise ValueError(f"Unsupported argument {b}") |
| 215 | |
| 216 | if angle != 0: |
| 217 | res = res.moved(Location(Vector(), Vector(0, 0, 1), angle)) |
| 218 | |
| 219 | return self.each(lambda l: res.moved(l), mode, tag, ignore_selection) |
| 220 | |
| 221 | def importDXF( |
| 222 | self: T, |