CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.25k stars 294 forks source link

`eachpoint(..., useLocalCoordinates=False)` manipulates the point's location when it shouldn't #1099

Open greyltc opened 2 years ago

greyltc commented 2 years ago

Here's what the docs say eachpoint() should do: https://github.com/CadQuery/cadquery/blob/a5fadebe72b2a46881c3847cca748b8cf716ccd0/cadquery/cq.py#L2440-L2441

When each() is called with useLocalCoordinates=False, it does no manipulation of the object before passing it on to the callback function: https://github.com/CadQuery/cadquery/blob/a5fadebe72b2a46881c3847cca748b8cf716ccd0/cadquery/cq.py#L2423

but when eachpoint() is called with useLocalCoordinates=False, it manipulates/transforms (p * loc) the object's location before passing it on to the callback function: https://github.com/CadQuery/cadquery/blob/a5fadebe72b2a46881c3847cca748b8cf716ccd0/cadquery/cq.py#L2479

I guess it probably shouldn't do that.

greyltc commented 2 years ago

https://github.com/CadQuery/cadquery/pull/1100 should bring the code in line with how I interpret the docs.