tag:www.mathworks.com,2005:/matlabcentral/fileexchange/feed?q=random+circle+packing MATLAB Central File Exchange icon.png logo.png MATLAB Central - File Exchange - random circle packing User-contributed code library 2021-08-05T00:33:26-04:00 3 1 60 71088 2019-03-31T23:01:15Z 2019-03-31T23:01:15Z Random Circle Packing in a Rectangle With DXF Output This code leverages processing and python circle packing methods in Matlab. DXF output is included for manufacturing.

This code leverages processing and python circle packing methods in Matlab. DXF output is included for manufacturing.

Ryan O'Hara https://www.mathworks.com/matlabcentral/profile/1984042-ryan-o-hara
56601 2016-09-24T09:02:21Z 2016-09-24T09:02:21Z Random close packing (RCP) on arbitrary distribution of circle sizes An algorithm for RCP based on electromagnetic theory

# Input / Outputfunction [NWP,NWR] = pack_v(f) ... outputs positions of circles (NWP) and corresponding radii (NWR) given an input vector (f) of radii size.# Result ExamplePacking result for N=3332 circles, Gamma distributed in size with shape factor 3.81, is shown in result_v1.png# Motivation &amp; TheoryUpdated March 09 2016. This algorithm produces random close packing or RCP on an input of N radii following any arbitrary distribution of size. The script was developed as part of my PhD project, which involves modelling white matter microstructure. White matter bundles in the human brain consist of axons (or hollow cylinders) running uni-directionally. A 2-dimensional cross section of such a cylindrical bundle can be represented by a packing of circles. In human anatomy, axon size follow a Gamma distribution. Conventional software for biophysical modeling (for example, UCL's Camino Diffusion MRI toolkit) generates packing densities up to 65%. However, axon density in white matter regions such as the corpus callosum can reach densities up to 85%, based on literature values.This algorithm is developed with motivation from electromagnetic theory. Given N charged particles, the task cast is to produce the configuration of maximum potential energy by minimizing the sum of distances of the circles - the assumption being that such a configuration is equivalent to or at least close to that of maximum packing density. This is performed iteratively. A pool of N circles is generated. Next, a circle is selected at random without replacement. The placement or position of the selected circle is determined such that its distance to the average center of the circles already placed is minimized. This process is iterated. For small N (~50) algorithm takes ~2 minutes with 8GB of RAM. For large N (~3000), algorithm takes ~10 hours. To confirm the method's robustness on first pass, if the input is circles of uniform size, it converges to hexgonal close packing (HCP).

Ti Xu https://www.mathworks.com/matlabcentral/profile/4891001-ti-xu
33213 2011-10-10T17:47:18Z 2011-10-10T17:47:18Z Growbubbles - maximum radius packing Growbubbles takes centroid points and returns the maximum radius circles or spheres without overlap

%GROWBUBBLES packs maximum radius circles at given central locations%% PTRADS = GROWBUBBLES(PTS) returns the radius of circles at coordinates in PTS with all radii% maximised but without any circles overlapping. PTS is a P-by-N matrix of P "N-dimensional"% points.%% If no output argument is given, PTSIN will be plotted as circles (2D) or spheres (3D) to the% current figure.%% Example:%% % Find the maximum packed radius of 20 random points% x = rand(20, 2);% ptRads = growbubbles(x);

Sven https://www.mathworks.com/matlabcentral/profile/1672378-sven