Giter VIP home page Giter VIP logo

Comments (5)

marciot avatar marciot commented on July 17, 2024 1

@snorpey: Thank you for the consideration! No rush on this, but I thought of a possible variant which is slightly more comprehensive.

If it were possible to disable the centering pass on objects but not others, similar to packer.pinCircle(...);, this would give the user even more control.

I think maybe each circle could have flag indicating whether:

  • Whether it is pinned (i.e. a pinned object will never move, but can affect other objects)
  • Whether it will be centered (default) or whether it will only move when overlapping another object

This would give the app developer a lot of control over the behavior of individual objects. In my 3D printing app, I would definitely be able to use the feature to give the user more control over how to arrange objects.

from circlepacker.

marciot avatar marciot commented on July 17, 2024

So I was able to accomplish what I wanted by changing a single character in the code here and it behaved exactly as I had hoped. It seems to work, but I do not know enough to see whether it may have unintended side effects.

if ( typeof message === 'number' && message >= 0 ) {
   circleManager.numberOfCollisionPasses = message;
}

Not sure whether you consider this use case to be significant enough to include in the mainline code.

from circlepacker.

snorpey avatar snorpey commented on July 17, 2024

hey @marciot thank you for your interest in this library and for feature suggestion. I think it's a great idea and will take a closer look once I have a bit more time on my hands. I hope this is OK.
thanks again!

from circlepacker.

snorpey avatar snorpey commented on July 17, 2024

@marciot i just published version 1.1.3. have a look at the setCircleCenterPull() and setCenterPull() methods. let me know if you have any questions. thanks again for your feedback!

from circlepacker.

marciot avatar marciot commented on July 17, 2024

@snorpey: I just added the new library to Symple Slicer and it works great! With the new feature set, I was able to allow the user to select multiple objects to pack to the center. Works great! Thank you for being so responsive!

@marciot i just published version 1.1.3. have a look at the setCircleCenterPull() and setCenterPull() methods. let me know if you have any questions. thanks again for your feedback!

from circlepacker.

Related Issues (8)

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.