View source: R/grain_packing.R
random_packing | R Documentation |
Creates a random plot of particles
random_packing( porosity = 0.3, dmax = 0.4, dmin = 0.02, width = 1, height = 1, clip = TRUE, nc = 91, npos = 100^2, npar = 1000, fill_soil = "#d3bc5f", color_soil = "#65571d", size_soil = 0.5, size_border = 1 )
porosity |
target porosity (fraction) |
dmax |
maximum particle diameter |
dmin |
minimum particle diameter |
width |
soil element width |
height |
soil element height |
clip |
if 'TRUE', particles partially sticking out of sample are cropped to the soil element |
nc |
number of points on each particle circle |
npos |
max number of grid positions to choose from |
npar |
max number of particles |
fill_soil |
color of fill of soil cube |
color_soil |
color of outline of soil cube |
size_soil |
thickness of particle border |
size_border |
thickness of soil element border |
a ggplot object
#loose sample random_packing(porosity = 0.35) #dense sample random_packing(porosity = 0.15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.