Construct a polygon (closed polyline) from points.
(*pts: VectorLike)
| 6275 | |
| 6276 | |
| 6277 | def polygon(*pts: VectorLike) -> Wire: |
| 6278 | """ |
| 6279 | Construct a polygon (closed polyline) from points. |
| 6280 | """ |
| 6281 | |
| 6282 | builder = BRepBuilderAPI_MakePolygon() |
| 6283 | |
| 6284 | for p in pts: |
| 6285 | builder.Add(Vector(p).toPnt()) |
| 6286 | |
| 6287 | builder.Close() |
| 6288 | |
| 6289 | return _shape(builder.Wire(), Wire) |
| 6290 | |
| 6291 | |
| 6292 | def rect(w: float, h: float) -> Wire: |