Hello,(adsbygoogle = window.adsbygoogle || []).push({});

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!

Best,

Paul

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fitting Spheres in Arbitrary Geometry

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - Fitting Spheres Arbitrary | Date |
---|---|

I Curve Fitting | Nov 14, 2017 |

I The least square method | Aug 9, 2017 |

A Can you generate an image to fit the following features? | Feb 3, 2017 |

B Best fit to data | Sep 22, 2016 |

What is the largest n dimensional box that can fit inside a sphere? | Dec 6, 2012 |

**Physics Forums - The Fusion of Science and Community**