mastrof / bubblebath.jl Goto Github PK
View Code? Open in Web Editor NEWGenerate loose packings of spheres in orthorhombic domains, in 2 and 3 dimensions.
License: MIT License
Generate loose packings of spheres in orthorhombic domains, in 2 and 3 dimensions.
License: MIT License
@JuliaRegistrator register()
Need to implement functions to output .stl meshes.
ConstructiveGeometry.jl kind of works for this but seems not fully maintained, not sure if it's something that can be relied upon.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Cubes should be reasonably easy to implement; also cylinders, disks and parallelepipeds should be feasible.
The interface might need to be review a bit but I don't expect it to be a breaking change.
E.g. non-positive radii, negative or larger-than-1 packing fractions.
In the vein of expanding to more geometrical shapes later on (#11), it might be useful to exploit the geometric primitives from GeometryBasics.jl, instead of writing my own types.
verbose
keyword to bubblebath
and bubblebath!
to turn on/off the info logsThe non in-place bubblebath
BubbleBath.jl/src/bubblebath_algorithm.jl
Lines 77 to 117 in 122832e
bubblebath!
at line 86 after defining the empty spheres
vector, reducing code duplication.
function bubblebath(
radii::Vector{<:Real},
extent::NTuple{D,Real};
min_distance::Real = 0.0,
through_boundaries = false,
max_tries = 10000,
max_fails = 100
)::Vector{Sphere{D}} where D
spheres = Sphere{D}[]
bubblebath!(spheres, radii, extent;
min_distance, through_boundaries, max_tries, max_fails
)
return spheres
end
Implement functions to generate walkmaps, i.e. a BitArray{D}
taking value 0
in the space occupied by spheres, and 1
in free space.
The function should have a signature of the form
walkmap(bath::AbstractVector{Sphere{D}}, resolution::Real, probe_radius::Real=0; boundaries::Symbol=:cut) where D
The resulting walkmap depends on both the resolution
of the mesh and a probe_radius
.
The probe_radius
can be imagined as the radius of a probe that is moving in the bath
; the accessible volume of course depends on the radius.
Finally, the boundaries
keyword can be used to determine what happens in case there are objects crossing through the domain boundaries. There will be two options: :cut
and :wrap
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.