Closed roman-dvorak closed 1 month ago
The original implementation didn't have the complete docstring - would you add the following (or with any improvements you can think of) to the pack
function?
"""Pack objects in a squarish area in Plane.XY.
Args:
objects (Collection[Shape]): objects to arrange
padding (float): space between objects
align_z (bool, optional): align shape bottoms to Plane.XY. Defaults to False.
Returns:
Collection[Shape]: rearranged objects
"""
Thanks for the submission!
Thanks for the comment. I added it as you wrote it, I have no problem with it and it is correct. Thanks for the help.
I would also like to expand the documentation because the mention of pack
function is quite hidden in between 'tips'. I would probably look for such information in the 'assemblies' section. So I would do that in a separate page and additional PR. Do you have any suggestions on where to place it in the documentation?
Knowing where folks look for stuff is on of the difficult parts of writing good documentation so if you think you'd look in Assemblies I'm okay with that. Maybe a reference in the 3D exporters section would be helpful as well if the next step is to 3D print their objects?
I've merged the PR - thanks again!
Hi,
I've added a new argument
align_z
to thepack()
method. When you enable this, it aligns all objects to the same Z axis.Motivation and Context
I made this change to help with preparing print plates for 3D printing (set of multiple 3D bodies). The current
pack()
method only arranges objects in the X and Y coordinates. With the newalign_z
option, it becomes much easier to prepare objects for printing without needing to adjust them by a slicer.How Has This Been Tested?
I did some manual testing to make sure the objects align correctly in the Z axis. See following images:
Without
z_align
(default)With
z_align
Thank you!