Code Monkey home page Code Monkey logo

Comments (5)

tamasmeszaros avatar tamasmeszaros commented on August 16, 2024

What I can do and surely will in the next few weeks, is make the most out of the current "brain" to handle irregular bins. What you can expect is that you can use a simple polygon as a bin and items will be inside of it -- the boundaries will be respected. But the result can be stupid, I probably won't fix that for a while. You can improve that however with a custom optimization kernel which you can pass as a function object to the nest() function.

from libnest2d.

samsonsite1 avatar samsonsite1 commented on August 16, 2024

Thanks for the reply.

It would be very interesting if we could pack shapes to a circle or n-sided poly bin. I didn't have anything complex in mind like a bin with exclusion zones, so simple polygon bins are fine by me.

from libnest2d.

tamasmeszaros avatar tamasmeszaros commented on August 16, 2024

I think that this should be possible even with the current code. Go on and try to define a Circle as the bin shape and pass it to the nest function. The App PrusaSlicer for which this library was initially developed, supports circular print beds and it works. Not as polished as for the box shaped bed though.

from libnest2d.

samsonsite1 avatar samsonsite1 commented on August 16, 2024

Thanks, I tried switching the bin to a Circle, but the compiler can't find a matching overload function for it:

//size_t bins = nest(input, Box( s,s, {0,0} ) );
size_t bins = nest(input, Circle( {0,0}, s ) );

cannot convert from 'libnest2d::_Circlelibnest2d::PointImpl' to 'const libnest2d::Box'
no instance of overloaded function "nest" matches the argument list

from libnest2d.

ItsMeTheBee avatar ItsMeTheBee commented on August 16, 2024

Hey all!
What's the status on irregular nesting?
If using a polygon as bin shape is supported, I'd appreciate it very much if you could post a code snippet.

EDIT: I managed to "activate" circular placement by modifying libnest2d.hpp.
I added a using directive for an NfpPlacer that accepts Circle instead of Box and a defined new nest() function template using the new Placer.
Probably not the best way to do it, but it works :D

from libnest2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.