Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
Cloud & Deployment
Core Language & Structure
Data Manipulation & Analysis
Engineering Data & Computation
External Interfaces & Connections
Financial Data & Computation
Geographic Data & Computation
Geometry
Graphs & Networks
Higher Mathematical Computation
Images
Knowledge Representation & Natural Language
Machine Learning
Notebook Documents & Presentation
Scientific and Medical Data & Computation
Social, Cultural & Linguistic Data
Strings & Text
Symbolic & Numeric Computation
System Operation & Setup
Time-Related Computation
User Interface Construction
Visualization & Graphics
Random Paclet
Alphabetical List
Using Paclets
Create a Paclet
Get Started
Download Definition Notebook
Learn More about
Wolfram Language
RectanglePacking
Guides
Rectangle Packing
Symbols
PackRectangles
RectanglePacker
JasonB`RectanglePacking`
R
e
c
t
a
n
g
l
e
P
a
c
k
e
r
R
e
c
t
a
n
g
l
e
P
a
c
k
e
r
[
b
o
u
n
d
i
n
g
b
o
x
]
c
r
e
a
t
e
s
a
m
u
t
a
b
l
e
d
a
t
a
s
t
r
u
c
t
u
r
e
i
n
t
o
w
h
i
c
h
r
e
c
t
a
n
g
l
e
s
c
a
n
b
e
p
a
c
k
e
d
.
R
e
c
t
a
n
g
l
e
P
a
c
k
e
r
[
b
o
u
n
d
i
n
g
b
o
x
,
m
e
t
h
o
d
]
u
s
e
s
t
h
e
g
i
v
e
n
m
e
t
h
o
d
t
o
p
a
c
k
r
e
c
t
a
n
g
l
e
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
Examples
(
1
)
Basic Examples
(
1
)
Create a mutable rectangle packing data structure:
I
n
[
1
]
:
=
r
e
c
t
p
=
R
e
c
t
a
n
g
l
e
P
a
c
k
e
r
[
{
2
0
0
,
1
0
0
}
]
O
u
t
[
1
]
=
R
e
c
t
a
n
g
l
e
P
a
c
k
e
r
D
i
m
e
n
s
i
o
n
s
:
{
2
0
0
,
1
0
0
}
O
c
c
u
p
a
n
c
y
:
0
.
P
a
c
k
e
d
:
0
M
e
t
h
o
d
:
M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