Skip to content

Rotating objects created by polarArray() #1795

Answered by lorenzncode
gridstop asked this question in Q&A
Discussion options

You must be logged in to vote

Is this what you are looking for - control of angle a1 as in this example?:

import cadquery as cq

a1 = -90
shape1 = (
    cq.Workplane().cylinder(10, 20, angle=180).rotate((0, 0, 0), (0, 0, 1), a1).val()
)
res = cq.Workplane("XY").polarArray(100, 0, 360, 6).eachpoint(shape1)

You might also try with Sketch:

import cadquery as cq

a1 = -90
sk1 = cq.Sketch().parray(100, 0, 360, 6).arc((0, 0), 20, a1, 180).close().assemble()
res = cq.Workplane().placeSketch(sk1).extrude(10)

Another way to create the half circle is with free function API:

from cadquery.func import *
from math import pi

c1 = circle(20).trim(0, pi)
s1 = segment((-20, 0, 0), (20, 0, 0))
f1 = face(wire(c1, s1))

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@gridstop
Comment options

@lorenzncode
Comment options

@adam-urbanczyk
Comment options

Answer selected by gridstop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants