Revolve a shape.
(
s: Shape,
p: VectorLike,
d: VectorLike,
a: float = 360,
history: History | None = None,
name: str | None = None,
)
| 6937 | |
| 6938 | |
| 6939 | def revolve( |
| 6940 | s: Shape, |
| 6941 | p: VectorLike, |
| 6942 | d: VectorLike, |
| 6943 | a: float = 360, |
| 6944 | history: History | None = None, |
| 6945 | name: str | None = None, |
| 6946 | ) -> Shape: |
| 6947 | """ |
| 6948 | Revolve a shape. |
| 6949 | """ |
| 6950 | |
| 6951 | results = [] |
| 6952 | builders = [] |
| 6953 | |
| 6954 | ax = gp_Ax1(Vector(p).toPnt(), Vector(d).toDir()) |
| 6955 | |
| 6956 | for el in _get(s, ("Vertex", "Edge", "Wire", "Face")): |
| 6957 | |
| 6958 | builder = BRepPrimAPI_MakeRevol(el.wrapped, ax, radians(a)) |
| 6959 | builder.Build() |
| 6960 | |
| 6961 | results.append(builder.Shape()) |
| 6962 | builders.append(builder) |
| 6963 | |
| 6964 | _update_history(history, name, [s], *builders) |
| 6965 | |
| 6966 | return _compound_or_shape(results) |
| 6967 | |
| 6968 | |
| 6969 | def offset( |