Skip to main content

Questions tagged [packing]

Questions about specific or optimal placement of objects in a shape or volume. For questions about packed arrays, use the [packed-arrays] tag.

Filter by
Sorted by
Tagged with
149 votes
4 answers
26k views

How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with different sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...
István Zachar's user avatar
118 votes
7 answers
14k views

Generating visually pleasing circle packs

EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did. I would like to ...
VividD's user avatar
  • 3,660
46 votes
7 answers
9k views

Efficient way to generate random points with a predefined lower bound on their pairwise Euclidean distance

Using Mathematica what is an efficient way to generate a list of $n$ random two dimensional points $\{x_i,y_i\}$ where $i=1,...,n$ so that no two points $p_1$ and $p_2$ in the list has an Euclidean ...
PlatoManiac's user avatar
  • 14.8k
39 votes
3 answers
3k views

Tiling a square

I wondered if there was a way to automate the process of finding a way to tile a tile into a square. The idea is to represent the tile with a matrix of $0$s for blank space and $1$s for filled spaces ...
Gianpiero Cea's user avatar
30 votes
2 answers
4k views

How can I pack circles of different sizes into a spiral?

Given a list of circles of different areas, I need to arrange them tangentially in order of increasing area and spiraling outward. An example of the type of packing I'm attempting is shown by the ...
M.R.'s user avatar
  • 31.6k
29 votes
2 answers
2k views

Generating Doyle spiral painting

I recently came across an interesting paining by Nicola Sutcliffe: This painting is actually related to Doyle spirals. From author's website: The central part of the picture shows the Doyle ...
VividD's user avatar
  • 3,660
27 votes
4 answers
2k views

Implementing a Beeswarm plot in Mathematica

I am looking for a Beeswarm plot implementation in Mathematica. Consider the following data: ...
Pam's user avatar
  • 1,867
22 votes
2 answers
686 views

Packed Graph or GraphPlot output with non-square layout?

Graph or GraphPlot produce square layouts for disconnected graphs: Graph[Table[i -> Mod[i^3, 100], {i, 1, 100}]] I´d like to get a rectangular layout with e.g....
Yves Klett's user avatar
  • 15.4k
16 votes
1 answer
998 views

Efficiently filling area with disks located at certain points

Starting from a set of points, I want to fill an area using disks. Each disk's center should be one of the points and the disks should not overlap. I've managed to write a function that, given a list ...
einbandi's user avatar
  • 4,024
13 votes
1 answer
2k views

How to generate nonperiodic tilings?

I need to generate nonperiodic tilings which are similar to the attached figure (kite-domino tiling). I was thinking the code is similar to the code for the Penrose tiling. However, that code is too ...
user18735's user avatar
  • 141
13 votes
1 answer
510 views

Rectangle packing, fixed sizes

I have rectangles of a given size to fit into a larger rectangle of a fixed size, with a specified gap between the packed rectangles. I would like to write some code that optimises the number of ...
martin's user avatar
  • 8,738
12 votes
4 answers
8k views

Randomly packing spheres of fixed radius within a cube

How can I have Mathematica randomly place spheres in a cube so they won't overlap? The cube is $20 \times 20 \times 20$, and the spheres have a radius of $0.7$.
Jen's user avatar
  • 161
8 votes
2 answers
2k views

Distribution of 10 points within a unit square

Related to some packing problems, following problem arose: Distribute 10 points within a square of sides 1, so that minimal distance between them is maximized. With the help of random simulation, or ...
VividD's user avatar
  • 3,660
8 votes
1 answer
228 views

Furthest point from nearby objects, packing a sphere on a region interior

Suppose I have a boundary $\partial\Omega$ of a region $\Omega\subset \mathbb{R}^3$ and within this are some compact objects $B_i\subset\Omega$. They could be points, lines, polygons, complex 3D ...
flinty's user avatar
  • 25.5k
7 votes
3 answers
417 views

Embedding non-orthogonal vectors in a vector space

Consider unit vectors $|v_i \rangle$ on an $n$ dimensional vector space, which obey the following relation: $$\langle v_i|v_i \rangle =1 \quad \& \quad |\langle v_i|v_j \rangle| \leq \epsilon, \...
user avatar
6 votes
3 answers
804 views

find the maximum number of not intersecting circles inside an ellipse

$Version "10.3.0 for Linux x86 (64-bit) (October 9, 2015)" (Sequel to 98724 and 99345) (I use codes originally created by Andy Ross, ybeltukov and J.M.). I ...
Dimitris's user avatar
  • 4,824
