Irregular rock three-dimensional packing optimization method based on partial random key genetic algorithm

By optimizing the 3D binning of irregular rock samples using a partially random key genetic algorithm, the problem of the inapplicability of traditional algorithms is solved, and efficient and stable rock sample binning is achieved, thereby improving the utilization of container space.

CN115470695BActive Publication Date: 2026-06-26BEIJING INST OF CONTROL ENG

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INST OF CONTROL ENG
Filing Date
2022-08-19
Publication Date
2026-06-26

Smart Images

  • Figure CN115470695B_ABST
    Figure CN115470695B_ABST
Patent Text Reader

Abstract

The application discloses an irregular rock three-dimensional packing optimization method based on a partial random key genetic algorithm, and relates to the technical field of packing optimization, and particularly relates to a method for packing irregular rocks in a limited container. The method comprises the following steps: visual sampling and three-dimensional reconstruction are performed on rock samples; a grid model is processed; the partial random key genetic algorithm is initialized to generate an initial population; a collision model of a container and an OBB (Oriented Bounding Box) is established, and the position and posture of the container and the OBB are set; a collision model of each OBB corresponding to the rock sample is established, and the position and posture of the OBB are set; gravity and friction are added, and the container space occupancy rate is calculated as the fitness of an individual; the population individuals are divided into two categories, i.e., elite individuals and general individuals, according to the fitness, the population is subjected to copying, crossing and mutation operations according to the partial random key genetic algorithm, and a next generation population is generated; the operation is repeatedly performed, and when a termination condition is met, the maximum fitness individual is decoded to output the final position and posture of each rock sample after packing as a final packing scheme. The application can realize maximum packing of irregular rocks in a limited container.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of manufacturing and transportation industries regarding the packing problem of irregular objects, and particularly relates to an optimization method and system for three-dimensional packing of irregular rocks based on a partially random key genetic algorithm, which is applicable to logistics packing, autonomous extraterrestrial object sampling, etc. Background Technology

[0002] In missions to explore extraterrestrial objects, it is impossible for extraterrestrial probes to carry complete experimental analysis equipment. Therefore, the only way is to collect rocks from or beneath the surface of the celestial body, put them in containers, and bring them back to Earth by a return capsule for analysis and research. This is an important means of studying the resources, environment, and material composition of celestial bodies.

[0003] Due to technological and cost limitations, the storage space of detector containers is very limited, but there is often a requirement to collect as many samples or minerals as possible in a single operation. The size and shape of celestial rock samples vary greatly and are highly irregular, making the optimization of placement for extraterrestrial object sampling extremely challenging. Currently, there is little research on the three-dimensional placement optimization of irregularly shaped objects like rocks obtained from extraterrestrial object sampling, and traditional bin packing optimization algorithms for regular three-dimensional objects are no longer directly applicable to this problem.

[0004] In summary, a method for three-dimensional packing of irregular rocks is needed, based on an optimization algorithm, to maximize the packing of irregular rocks within a finite container. Summary of the Invention

[0005] The technical problem solved by this invention is to overcome the shortcomings of the prior art and provide a method and system for optimizing the packing of irregular rocks obtained from extraterrestrial sampling, so as to maximize the packing of irregular rocks in a limited container.

[0006] The technical solution of this invention is:

[0007] An optimization method for 3D packing of irregular rocks based on a partially random key genetic algorithm includes:

[0008] Step 1: Perform visual sampling and 3D reconstruction on each rock sample to obtain a mesh model of each rock sample;

[0009] Step 2: Process the mesh model of each rock sample so that its minimum directed bounding box OBB coincides with the axis-aligned bounding box AABB, that is, the minimum directed bounding box OBB is parallel to the coordinate axis of the mesh model and coincides with the coordinate origin.

[0010] Step 3: Initialize the partially random key genetic algorithm and encode individuals to generate the first generation population;

[0011] Step 4: In pybullet, build a collision model of the container and OBB bounding boxes, decode the genes of each individual, and pack each OBB bounding box according to the boxing order and direction obtained after decoding, and output the position and orientation of each bounding box; after gene decoding, detect the extreme point that is farthest from the front right corner of the OBB bounding box after trying to place it in 6 directions, and take the extreme point as the placement position.

