Small regarding Sweep command

35 views
Skip to first unread message

Adhip

unread,
Feb 1, 2024, 12:49:18 AMFeb 1
to CadQuery
Hello everyone

I created a curve by generating points using some equation. After that, I used sweep command because I wanted to create a rectangular section which follows my curve and creates a curvy rectangular object.

In previous discussions, I have seen sweep command and it's usage but I can't seem to do what I want. I'm attaching images below.

Involute curve.png 
This is the curve generated

involute curve sweep.png
and using the path i wanted to sweep a rectangle section. But instead of that, it is creating rectangle section at every point. 

It will be very helpful if someone can tell what im doing wrong. 
Also attaching code below.

for i in range(m): #Left side
    angle = 0
    xypoints=[]
    x1y1points=[]
    print(f"i: {i}, c: {c}")
    for j in range(c):
        new_ang = angle + start
        x1 = 52 + R * (np.cos(new_ang+alpha) + (angle) * np.sin(new_ang+alpha))
        y1 = 60 + R * (np.sin(new_ang+alpha) - (angle) * np.cos(new_ang+alpha))
        angle += 1 * (np.pi/180)
        x1y1points.append([x1,y1])
    start+=((360/channel) * np.pi/180)#angle increment
    c-= int((360/channel))#points reduction
    plate = cq.Workplane().polyline(x1y1points)

inv_track = cq.Workplane().rect(1.56,1.2, centered=True).sweep(plate)
body=cq.Workplane().box(200,180,2)
final=body.cut(inv_track)

display(plate)
display(inv_track)
display(body)
display(final)


Basically this swept object will be used to make a cut in main body. 

Jeremy Wright

unread,
Feb 7, 2024, 7:43:38 AMFeb 7
to Adhip, CadQuery
Do you have a minimal example that we can run that reproduces the issue?

--
cadquery home: https://github.com/CadQuery/cadquery
post issues at https://github.com/CadQuery/cadquery/issues
run it at home at : https://github.com/CadQuery/CQ-editor
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/3ebfc833-54ef-421c-a396-52e65379c8a8n%40googlegroups.com.

Adhip

unread,
Feb 23, 2024, 2:58:59 AMFeb 23
to CadQuery
Hello

The small code I have mentioned reproduces the issue

Adam Urbanczyk

unread,
Mar 4, 2024, 2:46:57 AMMar 4
to CadQuery
Hi, it does not reproduce, e.g. m is not defined. You really need to share MREs if you want to get help here.
Reply all
Reply to author
Forward
0 new messages