MCPcopy
hub / github.com/CadQuery/cadquery / revolve

Function revolve

cadquery/occ_impl/shapes.py:6939–6966  ·  view source on GitHub ↗

Revolve a shape.

(
    s: Shape,
    p: VectorLike,
    d: VectorLike,
    a: float = 360,
    history: History | None = None,
    name: str | None = None,
)

Source from the content-addressed store, hash-verified

6937
6938
6939def 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
6969def offset(

Callers 1

test_revolveFunction · 0.85

Calls 7

VectorClass · 0.85
_getFunction · 0.85
_update_historyFunction · 0.85
_compound_or_shapeFunction · 0.85
toPntMethod · 0.80
toDirMethod · 0.80
appendMethod · 0.80

Tested by 1

test_revolveFunction · 0.68