[0012] Step 5: In pybullet, create a collision model for the rock sample corresponding to each OBB bounding box, and set its position and orientation to the position and orientation of the OBB bounding box in step 4.

[0013] Step 6: Add gravity and friction in pybullet. The collision model of the rock sample begins to fall under the action of gravity, making the bins more compact. After each collision model stabilizes, calculate the container space occupancy as the fitness of the individual.

[0014] Step 7: Divide the population into elite individuals and general individuals according to their fitness. Perform replication, crossover and mutation operations on the population according to the partial random key genetic algorithm to generate the next generation population.

[0015] Step 8: Repeat steps 4 to 7. When the termination condition is met, output the final position and orientation of each rock sample after decoding and binning the individual with the maximum fitness, as the final binning scheme, and terminate the calculation.

[0016] Furthermore, in the unprocessed rock sample mesh model, the AABB bounding box and the OBB bounding box do not coincide, while in the processed rock sample mesh model, the OBB bounding box and the AABB bounding box coincide.

[0017] Furthermore, step 2 processes the mesh models of each rock sample to make their minimum directed bounding box (OBB) coincide with the axis-aligned bounding box (AABB). Specifically, Open3D is used to process the mesh models of each rock sample to obtain the minimum directed bounding box (OBB) of each mesh model, and the center (OBB.center), size (OBB.extent), and rotation matrix (OBB.R) of the bounding box are obtained. Then, the mesh model is translated and rotated. After processing, a new mesh model (STL_New) and a new minimum directed bounding box (OBB_New) are generated. The bounding box (OBB_New) obtained in this way is parallel to the coordinate axes of the mesh model (STL_New) and coincides with the origin of the coordinates.

[0018] Furthermore, initializing the partially random key genetic algorithm includes setting the number of generations (num_generations), the number of times to wait for the same fitness (patient), the number of individuals in the population (num_individuals), the number of elite individuals (num_elites), the number of mutated individuals (num_mutants), and the elite selection probability (eliteCProb).

[0019] Furthermore, the individuals are encoded as follows: If there are N rock samples to be packed, each individual contains 2N genes. The first N genes represent the packing order, and the last N genes represent the packing direction. N random keys are generated corresponding to each item to be packed, arranged in ascending order to obtain the packing order, which is used as the first N genes. N random keys are also generated corresponding to each item to be packed, which is used as the last N genes. Each OBB bounding box to be packed has six packing directions. The value of its random key is multiplied by 6 and rounded forward to obtain the packing direction of the current bounding box.

[0020] Furthermore, the container space occupancy rate mentioned in step 6 refers to the ratio of the total volume Vobj of the placed model to the container space volume occupied below the highest point Zmax of the placed model. The formula for calculating the container space occupancy rate is as follows:

[0021] Rate = Vobj / (Zmax * L * W)

[0022] Where Rate is the container space occupancy rate, Vobj is the total volume of the placed model, Zmax is the highest point of the placed model, L is the length of the container bottom surface, and W is the width of the container bottom surface.

[0023] Furthermore, step 7 divides the population into elite individuals and general individuals based on their fitness, and performs replication, crossover, and mutation operations on the population using a partially random key genetic algorithm to generate the next generation population. Specifically:

[0024] Individuals in each generation are sorted in descending order of fitness, with the first num_elites being elite individuals and the remaining individuals being general individuals. Elite individuals are directly copied into the next generation to ensure that the quality of the solution is continuously improved during the evolutionary process. For the crossover operation, one individual comes from an elite individual, and the other is randomly generated from all individuals. The crossover probability is eliteCProb, meaning that the offspring individual receives the gene from the parent elite individual with a probability of eliteCProb and receives the gene from the parent general individual with a probability of (1-eliteCProb). The mutation operation generates num_mutants new individuals using a random method.

[0025] Furthermore, the termination condition described in step 8 is reaching the number of evolutionary generations num_generations, or the fitness no longer changing after consecutive patient cycles.

