cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Centering doesn't take direction (`direct=`) into account

Open Equidamoid opened this issue 3 years ago • 2 comments

The centering code always assumes no direction is specified (e.g. to center a cylinder, you translate it by (r, r, -h/2)). For example, cq.Workplane().cylinder(10, 10, (1, 0, 0)) will create a cylinder with axis going from (0, 0, 5) to (0, 10, 5).

Since proper direction handling is a bit tricky, how about at least throwing NotImplementedError if centering is requested when direction is not (0, 0, 1)? This will at least save users some headache debugging suddenly shifted parts (speaking form experience).

Equidamoid avatar Feb 05 '22 17:02 Equidamoid

I'm very new to cadquery, but I think I also ran into this issue.

sensille avatar May 14 '23 10:05 sensille