Comments (5)
@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.
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.
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.
@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.
@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()
andsetCenterPull()
methods. let me know if you have any questions. thanks again for your feedback!
from circlepacker.
Related Issues (8)
- Action required: Greenkeeper could not be activated 🚨
- FR: resize to avoid overlap HOT 5
- [Feature Request] Add option to "addCircle" to lock certain circles in place HOT 2
- [Feature Request] Ability to modify circle radius HOT 3
- StopLoop incorrectly updates listeners HOT 1
- Calling setTarget repeatedly causes loop to stop prematurely HOT 3
- Execution environment HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circlepacker.