[0026] Furthermore, this invention proposes a three-dimensional packing optimization system for irregular rocks, comprising:

[0027] Mesh model acquisition and processing module: Visual sampling and 3D reconstruction are performed on each rock sample to obtain the mesh model of each rock sample; the mesh model of each rock sample is processed to make its minimum directed bounding box OBB coincide with the axis-aligned bounding box AABB, that is, the minimum directed bounding box OBB is parallel to the coordinate axis of the mesh model and coincides with the coordinate origin.

[0028] Algorithm initialization module: Initializes the partially random key genetic algorithm and encodes individuals to generate the initial population;

[0029] Collision Model Building Module: In PyBulllet, collision models of containers and OBB bounding boxes are built, and the genes of each individual are decoded. Based on the binning order and orientation obtained after decoding, each OBB bounding box is binned, and the position and orientation of each bounding box are output. After gene decoding, the extreme point furthest from the front right corner of the OBB bounding box to the front right corner of the container after attempting placement in six directions is taken as the placement position. In PyBulllet, collision models of rock samples corresponding to each OBB bounding box are built, and their positions and orientations are set to the positions and orientations of the OBB bounding boxes in step 4. Gravity and friction are added to PyBulllet, and the collision models of the rock samples begin to fall under the action of gravity, making the binning more compact. After each collision model stabilizes, the container space occupancy rate is calculated as the fitness of the individual.

[0030] Population generation and processing module: Based on fitness, individuals in the population are divided into elite individuals and general individuals. The population is then subjected to replication, crossover, and mutation operations using a partially random key genetic algorithm to generate the next generation population. Repeated collision model establishment module: When the termination condition is met, the module outputs the final position and orientation of each rock sample after decoding and binning by the individual with the highest fitness, which is used as the final binning scheme, and then terminates the calculation.

[0031] The advantages of this invention compared to the prior art are:

[0032] (1) The present invention can handle the problem of packing irregularly shaped objects and achieve a packing and placement scheme with a high container space occupancy rate.

[0033] (2) The present invention takes into account gravity and friction, and has good stability and robustness in actual packing and placement.

[0034] (3) This invention is adaptable and versatile to objects of different quantities, irregular shapes and materials, and can be extended to other fields. Attached Figure Description

[0035] Figure 1 This is a flowchart of the three-dimensional packing optimization method for irregular rocks according to the present invention;

[0036] Figure 2 This is a schematic diagram of the axis-aligned bounding box AABB and the minimum directed bounding box OBB of the rock sample mesh model of the present invention;

[0037] Figure 3 This is a schematic diagram showing the smallest directed bounding box (OBB) obtained after translation and rotation of the rock sample mesh model of the present invention, which coincides with the axis-aligned bounding box.

[0038] Figure 4 This is a schematic diagram of the bin packing order gene encoding method of the partially random key genetic algorithm of the present invention;

[0039] Figure 5 This is a schematic diagram of the bin packing direction gene encoding method of the partially random key genetic algorithm of the present invention;

[0040] Figure 6 This is a schematic diagram showing that the OBB enclosure of the present invention can be placed in six directions;

[0041] Figure 7 This is a schematic diagram of the OBB bounding box of the present invention decoding and packing individual genes in pybullet;

[0042] Figure 8 This is a schematic diagram illustrating the selection of the decoding placement position in the partially random key genetic algorithm of the present invention;

[0043] Figure 9 This is a schematic diagram of the rock sample model of the present invention being boxed in pybullet;

[0044] Figure 10 This is a schematic diagram illustrating the replication, crossover, and mutation operations of the partially random key genetic algorithm of this invention. Detailed Implementation

[0045] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0046] like Figure 1 As shown, the present invention proposes a method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm. The specific implementation steps are as follows:

[0047] Step 1: Perform visual sampling and 3D reconstruction on each rock sample to obtain point cloud data for each rock sample. Then, convert the point cloud data into a mesh model in STL file format.

