tamasmeszaros / libnest2d

2D irregular bin packaging and nesting library written in modern C++
GNU Lesser General Public License v3.0
312 stars 101 forks source link

Rectangle deformed after shapelike::rotate called with Clipper backend #44

Open shikui08 opened 2 years ago

shikui08 commented 2 years ago

Calling transformedShape on a rectangle item sometimes gives deformed shape. After debugging I find out that shapelike::rotate introduces small error even with X90 degrees rotation.
Change auto cosa = rads.cos(); auto sina = rads.sin(); into auto cosa = int(rads.cos()); auto sina = int(rads.sin());

fix this but it won't work on arbitrary rotation.

I encountered this problem in NfpPlacer, but BottomLeftPlacer works ok.

Is it an issue?