volume tessellation with spheres
Show older comments
Hey guys,
I have some irregular-shape particles as stl. What I need to do is to fill the volume with regular array of spheres, like cubic array. Having a control on the size of filling spheres (which is the same for all the spheres) will be useful.
Any idea?
7 Comments
Cedric
on 1 Oct 2013
Not an optimal solution, but what about creating an internal buffer whose distance to the initial shape/hull is the radius of the spheres (e.g. with the software which generated the initial STL), immersing the buffer in a regular array of sphere centers, and discarding those which are not inside the buffer?
I give no MATLAB-based way of doing this, but it could start a discussion. The 2D variant based on this approach is rather easy to implement in MATLAB (buffering done with Mapping or FEX function, detection done with INPOLYGON), but extending this to 3D seems quite difficult.
Sean de Wolski
on 1 Oct 2013
Edited: Sean de Wolski
on 1 Oct 2013
inpolyhedron on the FEX will help with this I'll bet. Not sure how yet though. Still wrapping my head around it.
Cedric
on 1 Oct 2013
Well, then it's "just" a question of building an internal buffer. I guess that 3DS Max or equivalent can generate this quite easily (even though I have no experience with these products), but I have no idea how to do it efficiently in MATLAB (I built a 2D algorithm once, but it was already quite slow in 2D).
bob
on 2 Oct 2013
bob
on 3 Oct 2013
No, assume that you've got it, then you build a regular lattice of sphere centers, which is a basic array of 3D coordinates that covers the extent of the particulate. This is easy to do as it is a rectangular volume (framing the original particulate); assuming that you have your STL nodes coordinates in a nx3 array named nodes, you'd do something like
r = .. ; % Spheres radius.
mins = min(nodes) ;
maxs = max(nodes) ;
[X,Y,Z] = ndgrid( mins(1):2*r:maxs(1), ...
mins(2):2*r:maxs(2), ...
mins(3):2*r:maxs(3) ) ;
centers = [X(:),Y(:),Z(:)] ; % If needed, but you might be
% able to work directly with
% X, Y, and Z.
I didn't read the description of the FEX function written by Sven, but assuming that it works on arrays of points and with a non-convex polyhedron, basically the next step is just to submit the internal buffer STL and the array of centers to know which ones define spheres inside the original particulate.
Answers (1)
Sean de Wolski
on 1 Oct 2013
0 votes
The cellphone tower optimization problem solves this as a constrained optimization with circles inside of a square. I would recommend starting with this and modifying it to be three dimensional with irregular boundary constraints.
2 Comments
bob
on 1 Oct 2013
Sean de Wolski
on 1 Oct 2013
Thinking about it some more, I'm not sure this will work with a non-convex shape...
Categories
Find more on STL (STereoLithography) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!