[0048] Step 2: Process the mesh model of each rock sample to ensure that its minimum oriented bounding box (OBB) coincides with its axis-aligned bounding box (AABB), meaning the OBB bounding box is parallel to the coordinate axes of the mesh model and coincides with the origin of the coordinate system. For example... Figure 2 As shown, the AABB bounding box and the OBB bounding box of the unprocessed rock sample mesh model do not coincide. Figure 3 As shown, the OBB bounding box of the processed rock sample mesh model coincides with the AABB bounding box.

[0049] The operation method is as follows: Open3D is used to process the mesh models of each rock sample to obtain the minimum directed bounding box (OBB) of each mesh model, and the center (OBB.center), size (OBB.extent), and rotation matrix (OBB.R) of the bounding box are obtained. Then, the mesh model is translated (translate(-OBB.center)) and rotated (transpose(OBB.R), center = [0,0,0]), where transpose(OBB.R) is the transpose of the rotation matrix OBB.R. After processing, a new mesh model STL_New and a new minimum directed bounding box OBB_New are generated. The bounding box OBB_New obtained in this way is parallel to the coordinate axes of the mesh model STL_New, and the origin of the coordinate system coincides with the origin of the coordinate system.

[0050] Step 3: Initialize the partially random key genetic algorithm to generate the initial population. Initializing the partially random key genetic algorithm includes setting the number of generations (num_generations), the number of times to wait for individuals with the same fitness (patient), the number of individuals in the population (num_individuals), the number of elite individuals (num_elites), the number of mutated individuals (num_mutants), and the elite selection probability (eliteCProb).

[0051] The partial random key genetic algorithm's individual encoding method is as follows: Given N rock samples to be packed, each individual contains 2N genes, where the first N genes represent the packing order and the last N genes represent the packing direction. For example... Figure 4As shown, the method for generating the first N genes is to generate N random keys corresponding to each item to be packed, and arrange them in ascending order to obtain the packing order. For example... Figure 5 As shown, the method for generating the last N genes is to generate N random keys corresponding to each item to be packed, and each OBB bounding box to be packed has six packing directions (e.g., ...). Figure 6 As shown), the value of its random key multiplied by 6 and then rounded forward is the current boxing direction.

[0052] Step 4: In PyBullet, build a collision model for the container and OBB bounding boxes, decode the genes of each individual, and pack each OBB bounding box according to the boxing order and orientation obtained after decoding. Output the position and orientation of each bounding box. The packing result is as follows: Figure 7 As shown. The binning rules used after gene decoding are as follows: Figure 8 As shown, after detecting that the OBB bounding box is placed in 6 directions, the extreme point that is furthest from the front right corner of the container is taken as the placement position.

[0053] Step 5: In pybullet, create a collision model for the rock sample corresponding to each OBB bounding box, and set its position and orientation to the position and orientation of the OBB bounding box in step 4.

[0054] Step 6: Add gravity and friction in PyBulet, setting them according to the gravitational environment of the celestial body. For example, for Earth, use `pybullet.setGravity(0,0,-9.81)`. ​​The collision model of the rock sample begins to fall under the influence of gravity, making the binning more compact. Figure 9 As shown. After each collision model stabilizes, the container space occupancy rate is calculated as the fitness of the individual. The container space occupancy rate is the ratio of the total volume Vobj of the placed models to the container space volume occupied below the highest point Zmax of the placed models. The formula for calculating the container space occupancy rate is as follows:

[0055] Rate = Vobj / (Zmax * L * W)

[0056] Where Rate is the container space occupancy rate, Vobj is the total volume of the placed model, Zmax is the highest point of the placed model, L is the length of the container bottom surface, and W is the width of the container bottom surface.

[0057] Step 7: As Figure 10 As shown, individuals in the population are divided into two categories, elite individuals and general individuals, based on their fitness. The population is then subjected to replication, crossover, and mutation operations using a partially random key genetic algorithm to generate the next generation of the population.

[0058] The operation involves sorting individuals in each generation of the population in descending order of fitness. The top num_elites individuals are considered elites, and the remaining individuals are considered generals. Elite individuals are directly replicated into the next generation to ensure that the quality of the solution continuously improves during the evolutionary process. For crossover, one individual is drawn from an elite individual, and the other is randomly selected from all individuals. The crossover probability is eliteCProb, meaning that offspring individuals receive genes from elite parents with a probability of eliteCProb and from general parents with a probability of (1-eliteCProb). Mutation generates num_mutants new individuals randomly.

