Fitting Spheres into Arbitrary Geometry

Click For Summary
SUMMARY

This discussion focuses on developing a MATLAB script to tightly pack spheres within an arbitrary polyhedral geometry defined by vertex coordinates. The user has successfully implemented a method to eliminate spheres crossing the model boundary but seeks assistance in distinguishing between spheres that are fully contained within the geometry and those that lie outside. A suggested approach involves using the normals of the polytope's faces and their distances from the origin to determine if a sphere is contained within the polytope. The discussion emphasizes the importance of convexity in simplifying the problem.

PREREQUISITES
  • Understanding of MATLAB scripting and programming
  • Knowledge of polyhedral geometry and convex polytopes
  • Familiarity with vector mathematics, including dot products and unit normals
  • Experience with geometric algorithms for spatial packing
NEXT STEPS
  • Research "MATLAB vector operations" for efficient calculations
  • Learn about "convex hull algorithms" to handle non-convex shapes
  • Explore "geometric packing algorithms" for optimizing sphere placement
  • Investigate "face normals and distances" in polyhedral geometry for boundary detection
USEFUL FOR

This discussion is beneficial for MATLAB developers, computational geometry researchers, and anyone involved in 3D modeling or optimization of spatial arrangements within defined geometric boundaries.

pvanderson
Messages
1
Reaction score
0
Hello,

I am constructing a MATLAB script to tightly pack an arbitrary given geometry with spheres of a predefined radius. Coordinates of the vertices of the geometry (a polyhedral model) are given; I am thereby developing an algorithm to plot/track all spheres that fit within the boundaries of the model (defined only by the provided vertex data).

I have successfully tested a script that eliminates all spheres that are "crossing" the model boundary; my difficulty, however, lies within teaching MATLAB how to distinguish spheres that are fully within the boundary from spheres that lie entirely exterior to it. What conditions/techniques could I use to (relatively simply) tell MATLAB not to track a sphere if it lies completely outside of the given vertex/boundary data? I aim to construct a grid of spheres that entirely encompasses the geometry and thereafter have the code systematically eliminate spheres that lie upon or outside of the given vertex/boundary data. Only the spheres lying completely within are plotted/tracked!

I seem to be pulling my hair out over this one. Any assistance would be greatly appreciated!


Paul
 
Physics news on Phys.org
If your polytope is convex, then your job isn't too hard. Assume first that the origin lies in the interior of the polytope. Let F1, ..., Fn be faces of the polytope. Let u1, ..., un be unit normals to the faces, and t1, ... tn be the distance of each face from the origin.

Let r be the radius of a sphere about x. Then the sphere of radius r about x is contained in the polytope if and only if:

ti > (x DOT ui) + r

for each i.

If your polytope is not convex, then it's more complicated.

I'm not sure what exactly you have to work with in terms of information about the polytope, but it will make everything easier if you have it in terms of face normals/distance from the origin.
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 16 ·
Replies
16
Views
1K
  • · Replies 7 ·
Replies
7
Views
7K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 52 ·
2
Replies
52
Views
8K
Replies
24
Views
3K