Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
generate random size sphere which are randomly located inside a cylinder.
Réponses (2)
21 commentaires

- Each object is locked in place as soon as it is generated. Tentative new positions and sizes are generated for new objects, and if they do not fit there, then that tentative assignment fails and you go on to generate new tentative positions and sizes;
- Each object is locked in place as soon as it is generated. Tentative new positions and sizes are generated for new objects, and if they do not fit there, the program tries to find a different location where an object that size would fit. This tends to get closer to size distribution goals
- Objects are not locked in place. Tentative new positions and sizes are generated throughout the volume for new objects, and if they do not fit there, then the program tries moving existing objects around to make the new one fit, such as by exerting a "force" that tries to move existing objects (and that can push against other objects moving them... but eventually you hit the walls and that pushes back...
- Objects are not locked in place. Tenative new sizes are generated, but the object is "dropped" from the top and allowed to fall, pushing on existing objects, they move, etc., walls get hit, and so on. The advantage of this algorithm is that if there is not enough room to squeeze a new sphere into a lower level, that it just sits on top
- Each object is locked in place as soon as it is generated. Tenative new sizes are generated, but the object is "dropped" from the top and allowed to fall. When it touches something on fewer than 3 contact points beheath it, it can slide or tumble to fill an existing hole, but it never pushes anything out of the way. This algorithm can be easier than continually recalculating how hundreds of existing objects push against each other as room is to be made for a new object
- Objects are not locked in place. A new object is placed on top of an existing object, and then the containing object is "shaken" to see if there is room for it (or other earlier objects) to fall
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asie-Pacifique
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)