[0059] Step 8: Repeat steps 4 to 7. When the termination condition is met, output the final position and orientation of each rock sample after decoding and binning for the individual with the highest fitness, as the final binning scheme, and terminate the calculation. The termination condition is reaching the number of evolutionary generations num_generations, or the fitness no longer changing after consecutive patient times.

[0060] This invention also proposes a three-dimensional packing optimization system for irregular rocks, comprising:

[0061] Mesh model acquisition and processing module: Visual sampling and 3D reconstruction are performed on each rock sample to obtain the mesh model of each rock sample; the mesh model of each rock sample is processed to make its minimum directed bounding box OBB coincide with the axis-aligned bounding box AABB, that is, the minimum directed bounding box OBB is parallel to the coordinate axis of the mesh model and coincides with the coordinate origin.

[0062] Algorithm initialization module: Initializes the partially random key genetic algorithm and encodes individuals to generate the initial population;

[0063] Collision Model Building Module: In PyBulllet, collision models of containers and OBB bounding boxes are built, and the genes of each individual are decoded. Based on the binning order and orientation obtained after decoding, each OBB bounding box is binned, and the position and orientation of each bounding box are output. After gene decoding, the extreme point furthest from the front right corner of the OBB bounding box to the front right corner of the container after attempting placement in six directions is taken as the placement position. In PyBulllet, collision models of rock samples corresponding to each OBB bounding box are built, and their positions and orientations are set to the positions and orientations of the OBB bounding boxes in step 4. Gravity and friction are added to PyBulllet, and the collision models of the rock samples begin to fall under the action of gravity, making the binning more compact. After each collision model stabilizes, the container space occupancy rate is calculated as the fitness of the individual.

[0064] Population generation and processing module: Based on fitness, individuals in the population are divided into elite individuals and general individuals. The population is then subjected to replication, crossover, and mutation operations using a partially random key genetic algorithm to generate the next generation population. Repeated collision model establishment module: When the termination condition is met, the module outputs the final position and orientation of each rock sample after decoding and binning by the individual with the highest fitness, which is used as the final binning scheme, and then terminates the calculation.

[0065] While the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Any person skilled in the art can make possible variations and modifications to the technical solutions of the present invention using the disclosed methods and techniques without departing from the spirit and scope of the invention. Therefore, any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention, without departing from the content of the technical solutions of the present invention, shall fall within the protection scope of the technical solutions of the present invention. Content not described in detail in this specification is common knowledge to those skilled in the art.

Claims

1. An optimization method for three-dimensional packing of irregular rocks based on a partially random key genetic algorithm, characterized in that... include: Step 1: Perform visual sampling and 3D reconstruction on each rock sample to obtain a mesh model of each rock sample; Step 2: Process the mesh model of each rock sample so that its minimum directed bounding box OBB coincides with the axis-aligned bounding box AABB, that is, the minimum directed bounding box OBB is parallel to the coordinate axis of the mesh model and coincides with the coordinate origin. Step 3: Initialize the partially random key genetic algorithm and encode individuals to generate the first generation population; Step 4: In pybullet, build a collision model of the container and OBB bounding boxes, decode the genes of each individual, and pack each OBB bounding box according to the boxing order and direction obtained after decoding, and output the position and orientation of each bounding box; after gene decoding, detect the extreme point where the front upper right corner of the OBB bounding box is farthest from the front upper right corner of the container after trying to place it in 6 directions, and take the placement position as the extreme point. Step 5: In pybullet, create a collision model for the rock sample corresponding to each OBB bounding box, and set its position and orientation to the position and orientation of the OBB bounding box in step 4. Step 6: Add gravity and friction in pybullet. The collision model of the rock sample begins to fall under the action of gravity, making the bins more compact. After each collision model stabilizes, calculate the container space occupancy as the fitness of the individual. Step 7: Divide the population into elite individuals and general individuals according to their fitness. Perform replication, crossover and mutation operations on the population according to the partial random key genetic algorithm to generate the next generation population. Step 8: Repeat steps 4 to 7. When the termination condition is met, output the final position and orientation of each rock sample after decoding and binning the individual with the maximum fitness, as the final binning scheme, and terminate the calculation.

