Skip to content

Alternate Shapes to pack rects into? #57

Description

@quitmeyer

Is there a way to pack the rects into a shape that isn't a rectangle?

For instance if i wanted to rectpack, but fill up a circular shape instead?

is this possible?

Activity

  1. findux commented on Feb 11, 2025

    @findux

    You can do this by placing a bounding box of any arbitrary shape. But you have to code it by manuely. At least that's how I did it.

  2. quitmeyer commented on Feb 23, 2025

    @quitmeyer
    Author

    @findux what do you mean you have to code it manually? like you can't use the rectpack library?

  3. findux commented on Feb 23, 2025

    @findux

    Yes, you can do this by coding manually. You create arbitrary polygons with calculated bounding boxes, along with the ID for each polygon (width, height, id) and give it to the packager. After placing, you place the polygon into it according to the IDs of the specific IDs, widths, heights.

  4. quitmeyer commented on Feb 23, 2025

    @quitmeyer
    Author

    ohhh, so the packer can accept an arbitary polygon for a bin instead of just a rectangle? cool!

  5. findux commented on Feb 23, 2025

    @findux

    Yes . but it does not do true shape nesting. If you are looking for something like that. you should look for another tool. This method just nests arbitrary shape polygons as if they were rectangles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions