MCPcopy Create free account

hub / github.com/chinedufn/rectangle-pack / functions

Functions91 in github.com/chinedufn/rectangle-pack

↓ 21 callersMethodpush_rect
Push one or more rectangles # Panics Panics if a `Some(Vec<GroupId>)` passed in but the length is 0, as this is likely a mistake and `None` should b
src/grouped_rects_to_place.rs:74
↓ 15 callersMethoddepth
(&self)
src/rect_to_insert.rs:49
↓ 15 callersMethodheight
(&self)
src/rect_to_insert.rs:45
↓ 15 callersMethodwidth
(&self)
src/rect_to_insert.rs:41
↓ 9 callersFunctionpack_rects
Determine how to fit a set of incoming rectangles (2d or 3d) into a set of target bins. ## Example ``` //! A basic example of packing rectangles int
src/lib.rs:132
↓ 6 callersFunctiontest_splits
( container_dimensions: u32, rect_to_place: WidthHeightDepth, mut expected: [BinSectio
src/bin_section.rs:477
↓ 4 callersFunctionbin_section_width_height_depth
(width: u32, height: u32, depth: u32)
src/bin_section.rs:624
↓ 4 callersFunctionsection_2_3_4
()
src/bin_section/overlaps.rs:65
↓ 4 callersMethodtest
(self)
src/bin_section/overlaps.rs:77
↓ 3 callersMethodpush_available_bin_section
Push a [`BinSection`] to the list of remaining [`BinSection`]'s that rectangles can be placed in. ## Performance This checks that your [`BinSection`
src/target_bin/push_available_bin_section.rs:27
↓ 3 callersMethodtry_place
See if a `LayeredRect` can fit inside of this BinSection. If it can we return the `BinSection`s that would be created by placing the `LayeredRect` in
src/bin_section.rs:154
↓ 2 callersMethodadd_new_sections
When a section is filled it gets split into three new sections. Here we add those. TODO: Ignore sections with a volume of 0
src/target_bin.rs:53
↓ 2 callersMethodall_empty_space_above
(&self, incoming: &RectToInsert)
src/bin_section.rs:277
↓ 2 callersMethodall_empty_space_behind
(&self, incoming: &RectToInsert)
src/bin_section.rs:299
↓ 2 callersMethodall_empty_space_right
(&self, incoming: &RectToInsert)
src/bin_section.rs:288
↓ 2 callersFunctionempty_bin
()
src/target_bin/push_available_bin_section.rs:155
↓ 2 callersMethodempty_space_directly_above
(&self, incoming: &RectToInsert)
src/bin_section.rs:310
↓ 2 callersMethodempty_space_directly_behind
(&self, incoming: &RectToInsert)
src/bin_section.rs:332
↓ 2 callersMethodempty_space_directly_right
(&self, incoming: &RectToInsert)
src/bin_section.rs:321
↓ 2 callersMethodremove_filled_section
Remove the section that was just split by a placed rectangle.
src/target_bin.rs:45
↓ 2 callersFunctionsort_by_size_largest_to_smallest
( items: &mut [BinSection; 3], box_size_heuristic: &BoxSizeHeuristicFn, )
src/lib.rs:322
↓ 1 callersMethodall_empty_space_above_excluding_behind
(&self, incoming: &RectToInsert)
src/bin_section.rs:358
↓ 1 callersMethodall_empty_space_above_excluding_right
(&self, incoming: &RectToInsert)
src/bin_section.rs:345
↓ 1 callersMethodall_empty_space_behind_excluding_above
(&self, incoming: &RectToInsert)
src/bin_section.rs:397
↓ 1 callersMethodall_empty_space_behind_excluding_right
(&self, incoming: &RectToInsert)
src/bin_section.rs:410
↓ 1 callersMethodall_empty_space_right_excluding_above
(&self, incoming: &RectToInsert)
src/bin_section.rs:371
↓ 1 callersMethodall_empty_space_right_excluding_behind
(&self, incoming: &RectToInsert)
src/bin_section.rs:384
↓ 1 callersMethodback
(&self)
src/bin_section/overlaps.rs:19
↓ 1 callersFunctioncan_fit_entire_group_into_bin
TODO: This is duplicative of the code above
src/lib.rs:214
↓ 1 callersMethoddepth_largest_height_second_largest_width_smallest
( &self, incoming: &RectToInsert, )
src/bin_section.rs:266
↓ 1 callersMethoddepth_largest_width_second_largest_height_smallest
( &self, incoming: &RectToInsert, )
src/bin_section.rs:255
↓ 1 callersFunctionfull_bin
()
src/target_bin/push_available_bin_section.rs:159
↓ 1 callersMethodheight_largest_depth_second_largest_width_smallest
( &self, incoming: &RectToInsert, )
src/bin_section.rs:244
↓ 1 callersMethodheight_largest_width_second_largest_depth_smallest
( &self, incoming: &RectToInsert, )
src/bin_section.rs:233
↓ 1 callersMethodincoming_can_fit
(&self, incoming: &RectToInsert)
src/bin_section.rs:196
↓ 1 callersMethodoverlaps
Whether or not two bin sections overlap each other.
src/bin_section/overlaps.rs:5
↓ 1 callersMethodpush_available_bin_section_unchecked
Push a [`BinSection`] to the list of remaining [`BinSection`]'s that rectangles can be placed in, without checking whether or not it is valid. Use [`
src/target_bin/push_available_bin_section.rs:59
↓ 1 callersMethodright
(&self)
src/bin_section/overlaps.rs:11
↓ 1 callersFunctionsort_bins_smallest_to_largest
( bins: &mut Vec<(&BinId, &mut TargetBin)>, box_size_heuristic: &BoxSizeHeuristicFn, )
src/lib.rs:302
↓ 1 callersFunctionsort_groups_largest_to_smallest
( group_id_to_inbound_ids: &mut Vec<(&Group<GroupId, RectToPlaceId>, &Vec<RectToPlaceId>)>, incoming_g
src/lib.rs:329
↓ 1 callersMethodtop
(&self)
src/bin_section/overlaps.rs:15
↓ 1 callersMethodvolume
(&self)
src/width_height_depth.rs:27
↓ 1 callersMethodwidth_largest_depth_second_largest_height_smallest
( &self, incoming: &RectToInsert, )
src/bin_section.rs:222
↓ 1 callersMethodwidth_largest_height_second_largest_depth_smallest
( &self, incoming: &RectToInsert, )
src/bin_section.rs:211
Methodavailable_bin_sections
The free [`BinSection`]s within the [`TargetBin`] that rectangles can still be placed into.
src/target_bin.rs:40
Methodcoalesce_available_sections
Over time as you use [`TargetBin.push_available_bin_section`] to return remove packed rectangles from the [`TargetBin`], you may end up with neighbori
src/target_bin/coalesce.rs:82
Functioncontains_smallest_box
Select the container that has the smallest box. If there is a tie on the smallest boxes, select whichever also has the second smallest box.
src/bin_section.rs:30
Methoddepth
(&self)
src/packed_location.rs:44
Functiondepth_largest_height_second_largest_width_smallest
()
src/bin_section.rs:601
Functiondepth_largest_width_second_largest_height_smallest
()
src/bin_section.rs:581
Functiondeterministic_packing
()
src/lib.rs:797
Functionerror_if_bin_section_out_of_bounds
()
src/target_bin/push_available_bin_section.rs:105
Functionerror_if_bin_section_overlaps_another_remaining_section
()
src/target_bin/push_available_bin_section.rs:121
Functionerror_if_cannot_fit_group
()
src/lib.rs:393
Functionerror_if_placement_is_deeper_than_bin_section
()
src/bin_section.rs:465
Functionerror_if_placement_is_taller_than_bin_section
()
src/bin_section.rs:451
Functionerror_if_placement_is_wider_than_bin_section
()
src/bin_section.rs:437
Functionerror_if_the_rectangles_cannot_fit_into_target_bins
()
src/lib.rs:367
Functionfills_small_sections_before_large_ones
()
src/lib.rs:642
Methodfmt
(&self, f: &mut Formatter<'_>)
src/lib.rs:293
Methodfmt
(&self, f: &mut Formatter<'_>)
src/bin_section.rs:63
Methodfmt
(&self, f: &mut Formatter<'_>)
src/target_bin/push_available_bin_section.rs:80
Functiongroup_id_to_inbound_ids
()
src/grouped_rects_to_place.rs:139
Methodheight
(&self)
src/packed_location.rs:40
Functionheight_largest_depth_second_largest_width_smallest
()
src/bin_section.rs:561
Functionheight_largest_width_second_largest_depth_smallest
()
src/bin_section.rs:541
Functioninbound_id_to_group_ids
()
src/grouped_rects_to_place.rs:161
Methodinto
(self)
src/rect_to_insert.rs:13
Methodnew
# Panics Panics if width, height or depth is 0.
src/width_height_depth.rs:15
Methodnew
Create a new BinSection
src/bin_section.rs:82
Methodnew
(width: u32, height: u32, depth: u32)
src/rect_to_insert.rs:24
Methodnew
(max_width: u32, max_height: u32, max_depth: u32)
src/target_bin.rs:19
Methodnew
Create a new `LayeredRectGroups`
src/grouped_rects_to_place.rs:60
Methodnew_spread
TODO: Delete - just the old API before we had the WidthHeightDepth struct
src/bin_section.rs:87
Functionone_inbound_rect_one_bin
()
src/lib.rs:425
Functionone_inbound_rect_two_bins
()
src/lib.rs:464
Functionoverlaps
()
src/bin_section/overlaps.rs:31
Methodpacked_locations
Indicates where every incoming rectangle was placed
src/lib.rs:277
Functionplaces_largest_rectangles_first
()
src/lib.rs:504
Functionpush_bin_section
()
src/target_bin/push_available_bin_section.rs:143
Functionsaves_bin_sections_for_future_use
()
src/lib.rs:724
Functionstore_the_inbound_rectangle
()
src/grouped_rects_to_place.rs:185
Functiontwo_rects_two_bins
()
src/lib.rs:566
Functionungrouped_rectangles_use_their_inbound_id_as_their_group_id
()
src/grouped_rects_to_place.rs:125
Functionvolume_heuristic
The volume of the box
src/box_size_heuristics.rs:11
Methodwidth
(&self)
src/packed_location.rs:36
Functionwidth_largest_depth_second_largest_height_smallest
()
src/bin_section.rs:521
Functionwidth_largest_height_second_largest_depth_smallest
()
src/bin_section.rs:501
Methodx
(&self)
src/packed_location.rs:24
Methody
(&self)
src/packed_location.rs:28
Methodz
(&self)
src/packed_location.rs:32