2. The method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm according to claim 1, characterized in that: In the unprocessed rock sample mesh model, the AABB bounding box and the OBB bounding box do not coincide. After processing, the OBB bounding box and the AABB bounding box of the rock sample mesh model coincide.

3. The method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm according to claim 1 or 2, characterized in that: Step 2 involves processing the mesh models of each rock sample to ensure that their minimum directed bounding box (OBB) coincides with the axis-aligned bounding box (AABB). Specifically, Open3D is used to process the mesh models of each rock sample to obtain the minimum directed bounding box (OBB) of each mesh model, along with its center (OBB.center), size (OBB.extent), and rotation matrix (OBB.R). Then, the mesh models are translated and rotated. After processing, a new mesh model (STL_New) and a new minimum directed bounding box (OBB_New) are generated. The resulting bounding box (OBB_New) is parallel to the coordinate axes of the mesh model (STL_New), and their origins coincide.

4. The method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm according to claim 1, characterized in that: Initializing the partially random key genetic algorithm includes setting the number of generations (num_generations), the number of times to wait for individuals with the same fitness (patient), the number of individuals in the population (num_individuals), the number of elite individuals (num_elites), the number of mutated individuals (num_mutants), and the elite selection probability (eliteCProb).

5. The method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm according to claim 1 or 4, characterized in that: Encoding individuals is performed as follows: If there are N rock samples to be packed, each individual contains 2N genes. The first N genes represent the packing order, and the last N genes represent the packing direction. N random keys are generated corresponding to each item to be packed, arranged in ascending order to obtain the packing order, which is used as the first N genes. N random keys are also generated corresponding to each item to be packed, which is used as the last N genes. Each OBB bounding box to be packed has six packing directions. The value of its random key is multiplied by 6 and rounded forward to obtain the packing direction of the current bounding box.

6. The method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm according to claim 1, characterized in that: The container space occupancy rate mentioned in step 6 refers to the ratio of the total volume Vobj of the placed model to the container space volume occupied below the highest point Zmax of the placed model. The formula for calculating the container space occupancy rate is as follows: Rate=Vobj / (Zmax L IN) Where Rate is the container space occupancy rate, Vobj is the total volume of the placed model, Zmax is the highest point of the placed model, L is the length of the container bottom surface, and W is the width of the container bottom surface.

7. The method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm according to claim 1, characterized in that: Step 7 divides the population into elite and general individuals based on their fitness, and performs replication, crossover, and mutation operations on the population using a partially random key genetic algorithm to generate the next generation population. Specifically: Individuals in each generation are sorted in descending order of fitness, with the first num_elites being elite individuals and the remaining individuals being general individuals. Elite individuals are directly copied into the next generation to ensure that the quality of the solution is continuously improved during the evolutionary process. For the crossover operation, one individual comes from an elite individual, and the other is randomly generated from all individuals. The crossover probability is eliteCProb, meaning that the offspring individual receives the gene from the parent elite individual with a probability of eliteCProb and receives the gene from the parent general individual with a probability of (1-eliteCProb). The mutation operation generates num_mutants new individuals using a random method.

8. The method for optimizing the three-dimensional packing of irregular rocks based on a partially random key genetic algorithm according to claim 1, characterized in that: The termination condition described in step 8 is reaching the number of evolutionary generations num_generations, or the fitness no longer changing after consecutive patient cycles.

