CadQuery / CadQuery/cadquery

Rotate workplane during 2d drawing or combine 2 2d drawings to one

Open
#1,493 7 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

Hello, I want to start drawing polyline, then make rotation around current point staying on the same plane and then continue drawing in new rotated coordinate system. Or draw polyline in 1-st coordinate system, then draw another polyline in the 2-nd rotated coordinate system and then combine both polylines to one.

What I want to achieve - is effect of bending polyline at some point by configurable angle. I have coordinates of all points in unbended state, but it would be quite hard to calc them manually to make bending rotation.

I am trying to do something like that with rotateAboutCenter or workplane.transformed calls, but either get errors or no result:
~~~python
_plate = (
cq.Workplane("XY")
.lineTo(contact_base_width/2, 0)
.center(contact_base_width/2, 0)
#.rotateAboutCenter(axisEndPoint=(0, 0, 10), angleDegrees=30)
#.workplane().transformed(rotate=(0, 0, 30))
.lineTo(-contact_base_width/2 + contact_plate_width/2/2, 0)
.lineTo(-contact_base_width/2 + contact_plate_width/2-1, 1)
.lineTo(-contact_base_width/2 + contact_plate_width/2, 1)
.lineTo(-contact_base_width/2 + contact_plate_width/2, 4)
.lineTo(-contact_base_width/2, 4)
.center(-contact_base_width/2, 0)
.mirrorY()
.extrude(10)
)
~~~
thank's

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.