Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/damoonrashidi/generative-art
/ functions
Functions
159 in github.com/damoonrashidi/generative-art
⨍
Functions
159
◇
Types & classes
32
↓ 12 callers
Method
add_shape
Add a new shape to the group
src/svg/group.rs:114
↓ 11 callers
Method
insert
Insert a new shape into the grid
src/shapes/pointmap.rs:44
↓ 10 callers
Method
contains
(&self, point: &Point)
src/shapes/blob.rs:95
↓ 10 callers
Method
x_range
Returns a range that starts at the x position of the rectangle and ends on the right side of the rectangle.
src/shapes/rectangle.rs:90
↓ 9 callers
Method
center
(&self)
src/shapes/blob.rs:100
↓ 9 callers
Method
set_new_image
(&mut self)
src/paintings/forces/ui.rs:24
↓ 9 callers
Method
set_new_svg
(&mut self)
src/paintings/wildlands/ui.rs:47
↓ 9 callers
Method
y_range
Returns a range that starts at teh y position of the rectangle and ends at the bottom of the rectangle.
src/shapes/rectangle.rs:96
↓ 7 callers
Method
distance_to
Calculates the distance between this point and other Example ``` use generative_art::shapes::point::Point; let a = Point(0.0, 0.0);
src/shapes/point.rs:31
↓ 7 callers
Method
scale
Scale a circle by a factor of [`scale`]. The radius remains unchanged.
src/shapes/circle.rs:67
↓ 7 callers
Method
set_color
Set the fill color of the circle
src/shapes/circle.rs:62
↓ 5 callers
Method
get_neighbors
Get all neighboring items that are close to the given shape. An optional distance parameter can be supplied to limit the results to all items to b
src/shapes/pointmap.rs:81
↓ 5 callers
Method
save
Save the SVG document to disk. Optionally a configuration string can be passed, which will be appended as an SVG comment in the file, to be able to re
src/svg/document.rs:73
↓ 4 callers
Method
set_new_svg
(&mut self)
src/paintings/piet/ui.rs:42
↓ 3 callers
Method
angle_to
The angle between two given points.
src/shapes/point.rs:50
↓ 3 callers
Method
bounding_box
(&self)
src/shapes/path.rs:157
↓ 3 callers
Method
get_index
Find out what cell a given point is located in.
src/shapes/pointmap.rs:141
↓ 3 callers
Method
get_random_color
(&self)
src/palette/simple_palette.rs:36
↓ 3 callers
Function
map
Map a value from one range to a corresponding value in another range Example ``` use generative_art::transforms::map::map; let value = map(10.0, 0.0
src/transforms/map.rs:15
↓ 3 callers
Method
remove
Remove a shape from the grid
src/shapes/pointmap.rs:58
↓ 2 callers
Method
area
Surface area of the rectangle.
src/shapes/rectangle.rs:84
↓ 2 callers
Method
as_svg
Get the entire SVG string of the group
src/svg/group.rs:119
↓ 2 callers
Method
distance
Calculates the distance between this blob and another given blob
src/shapes/blob.rs:68
↓ 2 callers
Function
forces
(config: Rc<&ForcesConfig>)
src/paintings/forces/algo.rs:21
↓ 2 callers
Function
gen_weighted
Genarate a value inside a range, weighted towards the beginning of the range Basic example ``` use generative_art::transforms::gen_weighted::gen_weig
src/transforms/gen_weighted.rs:19
↓ 2 callers
Method
generate
(&self)
src/paintings/grid/ui.rs:37
↓ 2 callers
Function
generate_grid
(config: Arc<GridConfig>)
src/paintings/grid/algo.rs:13
↓ 2 callers
Method
get_color
(&self, point: &Point)
src/palette/regional_palette.rs:62
↓ 2 callers
Method
get_items
Get all items from the grid
src/shapes/pointmap.rs:72
↓ 2 callers
Method
get_neighboring_cells
Get all the surrounding cells for a given cell index. This is useful when considering that shapes can spill over the edges of a cell, i.e, if a large
src/shapes/pointmap.rs:154
↓ 2 callers
Method
get_random_choice
(&self)
src/transforms/gen_weighted.rs:39
↓ 2 callers
Method
get_random_color
(&self)
src/palette/regional_palette.rs:71
↓ 2 callers
Method
length
The total distance between each point in this shape, i.e, the true length of the shape.
src/shapes/path.rs:75
↓ 2 callers
Method
offset
Creates a new point at the given point but with the x position offset by x, and same for y.
src/shapes/point.rs:39
↓ 2 callers
Function
piet
(config: Rc<&PietConfig>)
src/paintings/piet/algo.rs:16
↓ 2 callers
Method
scale
Scale a rectangle by a factor of the scale parameter. The rectangle will scale from the origo, meaning new rectangle that will be returned will be mov
src/shapes/rectangle.rs:69
↓ 2 callers
Method
subdivide
( &self, split_point: &Point, split_direction: SplitDirection, padding: Option
src/shapes/rectangle.rs:116
↓ 2 callers
Function
wildlands
(config: &WildlandsConfig)
src/paintings/wildlands/algo.rs:13
↓ 1 callers
Method
add_group
Add a group to the document. Groups can hold other shapes but share styles between the shapes. Nice to have to keep the final svg file size down if th
src/svg/document.rs:67
↓ 1 callers
Method
add_point
Adds another [`Point`] to the end of this path. This is good if You want to make a line longer.
src/shapes/path.rs:44
↓ 1 callers
Method
between
Create a new point on the line between the two given points with an offset between [0..1], where 0 is at the first point and 1 is at the last point an
src/shapes/point.rs:56
↓ 1 callers
Method
center
(&self)
src/shapes/circle.rs:89
↓ 1 callers
Method
center
(&self)
src/shapes/path.rs:149
↓ 1 callers
Method
distance
Calculate the distance between this circle and another circle. The distance will be calculated based on the edges of the circles, not the center. ```
src/shapes/circle.rs:45
↓ 1 callers
Method
eq
A blob is considered equal to another if the shapes are the same size and positioned at the same point. */
src/shapes/blob.rs:38
↓ 1 callers
Method
generate
(&self)
src/paintings/wildlands/ui.rs:42
↓ 1 callers
Method
generate
(&self)
src/paintings/piet/ui.rs:37
↓ 1 callers
Function
generate_nightfall
(config: Rc<&NightfallConfig>)
src/paintings/nightfall/algo.rs:20
↓ 1 callers
Function
get_dot_count
(rect: &Rectangle, render_height: f64, max_count: usize)
src/paintings/grid/algo.rs:84
↓ 1 callers
Method
intersects
True if a given intersects another circle, otherwise false.
src/shapes/circle.rs:52
↓ 1 callers
Method
set_new_svg
(&mut self)
src/paintings/grid/ui.rs:43
↓ 1 callers
Function
split_line
(line: Vec<Point>, use_gap: bool)
src/paintings/forces/algo.rs:122
↓ 1 callers
Method
to_path
Converts this rectangle to a [`Path`]. Useful for path wobbling.
src/shapes/rectangle.rs:101
Method
add_shape
Add a shape to the SVG document
src/svg/document.rs:61
Method
as_svg
(&self)
src/shapes/circle.rs:77
Method
as_svg
(&self)
src/shapes/blob.rs:74
Method
as_svg
(&self)
src/shapes/point.rs:71
Method
as_svg
(&self)
src/shapes/rectangle.rs:172
Method
as_svg
(&self)
src/shapes/path.rs:102
Method
bounding_box
(&self)
src/shapes/circle.rs:93
Method
bounding_box
(&self)
src/shapes/blob.rs:104
Method
bounding_box
(&self)
src/shapes/point.rs:79
Method
bounding_box
(&self)
src/shapes/rectangle.rs:195
Method
center
(&self)
src/shapes/point.rs:75
Method
center
(&self)
src/shapes/rectangle.rs:188
Method
contains
(&self, point: &Point)
src/shapes/circle.rs:102
Method
contains
(&self, point: &Point)
src/shapes/point.rs:88
Method
contains
(&self, point: &Point)
src/shapes/rectangle.rs:184
Method
contains
How this works: it starts by getting the bounding box for the polygon. After which it creates four search rays from the point out in each directio
src/shapes/path.rs:215
Function
create_new_regional_palette
()
src/palette/regional_palette.rs:85
Method
default
()
src/shapes/circle.rs:126
Method
default
()
src/shapes/blob.rs:111
Method
default
()
src/shapes/rectangle.rs:206
Method
default
()
src/paintings/wildlands/ui.rs:18
Method
default
()
src/paintings/grid/ui.rs:20
Method
default
()
src/paintings/piet/ui.rs:18
Method
default
()
src/paintings/forces/config.rs:14
Method
default
()
src/paintings/forces/ui.rs:63
Function
distance
()
src/shapes/point.rs:98
Function
does_intersect
()
src/shapes/path.rs:283
Function
does_not_contain
()
src/shapes/rectangle.rs:239
Method
eq
(&self, other: &Self)
src/shapes/circle.rs:108
Method
eq
(&self, other: &Self)
src/shapes/rectangle.rs:217
Function
equality
()
src/shapes/point.rs:113
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/shapes/circle.rs:116
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/shapes/point.rs:65
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/shapes/rectangle.rs:226
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/palette/color.rs:32
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/palette/regional_palette.rs:17
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/paintings/wildlands/ui.rs:12
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/paintings/grid/ui.rs:14
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/paintings/nightfall/config.rs:14
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/paintings/piet/ui.rs:12
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/paintings/forces/config.rs:110
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/paintings/forces/ui.rs:18
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/svg/group.rs:22
Method
from
(config: GridConfig)
src/paintings/grid/config.rs:22
Method
from
(confiig: NightfallConfig)
src/paintings/nightfall/config.rs:71
Method
from
(val: PietConfig)
src/paintings/piet/config.rs:26
Method
from_region
(bounds: Rectangle, rounds: u8, palette: Box<dyn Palette>)
src/palette/regional_palette.rs:29
next →
1–100 of 159, ranked by callers