9. A three-dimensional packing optimization system for irregular rocks, implemented according to the partial random key genetic algorithm-based method for three-dimensional packing optimization of irregular rocks, is characterized in that... include: Mesh model acquisition and processing module: Visual sampling and 3D reconstruction are performed on each rock sample to obtain the mesh model of each rock sample; the mesh model of each rock sample is processed to make its minimum directed bounding box OBB coincide with the axis-aligned bounding box AABB, that is, the minimum directed bounding box OBB is parallel to the coordinate axis of the mesh model and coincides with the coordinate origin. Algorithm initialization module: Initializes the partially random key genetic algorithm and encodes individuals to generate the initial population; Collision Model Building Module: In PyBulllet, collision models of containers and OBB bounding boxes are built, and the genes of each individual are decoded. Based on the binning order and orientation obtained after decoding, each OBB bounding box is binned, and the position and orientation of each bounding box are output. After gene decoding, the extreme point furthest from the front upper right corner of the OBB bounding box to the front upper right corner of the container after attempting placement in six directions is taken as the placement position. In PyBulllet, collision models of rock samples corresponding to each OBB bounding box are built, and their positions and orientations are set to the positions and orientations of the OBB bounding boxes in step 4. Gravity and friction are added to PyBulllet, and the collision models of the rock samples begin to fall under the action of gravity, making the binning more compact. After each collision model stabilizes, the container space occupancy rate is calculated as the fitness of the individual. Population generation and processing module: Based on fitness, the population individuals are divided into elite individuals and general individuals. The population is then subjected to replication, crossover and mutation operations using a partially random key genetic algorithm to generate the next generation of population. The repeated collision model building module outputs the final position and orientation of each rock sample after decoding and binning the maximum fitness individual when the termination condition is met, as the final binning scheme, and terminates the calculation.

10. The irregular rock three-dimensional packing optimization system according to claim 9, characterized in that: The mesh models of each rock sample are processed to ensure that their minimum directed bounding box (OBB) coincides with the axis-aligned bounding box (AABB). Specifically, Open3D is used to process the mesh models of each rock sample to obtain the minimum directed bounding box (OBB) of each mesh model, along with its center (OBB.center), size (OBB.extent), and rotation matrix (OBB.R). Then, the mesh models are translated and rotated. After processing, a new mesh model (STL_New) and a new minimum directed bounding box (OBB_New) are generated. The resulting bounding box (OBB_New) is parallel to the coordinate axes of the mesh model (STL_New), and their origins coincide. Initializing the partially random key genetic algorithm includes setting the number of generations (num_generations), the number of times to wait for the same fitness (patient), the number of individuals in the population (num_individuals), the number of elite individuals (num_elites), the number of mutated individuals (num_mutants), and the elite selection probability (eliteCProb). Encoding individuals is performed as follows: If there are N rock samples to be packed, each individual contains 2N genes. The first N genes represent the packing order, and the last N genes represent the packing direction. N random keys are generated corresponding to each item to be packed, arranged in ascending order to obtain the packing order, which is used as the first N genes. N random keys are also generated corresponding to each item to be packed, which is used as the last N genes. Each OBB bounding box to be packed has six packing directions. The value of its random key is multiplied by 6 and rounded forward to obtain the packing direction of the current bounding box. The container space occupancy rate refers to the ratio of the total volume Vobj of the placed model to the container space volume occupied below the highest point Zmax of the placed model. The formula for calculating the container space occupancy rate is as follows: Rate=Vobj / (Zmax L IN) Where Rate is the container space occupancy rate, Vobj is the total volume of the placed model, Zmax is the highest point of the placed model, L is the length of the container bottom surface, and W is the width of the container bottom surface. Based on fitness, individuals in the population are divided into elite and general categories. Then, a partially random key genetic algorithm is used to perform replication, crossover, and mutation operations on the population to generate the next generation. Specifically: Individuals in each generation are sorted in descending order of fitness, with the first num_elites being elite individuals and the remaining individuals being general individuals. Elite individuals are directly copied into the next generation to ensure that the quality of the solution is continuously improved during the evolutionary process. For the crossover operation, one individual comes from an elite individual, and the other is randomly generated from all individuals. The crossover probability is eliteCProb, meaning that the offspring individual receives the gene from the parent elite individual with a probability of eliteCProb and receives the gene from the parent general individual with a probability of (1-eliteCProb). The mutation operation generates num_mutants new individuals using a random method.