6 votes
1 answer
3k views

Packing squares into a circle

I am currently trying to solve and understand a problem about packing the maximum of squares into a circle. What I am trying to do, is to calculate the maximum number of variable sized squares (with ...
Alex's user avatar
  • 61
6 votes
1 answer
675 views

cut and project tilings -- Amman Beenker tilings

A certain research paper gives a recipe for building Amman-Beenker tilings as a special type of cut-and-project algorithm. The result is usually a pleasant kind of aperiodic tiling shape. The ...
john mangual's user avatar
3 votes
1 answer
165 views

Arbitrary shape cut into triangles and packed into rectangle of the same area [duplicate]

I've been trying to code this idea in lots of different approaches but I've reached a wall here. Mathematica isn't my strong suit and I've been unable to find a solution to the RegionMeasure error. ...
Jonathan Vardy's user avatar
3 votes
1 answer
272 views

Filling the space with rectangles

Following up on my previous question, I now seek to fill a matrix $m \times n$ with rectangles. Henrik Schumaker had provided some code in his answer to the previous question: ...
ralph's user avatar
  • 1,029
3 votes
1 answer
106 views

Nearest neighbor graph corresponding to 3d sphere packing

I had used ...
RLip2's user avatar
  • 41
3 votes
0 answers
540 views

Wolfram alpha algorithm for geometric packing in 2D [closed]

Is there any way to gain access to the algorithm that wolfram alpha uses? More specifically, I want to pack small circles in hex and square patters in a larger cicle (https://www.wolframalpha.com/...
J Doe's user avatar
  • 31
2 votes
1 answer
299 views

Adjacency Matrix to Clusters of Equal Sizes

I have a system with 72 nodes. I have a binary adjacency matrix $S$ of size $72\times 72$. If $S_{i,j}=1$, then node $i$ is adjacent to node $j$. So, we also have $S_{i,j}=S{j,i}$. So, $S$ is a ...
MGK's user avatar
  • 565
2 votes
0 answers
237 views

Packing triangles into a rectangle

I'm working on packing a set of triangles into a rectangle but I'm unable to get them to pack dense enough or even touch. I found a post from 3 years ago called "Packing arbitrary shapes" ...
Jonathan Vardy's user avatar
2 votes
0 answers
161 views

Dense packing of disks with different radii

Let's consider a disk ($D_{1}$) whose center position is randomly generated, but the radius is fixed at $r_{1}$. A second disk ($D_{2}$) of fixed radius $r_{2}$ (with $r_{2} < r_{1}$) is randomly ...
Tony Ravina's user avatar
1 vote
1 answer
194 views

Octahedra+tetrahedra filling tessellations in 3D

This is called the quasiregular space-filling tessellations in 3D: formed by Octahedra in RED and tetrahedra in YELLOW Are there any smart ways to do a Mathematica figure drawing this?
wonderich's user avatar
  • 923
1 vote
1 answer
491 views

Draw a truncated octahedron packing in 3D

Consider a truncated octahedron composed by 24 vertices (4×6) 14 faces (contain 6 squares and 8 hexagons) 36 edges (4×6+6×82=36). This truncated octahedron can pack and tessellate the 3-dimensional-...
wonderich's user avatar
  • 923
1 vote
1 answer
121 views

Reap unpacks packed arrays

I noticed that Reap unpacks packed arrays. I've looked at previous answers but am still an unsure whether this a serious issue. E.g. consider Ex 47.3 from EIWL: ...
TheDoctor's user avatar
  • 2,850
0 votes
0 answers
155 views

Sphere packing with target volume fraction

I've stumbled upon this sphere packing question, and now I have another related one. How can I have a function that returns a sphere packing with a target volume fraction? Sphere can obviously have ...
senseiwa's user avatar
  • 515
0 votes
0 answers
466 views

How to draw a distribution plot (dotplot?) like this in mathematica? [duplicate]

I believe I've seen this answered already here in Stack Exchange but I could not find it again, so here I am asking, hoping that someone knows this other post I am referring to. Here are examples of ...
Ramiro Magno's user avatar
0 votes
0 answers
37 views

How can I avoid to define public all methods in a package [duplicate]

If I have to code a Package and these package use a lot of functions and variables. In spite of, using in every call of function or variable with namePackage ...
Jonathan Prieto-Cubides's user avatar