CN113609667B - Model layout method, apparatus, computer device and storage medium - Google Patents

Model layout method, apparatus, computer device and storage medium Download PDF

Info

Publication number
CN113609667B
CN113609667B CN202110870950.XA CN202110870950A CN113609667B CN 113609667 B CN113609667 B CN 113609667B CN 202110870950 A CN202110870950 A CN 202110870950A CN 113609667 B CN113609667 B CN 113609667B
Authority
CN
China
Prior art keywords
model
imported
currently traversed
working space
unset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110870950.XA
Other languages
Chinese (zh)
Other versions
CN113609667A (en
Inventor
敖丹军
黄显彬
曾贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Chuangxiang 3D Technology Co Ltd
Original Assignee
Shenzhen Chuangxiang 3D Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Chuangxiang 3D Technology Co Ltd filed Critical Shenzhen Chuangxiang 3D Technology Co Ltd
Priority to CN202110870950.XA priority Critical patent/CN113609667B/en
Publication of CN113609667A publication Critical patent/CN113609667A/en
Application granted granted Critical
Publication of CN113609667B publication Critical patent/CN113609667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/20Configuration CAD, e.g. designing by assembling or positioning modules selected from libraries of predesigned modules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/10Additive manufacturing, e.g. 3D printing

Abstract

The application relates to a model layout method, a device, a computer device and a storage medium, wherein the method comprises the following steps: traversing a model to be imported, putting the currently traversed model to be imported into a first position which is in a working space and is close to the edge of the working space, and detecting whether the first position is a free space or not; if so, gradually moving the currently traversed model to be imported from the first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported for the first step length and placing; if not, the currently traversed model to be imported is moved out of the working space, the model to be imported is not placed randomly in the process of placing the model to be imported in sequence, and is not placed directly when the first position is the free space, but the final placement position is determined according to the moving result, so that the determined final placement position is more reasonable, namely, the model is reasonably distributed in the working space, and the utilization rate of the working space is improved.

Description

Model layout method, apparatus, computer device and storage medium
Technical Field
The present disclosure relates to the field of 3D printing technologies, and in particular, to a model layout method, apparatus, computer device, and storage medium.
Background
Three-dimensional (3D) printing technology is increasingly applied in the field of computer digital technology, and 3D printing is to manufacture three-dimensional objects by printing a layer of adhesive material. When 3D printing is performed, if there are many models imported by a user, the models need to be laid out first in a working space formed in slicing software by a print platform, then slicing processing is performed, and the model files are converted into gcode files for printing. However, when laying out models in a workspace, the prior art has the method of randomly placing a first model, then sequentially searching for a suitable position around the placed model to place the rest models, but since the first model may be a smaller model and the placement position is close to the central position of the workspace, then when placing a larger model, the placeable position may not be found, resulting in lower utilization of the workspace.
Disclosure of Invention
Based on this, it is necessary to provide a model layout method, apparatus, computer device, and storage medium in order to solve the above-mentioned technical problems.
The embodiment of the application provides a model layout method, which comprises the following steps: traversing a model to be imported, placing the currently traversed model to be imported into a first position which is in a working space and is close to the edge of the working space, and detecting whether the first position is a free space, wherein the free space is a space in which the model to be imported is positioned in the working space and the model to be imported is not collided when the model to be imported is placed into the current position; if yes, moving the currently traversed model to be imported from a first position, determining a final placement position of the currently traversed model to be imported according to a moving result, placing, and modifying the state of the currently traversed model to be imported into marked; and if not, moving the currently traversed model to be imported out of the working space, and keeping the state of the currently traversed model to be imported as unset.
The embodiment of the application also provides a model layout device, which comprises: the detection module is used for traversing the model to be imported, placing the currently traversed model to be imported into a first position which is close to the edge of the working space, and detecting whether the first position is a free space or not, wherein the free space is a space in which the model to be imported is located in the working space and the model to be imported is not collided when the model to be imported is placed into the current position; if yes, moving the currently traversed model to be imported from a first position, determining a final placement position of the currently traversed model to be imported according to a moving result, placing, and modifying the state of the currently traversed model to be imported into marked; and if not, moving the currently traversed model to be imported out of the working space, and keeping the state of the currently traversed model to be imported as unset.
The embodiment of the application also provides computer equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the model layout method when executing the computer program.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, the computer program realizing the model layout method when being executed by a processor.
In addition, the moving the currently traversed model to be imported from the current position, determining the final placement position of the currently traversed model to be imported according to the moving result, placing and modifying the state of the currently traversed model to be imported into a marked state includes: entering a first determining step, the first determining step comprising: moving the currently traversed model to be imported from the current position along a first direction by a first step length, and detecting whether the current position is the free space; if yes, re-entering the first determining step; if not, the currently traversed model to be imported is retracted by one first step length from the current position along the direction opposite to the first direction, and a second determining step is carried out, wherein the second determining step comprises the following steps: and moving the currently traversed model to be imported along a second direction by a first step length from the current position, detecting whether the current position is the free space, if not, backing back the currently traversed model to be imported along the opposite direction of the second direction by the first step length from the current position to serve as a final placement position, placing, modifying the state of the currently traversed model to be imported into a marked state, and if so, reentering the second determination step. By the method, the placement positions of the currently traversed models to be imported are determined from two directions, so that the determined placement positions of the currently traversed models to be imported can be reasonable.
In addition, after traversing the model to be imported, the method further comprises: traversing the unset model to be imported, placing the current traversed unset model to be imported into a second position which is in the working space and is close to the edge of the working space, detecting whether the current traversed unset model to be imported exceeds the working space at the second position, if so, moving the current traversed unset model to be imported out of the working space, keeping the state of the current traversed unset model to be unset, and if not, entering a third determining step, wherein the third determining step comprises: detecting whether the currently traversed non-placed model to be imported is collided at the current position, if not, taking the current position as the final placement position of the currently traversed non-placed model to be imported, placing, modifying the state of the currently traversed non-placed model to be marked, if so, moving the currently traversed non-placed model to be imported by a second step length along a third direction from the current position, detecting whether the current traversed non-placed model to be imported exceeds the working space on a horizontal axis where the third direction is located, and if not, reentering the third determining step. Through twice traversal, can put into the workspace with as many models as possible to rationally lay out to the model, improve the utilization ratio of workspace, and the second traversal, every turn all starts from the second position, can rationally utilize the workspace like this, thereby when can place the unset of current traversal wait to import model, find reasonable place the position and place.
In addition, after the detecting whether the current traversed unset model to be imported exceeds the workspace on the horizontal axis where the third direction is located, the method further includes: if so, moving the currently traversed non-placed model to the junction of the horizontal direction of the currently traversed non-placed model and the vertical direction of the second position from the current position, moving a second step length along a fourth direction from the current position, detecting whether the currently traversed non-placed model exceeds the working space on the horizontal axis of the fourth direction, if not, re-entering the third determining step, and if so, moving the currently traversed non-placed model out of the working space, and keeping the state of the currently traversed non-placed model to be still non-placed. By the method, the placement positions of the currently traversed unset models to be imported are determined from two directions, so that the determined placement positions of the currently traversed unset models to be imported can be reasonable.
In addition, after the detecting whether the currently traversed unset model to be imported exceeds the workspace on the horizontal axis where the third direction is located, the method further includes: if yes, backing the currently traversed unset model to be imported by one second step length, moving the currently traversed unset model to the fourth direction by one second step length, detecting whether the currently traversed unset model to be imported exceeds the working space on the horizontal axis where the fourth direction is located, if not, enabling the third direction to be the direction in backing, and reentering the third determining step, if yes, moving the currently traversed unset model to be imported out of the working space, and keeping the state of the currently traversed unset model to be imported to be unset. By the method, the placement positions of the currently traversed unset models to be imported are determined from two directions, so that the determined placement positions of the currently traversed unset models to be imported can be reasonable.
When the workspace is rectangular, the first direction is a direction directed from the current position toward the inside of the workspace and parallel to one side of the workspace, the second direction is a direction perpendicular to the first direction, the third direction is a direction directed from the current position toward the inside of the workspace and parallel to one side of the workspace, and the fourth direction is a direction perpendicular to the third direction. If the working space is rectangular, the first direction, the second direction, the third direction and the fourth direction are arranged in such a way that the movement of the model is more reasonable, so that the final placement position of the determined model is more reasonable, and the utilization rate of the working space is further improved.
In addition, after traversing the model to be imported which is not placed, the method further comprises the following steps: traversing the model to be imported which is not placed yet, and entering a fourth determining step, wherein the fourth determining step comprises the following steps: expanding the current working space, putting the currently traversed model to be imported which is not placed yet into a third position which is in the current working space and is close to the current working space, and detecting whether the third position is an idle space or not; if yes, taking the third position as the final placement position of the currently traversed model to be imported which is not yet placed, placing the model to be imported, and modifying the state of the currently traversed model to be imported which is not yet placed into a marked state; if not, moving the model to be imported along the edge of the current working space from the current position, and before traversing the edge of the working space, finding the free space, if so, taking the free space as the final placement position of the currently traversed model to be imported, placing the model to be imported, modifying the state of the currently traversed model to be imported into marked state, and if not, re-entering the fourth step. By expanding the workspace, the models to be imported that have not yet been placed can be placed in the workspace, and the user can know which models are outside the workspace this time, which cannot be printed this time.
In addition, the expanding the edge of the current working space comprises: and determining an expansion range according to the size of the currently traversed model to be imported which is not placed yet, and expanding the current working space according to the expansion range. The expansion range determined by the method is reasonable, and the model to be imported which is not yet placed and is traversed at present can be placed and marked faster.
In addition, before the traversing the model to be imported, the method further comprises: sequencing the models to be imported according to the sequence from big to small; the traversing the model to be imported comprises the following steps: traversing the model to be imported according to the sequence. Traversing is carried out according to the sequence from large to small, the possibility that a placeable position cannot be found when a smaller model to be imported is placed in the working space, so that the larger model to be imported is placed again can be reduced, the working space is utilized more reasonably, and the utilization rate of the working space is further improved.
In addition, before traversing the model to be imported which is not placed, the method further comprises: the placed model is moved to a central position of the workspace. By the method, when the unset model to be imported does not exist, the placed model is moved to the central position of the working space, so that the position of the placed model on the printing platform when the placed model is printed is more reasonable, and when the unset model to be imported exists, the placed model is moved to the central position of the working space, and the unset model to be imported can find the placeable position conveniently.
Drawings
FIG. 1 is a flow chart of a model layout method according to a first embodiment of the present application;
FIG. 2 is a schematic view of a placed model according to a first embodiment of the present application;
FIG. 3 is a flow chart of one implementation of step 104 in the first embodiment of the present application;
FIG. 4 is a schematic view of a working space in a first embodiment of the present application;
FIG. 5 is a flow chart of a model layout method according to a second embodiment of the present application;
FIG. 6 is a flow chart of a method of model layout according to a third embodiment of the present application;
FIG. 7 is a flow chart of a method of model layout according to a fourth embodiment of the present application;
FIG. 8 is a schematic view of a working space in a fourth embodiment of the present application;
FIG. 9 is a flow chart of a model layout method according to a fifth embodiment of the present application;
FIG. 10 is a schematic view of a model layout device according to a sixth embodiment of the present application;
fig. 11 is a schematic structural diagram of a computer device according to a seventh embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The first embodiment of the application relates to a model layout method, which is applied to computer equipment, such as: computers, cell phones, etc. As shown in fig. 1, a flowchart of a model layout method of the present embodiment includes:
step 101, traversing a model to be imported.
Step 102, placing the currently traversed model to be imported into a first position of the workspace and close to the edge of the workspace.
Specifically, the working space refers to a three-dimensional space formed by a printing platform of a printer selected by a user in slicing software, wherein the three-dimensional space comprises an X-axis direction, a Y-axis direction and a Z-axis direction, and the model to be imported refers to a model selected by the user to be printed; the shape of the printing platform can be set according to actual needs, for example: the horizontal projection shape of the printing platform can be rectangular, circular and the like, and the horizontal projection shape of the working space can also be rectangular, circular and the like.
When traversing to a model to be imported, placing the currently traversed model to be imported into a first position of a working space and close to the edge of the working space, wherein the first position is a preset position, for example: when the working space is rectangular, the first position can be a certain corner or a certain position close to one side; when the working space is circular, the first position may be a position close to the circumference.
Step 103, detecting whether the first position is a free space, wherein the free space is a space where the model to be imported is put into the working space and is not collided; if yes, go to step 104, if no, go to step 105.
Specifically, when the model to be imported is placed in the current position, the model to be imported is placed in a space where the working space is not collided, namely, when the model to be imported is located in the working space, namely, a bounding box of the model to be imported is located in the working space, when the model to be imported is not collided by the working space and is not collided by other models, the current position is a free space, wherein when the working space does not exist the placed model, the model to be imported is not necessarily collided by other models, when the working space exists the placed model, collision detection can be performed based on the polygonal bounding box, or collision detection can be performed based on the axial bounding box, the detection speed can be improved due to the fact that the calculation amount is small when the axial bounding box is used for collision detection, and as shown in fig. 2, a schematic diagram of the placed model is shown, and a model B in the diagram is not collided by a model A; when the model to be imported is placed in the current position, the model to be imported exceeds the working space but the model to be imported is not collided by other models, or the model to be imported is located in the working space but the model to be imported is collided by other models, or the model to be imported exceeds the working space and the model to be imported is collided by other models, and the current position is not an idle space; wherein, exceeding the workspace means that the model is located outside the workspace and the model is impacted by the workspace.
When the current position is the first position, if the currently traversed model to be imported is placed in a space where the working space is not collided when the model to be imported is placed in the first position, the first position is a free space, and if the currently traversed model to be imported is placed in the first position, the model to be imported exceeds the working space but no other model is collided, or the model to be imported is located in the working space but the model to be imported is collided, or the model to be imported exceeds the working space and the model to be imported is collided by the other model, the first position is not the free space.
Step 104, gradually moving the currently traversed model to be imported from the first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported for the first step length and placing.
And 105, moving the currently traversed model to be imported out of the working space.
Specifically, the first step length can be a preset step length, the preset step length is set according to actual needs, and the first step length can also be determined according to the size of the currently traversed model to be imported, so that the determined first step length is more accurate. If the first position is detected to be a free space, the first position is a position where the currently traversed model to be imported can be placed, but other positions where the currently traversed model to be imported can be placed may exist, so the currently traversed model to be imported is gradually moved from the first position along a preset direction according to a first step length until the currently traversed model to be imported is collided in the moving process, the collided is that the currently traversed model to be imported is collided by other models and the working space, and then the currently traversed model to be imported is retracted by the first step length and placed. If the first position is detected not to be the free space, the first position is indicated that the model to be imported cannot be placed, the currently traversed model to be imported is directly moved out of the working space, and the model to be imported at the moment is the model to be imported which is not placed. In one example, the placed model and the non-placed model may also be distinguished using a marker, which may be represented by a preset number or letter, for example: the placed model is marked 1 and the non-placed model is marked 0.
In one example, the preset direction includes a first direction and a second direction, the currently traversed model to be imported is gradually moved from the first position along the preset direction according to a first step length until being collided, the currently traversed model to be imported is retracted by the first step length, and a specific flowchart of placement is shown in fig. 3, and the method includes:
step 1041, moving the currently traversed model to be imported from the current position along the first direction by a first step length.
Step 1042, it is checked if the current position is free space. If yes, step 1041 is re-entered, and if not, step 1043 is entered.
Step 1043, backing the currently traversed model to be imported back a first step length from the current position along the opposite direction of the first direction.
Step 1044, moving the currently traversed model to be imported from the current position along the second direction by a first step length.
In step 1045, it is detected whether the current position is a free space. If yes, step 1044 is re-entered, and if not, step 1046 is entered.
Step 1046, backing the currently traversed model to be imported from the current position along the opposite direction of the second direction by a first step length, and placing.
Specifically, the first direction and the second direction are different directions, and the first direction and the second direction are preset directions; the first step length can be a preset step length, the preset step length is set according to actual needs, and the first step length can also be determined according to the size of the currently traversed model to be imported, so that the determined first step length is more accurate.
If the currently traversed model to be imported is a model A, gradually moving the model A from a current position, namely a first position 1, along a first step length along a first direction until the moved current position is not an idle space, if the model A is moved to a position 3, the position 3 is not the idle space, then the model A is retracted by the first step length along the opposite direction of the first direction from the current position, namely the position 3, if the model A is retracted by the first step length, reaches a position 2, then the moving direction is replaced by a second direction, and gradually moving the model A from the current position, namely the position 2 along the second direction according to the second step length each time until the moved current position is not the idle space, if the model A is moved to the position 5, then the model A is retracted by the first step length along the opposite direction of the second direction from the current position, namely the position 5, if the model A is retracted by the first step length, and if the model A is reached to a position 4, then the model A is placed at a final placement position 4. By the method, the placement positions of the currently traversed models to be imported are determined from two directions, so that the determined placement positions of the currently traversed models to be imported can be reasonable.
In one example, the preset direction includes a first direction, the currently traversed model to be imported is moved gradually from the first position along the preset direction according to a first step length until being collided, and then the currently traversed model to be imported is retracted by the first step length and placed, including: entering a first determining step, the first determining step comprising: moving the currently traversed model to be imported from the current position along a first direction by a first step length, and detecting whether the current position is an idle space or not; if yes, re-entering the first determining step; if not, the currently traversed model to be imported is retracted by a first step length from the current position along the reverse direction of the first direction.
In one example, when the workspace is rectangular, the first direction is a direction directed from the current position toward the inside of the workspace and parallel to one side of the workspace, and the second direction is a direction perpendicular to the first direction.
Specifically, as shown in fig. 4, the working space is a rectangle abcd, and the first position 1 is taken as a corner a for illustration, the following situations exist in the first direction and the second direction: the first direction is the ad direction, i.e. the left direction, the second direction is the ab direction, i.e. the down direction, the second direction, the first direction is the ab direction, i.e. the down direction, and the second direction is the ad direction, i.e. the down direction.
In the first case, if the currently traversed model to be imported is the model a, moving the model a leftwards from the current position, namely the first position 1, to the position 2, detecting whether the position 2 is an empty space, if so, moving the model a leftwards from the current position, namely the position 2, to the first step, to the position 3, detecting whether the position 3 is an empty space, if not, moving the model a rightwards from the position 3, to the position 2, moving the model a downwards from the current position, namely the position 2, to the position 4, detecting whether the position 4 is an empty space, if so, moving the model a downwards from the current position, namely the position 4, to the position 5, detecting whether the position 5 is an empty space, if not, moving the model a upwards from the current position, namely the position 5, to the first step, and if the position 4 is a final placement position, placing the model a at the position 4. If the working space is rectangular, the first direction and the second direction are set in such a way that the movement of the currently traversed model to be imported is more reasonable, so that the determined placement position of the currently traversed model to be imported is more reasonable.
In the second case, if the currently traversed model to be imported is the model a, moving the model a downward from the current position, i.e. the first position 1, by a first step length, reaching the position 2, detecting whether the position 2 is an empty space, if so, moving the model a downward from the current position, i.e. the position 2, reaching the position 3, detecting whether the position 3 is an empty space, if not, moving the model a upward from the position 3 by the first step length, reaching the position 2, moving the model a leftward from the current position, i.e. the position 2, by the first step length, reaching the position 4, detecting whether the position 4 is an empty space, if so, moving the model a leftward from the current position, i.e. the position 4, by the first step length, reaching the position 5, detecting whether the position 5 is an empty space, if so, moving the model a rightward from the current position, i.e. the position 5, by the first step length, reaching the position 4 is a final placement position, and placing the model a at the position 4. If the working space is rectangular, the first direction and the second direction are set in such a way that the movement of the currently traversed model to be imported is more reasonable, so that the determined placement position of the currently traversed model to be imported is more reasonable.
And 106, whether the model to be imported is traversed or not. If not, go to step 107, and then go to step 102, if yes, go to end.
Step 107, traversing the next model to be imported.
In one example, before traversing the model to be imported, the method further comprises: sequencing the models to be imported according to the sequence from big to small, traversing the models to be imported, and comprising the following steps: traversing the model to be imported according to the sequence. Specifically, if the model to be imported is A, B, C, D, E, F, G and the result of sorting the models to be imported from large to small is B, D, E, G, F, C, A, when traversing the models to be imported, traversing is performed according to the sorting of B, D, E, G, F, C, A. Traversing is carried out according to the sequence from large to small, the possibility that a placeable position cannot be found when a smaller model to be imported is placed in the working space, so that the larger model to be imported is placed again can be reduced, the working space is utilized more reasonably, and the utilization rate of the working space is further improved.
In this embodiment, traversing a model to be imported, placing the currently traversed model to be imported into a first position of a working space and close to the edge of the working space, and detecting whether the first position is a free space, wherein the free space is a space where the model to be imported is placed into the working space and is not collided; if so, gradually moving the currently traversed model to be imported from the first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported for the first step length and placing; and if not, the currently traversed model to be imported is moved out of the working space. Because the model to be imported is placed in the process of placing, the model is not placed randomly, but is placed at the edge close to the working space, and is not placed directly when the first position is the free space, but is moved step by step from the first position, the placement position is determined according to the movement result, the determined placement position is more reasonable, the possibility of placing the model again is improved, namely, the model is reasonably distributed in the working space, and the utilization rate of the working space is improved.
A second embodiment of the present application relates to a model layout method applied to a computer device, such as: the second embodiment is substantially the same as the first embodiment in that after traversing the model to be imported, the second embodiment traverses the model to be imported again, and confirms whether the currently traversed model to be imported is placed in a free space. As shown in fig. 5, a flowchart of the model layout method of the present embodiment includes:
in step 201, a model to be imported is traversed.
Step 202, placing the currently traversed model to be imported into a first position of the workspace and close to the edge of the workspace.
Step 203, detecting whether the first position is a free space, wherein the free space is a space where the model to be imported is put into the working space and is not collided; if yes, go to step 204, if no, go to step 205.
Step 204, gradually moving the currently traversed model to be imported from the first position along the preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported for the first step length and placing.
Step 205, the currently traversed model to be imported is moved out of the workspace.
Step 206, whether traversing the model to be imported is completed. If not, go to step 207, and then go to step 202, if yes, go to step 208.
Step 207, traversing the next model to be imported.
Steps 201 to 207 are similar to steps 101 to 107 in the first embodiment and will not be described again.
Step 208, traversing an unset model to be imported.
Step 209, placing the currently traversed unset model to be imported into the workspace at a second location near the edge of the workspace.
Specifically, the first position and the second position may be two different positions, or may be the same two positions, and the currently traversed non-placed model to be imported is placed in the working space and is close to the second position of the edge of the working space, where the second position is a preset position, for example: when the working space is rectangular, the second position can be a certain corner or a certain position close to one side; when the working space is circular, the second position may be a position close to the circumference.
At step 2010, it is detected whether the currently traversed unset model to be imported exceeds the workspace at the second location. If yes, go to step 2011, if no, go to step 2012.
In step 2011, the currently traversed unset model to be imported is moved out of the workspace.
In step 2012, it is detected whether the currently traversed unset model to be imported is impacted at the current location. If not, the process proceeds to step 2013, and if yes, the process proceeds to step 2014.
Step 2013, placing at the current position.
And step 2014, moving the currently traversed unset model to be imported from the current position by a second step length along a third direction.
Specifically, the first step length and the second step length can be the same step length or different step lengths, the second step length can be a preset step length, the preset step length is set according to actual needs, the second step length can also be determined according to the size of the currently traversed unset model to be imported, and the determined second step length is more accurate.
In step 2015, it is detected whether the currently traversed unset model to be imported exceeds the working space on the horizontal axis where the current position is located in the third direction. If not, the process proceeds to step 2012, if yes, to step 2016.
In step 2016, the currently traversed model to be imported is moved from the current position to the intersection of the horizontal direction in which the currently traversed model to be imported is located and the vertical direction in which the second position is located, and a second step is moved from the current position along the fourth direction.
In step 2017, it is detected whether the currently traversed unset model to be imported exceeds the workspace on the horizontal axis where the fourth direction is located at the current position. If not, step 2014 is re-entered, and if yes, step 2018 is entered.
Step 2018, moving the currently traversed unset model to be imported out of the workspace.
In one example, when the workspace is rectangular, the third direction is a direction directed from the current position toward the inside of the workspace and parallel to one side of the workspace, and the fourth direction is a direction perpendicular to the third direction.
Specifically, if the working space is a rectangle abcd as shown in fig. 4, and the second position 1' is taken as the second corner c as an example, the following cases exist in the third direction and the fourth direction: the first, third direction is cb direction, i.e. right direction, the fourth direction is cd direction, i.e. upward direction, the second, third direction is cd direction, i.e. upward direction, the fourth direction is cb direction, i.e. right direction.
In the first case, if the currently traversed unset model to be imported is model B, placing model B in a second position 1', detecting whether model B exceeds the working space in the direction of cb, if yes, moving model B out of the working space from the current position 2' to a second step size, if yes, detecting whether model B exceeds the working space in the direction of cb, if no, detecting whether model B is collided in the second position 1', if no, moving model B in the position 1' to a second step size, if yes, moving model B from the current position, namely second position 1', to the right, reaching position 2', detecting whether model B exceeds the working space in the direction of cb, if no, detecting whether model B is collided in the position 2', namely, moving model B to the right from the current position 2' to a position 3', detecting whether model B exceeds the working space in the direction of cb, if yes, moving model B from the position 3' to the position 1', and moving up to the second step size, detecting whether model B is moved in the direction of cb 4', detecting whether model B exceeds the working space in the direction of cb from the current position 4', namely, detecting whether model B exceeds the working space in the direction of cb from the position 5', if no, namely, detecting whether model B exceeds the working space in the direction of cb in the direction from the position 5', and detecting whether model B exceeds the current position 2', namely, moving model B exceeds the working space in the position 5', in the direction of cb, namely, moving model B to the position 5', if no, it is checked whether model B exceeds the working space in the cd direction at position 7', if so, model B is moved out of the working space, model B being the model that has not yet been placed. If the working space is rectangular, the arrangement of the third direction and the fourth direction can enable the movement of the currently traversed unset model to be imported to be more reasonable, and therefore the determined placement position of the currently traversed unset model to be imported to be more reasonable.
In the second case, if the currently traversed unset model to be imported is model B, placing model B in a second position 1', detecting whether model B exceeds the working space in the second position 1', if yes, moving model B out of the working space from the current position 2 'to a position 3' if no, detecting whether model B is collided in the second position 1', if no, moving model B in the position 1' to a right direction if no, moving model B upward from the current position, namely second position 1', to a position 2', detecting whether model B exceeds the working space in the cd direction at position 2', if no, detecting whether model B is collided in the position 2', namely position 2', to a position 3', detecting whether model B exceeds the working space in the cb direction at position 3', moving model B from the position 3' to the position 1', and moving model B to a right direction if no, detecting whether model B exceeds the working space in the cd direction at position 4', namely, detecting whether model B exceeds the position 5', and detecting whether model B exceeds the working space in the cd direction at position 5', if model B exceeds the position 5', and detecting whether model B exceeds the working space in the cd direction at the position 5', if the model B exceeds the working space in the cd, it is checked whether model B exceeds the working space in the cd direction at position 7', if so, model B is moved out of the working space, model B being the model that has not yet been placed. If the working space is rectangular, the arrangement of the third direction and the fourth direction can enable the movement of the currently traversed unset model to be imported to be more reasonable, and therefore the determined placement position of the currently traversed unset model to be imported to be more reasonable.
It will be understood that, if the working space is a rectangle abcd as shown in fig. 4, the case where the first position 1 is taken as the first corner a, the second position 1' is taken as the second corner c, the first direction and the second direction exist, the case where the third direction and the fourth direction exist may be arbitrarily combined, that is, the first direction is an ad direction, that is, a leftward direction, the second direction is an ab direction, that is, a downward direction, the third direction is a cb direction, that is, a rightward direction, the fourth direction is a cd direction, that is, an upward direction, or the first direction is an ad direction, that is, a leftward direction, the second direction is a ab direction, that is, a downward direction, the third direction is a cd direction, that is, a rightward direction, that is, the fourth direction is a cb direction, that is, a downward direction.
Step 2019, whether the model to be imported is not completely traversed. If not, go to step 2020, and then to step 209, if yes, go to end.
Step 2020, traversing the next unset model to be imported.
In one example, before traversing the model to be imported, the method further comprises: sequencing the models to be imported according to the sequence from big to small, traversing the models to be imported, and comprising the following steps: traversing the model to be imported according to the sequence; traversing the unset model to be imported, including: traversing the unset models to be imported according to the order.
Specifically, if the model to be imported is A, B, C, D, E, F, G, the result of sorting the models to be imported from large to small is B, D, E, G, F, C, A, when traversing the models to be imported, traversing according to the sorting of B, D, E, G, F, C, A, after traversing the models to be imported, placing the models to be imported E, C, A, if the models B, D, G, F are unset models to be imported, and when traversing the unset models to be imported, traversing according to the sorting of B, D, G, F. Traversing is carried out according to the sequence from large to small, the possibility that a placeable position cannot be found when a smaller model to be imported is placed in the working space, so that the larger model to be imported is placed again can be reduced, the working space is utilized more reasonably, and the utilization rate of the working space is further improved.
In one example, before traversing the unset model to be imported, the method further comprises: the placed model is moved to a central location in the workspace. By the method, when the unset model to be imported does not exist, the placed model is moved to the central position of the working space, so that the position of the placed model on the printing platform when the placed model is printed is more reasonable, and when the unset model to be imported exists, the placed model is moved to the central position of the working space, and the unset model to be imported can find the placeable position conveniently.
In this embodiment, through two traversals, as many models as possible can be placed in the working space, so that the models are reasonably laid out, the utilization rate of the working space is improved, and the second traversals start from the second position each time, so that the working space can be reasonably utilized, and when the model to be imported which is not placed in the current traversals can be placed, a reasonable placement position is found for placement; and the placement positions of the currently traversed unset models to be imported are determined from two directions, so that the determined placement positions of the currently traversed unset models to be imported can be reasonable.
A third embodiment of the present application relates to a model layout method applied to a computer device, such as: the third embodiment is substantially the same as the first embodiment in that after traversing the model to be imported, the third embodiment traverses the model to be imported again, and confirms whether there is a free space to place the currently traversed model to be imported. As shown in fig. 6, a flowchart of the model layout method of the present embodiment includes:
in step 301, a model to be imported is traversed.
Step 302, placing the currently traversed model to be imported into a first position of the workspace and close to the edge of the workspace.
Step 303, detecting whether the first position is a free space, wherein the free space is a space where the model to be imported is put into the working space and is not collided; if yes, go to step 304, if no, go to step 305.
Step 304, gradually moving the currently traversed model to be imported from the first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported by the first step length and placing the model to be imported.
Step 305, the currently traversed model to be imported is moved out of the workspace.
Step 306, whether the model to be imported is traversed. If not, go to step 307, and then go to step 302, if yes, go to step 308.
Step 307, traversing the next model to be imported.
Steps 301 to 307 are similar to steps 101 to 107 in the first embodiment, and will not be described again.
Step 308, traversing an unset model to be imported.
Step 309, placing the currently traversed unset model to be imported into the workspace at a second location near the edge of the workspace.
Specifically, the first position and the second position may be two different positions, or may be the same two positions, and the currently traversed non-placed model to be imported is placed in the working space and is close to the second position of the edge of the working space, where the second position is a preset position, for example: when the working space is rectangular, the first position in the working space and close to the edge of the working space can be a certain corner or a certain position close to a certain side, and when the working space is round, the second position in the working space and close to the edge of the working space can be a certain position close to the circumference.
Step 3010, detecting whether the currently traversed unset model to be imported exceeds the workspace at the second location. If yes, go to step 3011, if no, go to step 3012.
Step 3011, the currently traversed unset model to be imported is moved out of the workspace.
Step 3012, detecting whether the currently traversed model to be imported is collided with the model to be imported at the current position. If not, the process proceeds to step 3013, and if yes, the process proceeds to step 3014.
Step 3013, place at the current location.
Step 3014, moving the currently traversed unset model to be imported from the current position along the third direction by a second step.
Specifically, the first step length and the second step length can be the same step length or different step lengths, the second step length can be a preset step length, the preset step length is set according to actual needs, the second step length can also be determined according to the size of the currently traversed unset model to be imported, and the determined second step length is more accurate.
Step 3015, detecting whether the currently traversed unset model to be imported exceeds the working space on the horizontal axis where the current position is located in the third direction. If not, the process proceeds to step 3012, and if yes, the process proceeds to step 3016.
Step 3016, backing the currently traversed unset model to be imported back a second step, and moving the second step towards the fourth direction.
Step 3017, detecting whether the currently traversed unset model to be imported exceeds the workspace on the horizontal axis where the fourth direction is located. If not, go to step 3019, and then go to step 3014, if yes, go to step 3018.
Step 3018, the currently traversed unset model to be imported is moved out of the workspace.
Step 3019, let the third direction be the rollback direction.
In one example, when the workspace is rectangular, the third direction is a direction directed from the current position toward the inside of the workspace and parallel to one side of the workspace, and the fourth direction is a direction perpendicular to the third direction.
Specifically, if the working space is a rectangle abcd as shown in fig. 4, and the second position 1' is taken as the second corner c as an example, the following cases exist in the third direction and the fourth direction: the first, third direction is cb direction, i.e. right direction, the fourth direction is cd direction, i.e. upward direction, the second, third direction is cd direction, i.e. upward direction, the fourth direction is cb direction, i.e. right direction.
In the first case, if the model to be imported which is not placed and is currently traversed is model B, placing model B in a second position 1', detecting whether model B exceeds a working space at the second position 1', if yes, moving model B out of the working space from the current position, namely position 2', if yes, keeping the state of model B as still not placed, if no, detecting whether model B is collided at the second position 1', if no, moving model B at the position 1', if yes, moving model B from the current position, namely second position 1', to the right, reaching position 2', detecting whether model B exceeds the working space at the position 2', if no, detecting whether model B is collided at the position 2', if model B exceeds the working space at the position 3', detecting whether model B exceeds the working space at the position 3', if yes, moving model B from the position 3', and moving up to the second position 2', if no, detecting whether model B exceeds the working space at the position 4', namely position 5', if model B exceeds the working space at the position 5', if no, namely detecting whether model B exceeds the working space at the position 5', in the left, namely detecting whether model B exceeds the position 5', if model B exceeds the working space at the position 5', in the direction from the current position, namely position 5', if model B exceeds the working space at the position 5', detecting whether model B exceeds the working space at the second position 2', reaching position 7', detecting whether model B exceeds the workspace in the cd direction at position 7', if so, moving model B out of the workspace, model B being the model that has not yet been placed. If the working space is rectangular, the arrangement of the third direction and the fourth direction can enable the movement of the currently traversed unset model to be imported to be more reasonable, and therefore the determined placement position of the currently traversed unset model to be imported to be more reasonable.
In the second case, if the model to be imported which is not placed and is currently traversed is a model B, placing the model B in a second position 1', detecting whether the model B exceeds the working space in the second position 1', if so, moving the model B out of the working space, keeping the state of the model B as still not placed, if not, detecting whether the model B is collided in the second position 1', if not, placing the model B in the position 1', if so, moving the model B upward from the current position, namely the second position 1', to reach the position 2', detecting whether the model B exceeds the working space in the position 2', if not, detecting whether the model B is collided in the position 2', moving the model B upward from the current position, namely the position 2', to reach the position 3', detecting whether model B exceeds the working space in the cd direction at position 3', if so, moving model B from position 3' to position 2' and to the right by a second step length, reaching position 4', detecting whether model B exceeds the working space in the cb direction at position 4', if not, moving model B downward from the current position, i.e., position 4', to dc direction by a second step length, reaching position 5', detecting whether model B exceeds the working space in the cd direction at position 5', if not, detecting whether model B is collided at position 5', if yes, moving model B from the current position, i.e., position 5', to the right by a second step length, reaching position 6', detecting whether model B exceeds the working space in the cd direction at position 6', if so, moving model B from position 6' to position 5', and to the right by a second step length, reaching position 7', it is checked whether model B exceeds the workspace in position 7' in the cb direction, if so, model B is moved out of the workspace and the state of model B is left unset. If the working space is rectangular, the arrangement of the third direction and the fourth direction can enable the movement of the currently traversed unset model to be imported to be more reasonable, and therefore the determined placement position of the currently traversed unset model to be imported to be more reasonable.
It will be understood that, if the working space is a rectangle abcd as shown in fig. 4, the case where the first position 1 is taken as the first corner a, the second position 1' is taken as the second corner c, the first direction and the second direction exist, the case where the third direction and the fourth direction exist may be arbitrarily combined, that is, the first direction is an ad direction, that is, a leftward direction, the second direction is an ab direction, that is, a downward direction, the third direction is a cb direction, that is, a rightward direction, the fourth direction is a cd direction, that is, an upward direction, or the first direction is an ad direction, that is, a leftward direction, the second direction is a ab direction, that is, a downward direction, the third direction is a cd direction, that is, a rightward direction, that is, the fourth direction is a cb direction, that is, a downward direction.
Step 3020, whether the unset model to be imported is traversed. If not, go to step 3021 and then to step 309, if yes, go to end.
Step 3021, traversing the next unset model to be imported.
In one example, before traversing the model to be imported, the method further comprises: sequencing the models to be imported according to the sequence from big to small, traversing the models to be imported, and comprising the following steps: traversing the model to be imported according to the sequence; traversing the unset model to be imported, including: traversing the unset models to be imported according to the order.
Specifically, if the model to be imported is A, B, C, D, E, F, G, the result of sorting the models to be imported from large to small is B, D, E, G, F, C, A, when traversing the models to be imported, traversing according to the sorting of B, D, E, G, F, C, A, after traversing the models to be imported, placing and marking the models to be imported E, C, A, if the models B, D, G, F are unset models to be imported, and when traversing the unset models to be imported, traversing according to the sorting of B, D, G, F. Traversing is carried out according to the sequence from large to small, the possibility that a placeable position cannot be found when a smaller model to be imported is placed in the working space, so that the larger model to be imported is placed again can be reduced, the working space is utilized more reasonably, and the utilization rate of the working space is further improved.
In one example, before traversing the unset model to be imported, the method further comprises: the placed model is moved to a central location in the workspace. By the method, when the unset model to be imported does not exist, the placed model is moved to the central position of the working space, so that the position of the placed model on the printing platform when the placed model is printed is more reasonable, and when the unset model to be imported exists, the placed model is moved to the central position of the working space, and the unset model to be imported can find the placeable position conveniently.
In this embodiment, through two traversals, as many models as possible can be placed in the working space, so that the models are reasonably laid out, the utilization rate of the working space is improved, and the second traversals start from the second position each time, so that the working space can be reasonably utilized, and when the model to be imported, which is not placed in the current traversals, can be placed, a reasonable placement position is found for placement; and the placement positions of the currently traversed unset models to be imported are determined from two directions, so that the determined placement positions of the currently traversed unset models to be imported are reasonable, and the utilization rate of the working space is further improved.
A fourth embodiment of the present application relates to a model layout method applied to a computer device, such as: a computer, a mobile phone, etc., and the fourth embodiment is substantially the same as the second embodiment, except that after traversing the model to be imported which is not yet placed, the second embodiment also traverses the model to be imported which is not yet marked, and places the model to be imported which is not yet marked. As shown in fig. 7, a flowchart of the model layout method of the present embodiment includes:
in step 401, a model to be imported is traversed.
Step 402, placing the currently traversed model to be imported into a first position of the workspace and close to an edge of the workspace.
Step 403, detecting whether the first position is a free space, wherein the free space is a space where the model to be imported is put into the working space and is not collided; if yes, go to step 404, if no, go to step 405.
Step 404, gradually moving the currently traversed model to be imported from the first position along the preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported for the first step length and placing.
Step 405, the currently traversed model to be imported is moved out of the workspace.
Step 406, whether the model to be imported is traversed. If not, go to step 407 first, then go to step 402, if yes, go to step 408.
Step 407, traversing the next model to be imported.
In step 408, an unset model to be imported is traversed.
Step 409, placing the currently traversed unset model to be imported into the workspace at a second location near the edge of the workspace.
In step 4010, it is detected whether the currently traversed unset model to be imported exceeds the workspace at the second location. If yes, go to step 4011, if no, go to step 4012.
Step 4011, the currently traversed unset model to be imported is moved out of the workspace.
Step 4012, detect whether the currently traversed unset model to be imported is impacted at the current location. If not, the process proceeds to step 4013, and if yes, the process proceeds to step 4014.
Step 4013, place at current location.
Step 4014, moving the currently traversed unset model to be imported from the current position by a second step length along the third direction.
In step 4015, it is detected whether the currently traversed model to be imported is beyond the workspace on the horizontal axis where the third direction is located at the current position. If not, the process proceeds to step 4012, and if yes, the process proceeds to step 4016.
Step 4016, moving the currently traversed model to be imported from the current position to a junction between the horizontal direction of the currently traversed model to be imported and the vertical direction of the second position, and moving a second step length from the current position along the fourth direction.
In step 4017, it is detected whether the currently traversed model to be imported, which is not placed, exceeds the workspace on the horizontal axis where the fourth direction is located at the current position. If not, the process proceeds to step 4014, and if yes, the process proceeds to step 4018.
Step 4018, move the currently traversed unset model to be imported out of the workspace.
In step 4019, whether the unset model to be imported is traversed. If not, go to step 4020 and then go to step 409, if yes, go to step 4021.
In step 4020, the next unset model to be imported is traversed.
Steps 401 to 4020 are similar to steps 201 to 2020 in the second embodiment, and will not be described here.
In step 4021, a model to be imported that has not yet been placed is traversed.
Step 4022, expanding the current working space, placing the currently traversed model to be imported which is not placed in the current working space and is close to the third position of the current working space, detecting whether the third position is an idle space, if yes, entering step 4023, and if not, entering step 4024.
In one example, expanding the current workspace includes: and determining an expansion range according to the size of the currently traversed model to be imported which is not placed yet, and expanding the current working space according to the expansion range.
Specifically, according to the horizontal projection of the currently traversed model to be imported in the working space, which is not yet placed, the maximum distance of the horizontal projection in the horizontal direction is x, the maximum distance in the vertical direction is y, the expansion range is determined according to x and y, and the edge of the current working space is expanded according to the expansion range. If the current working space is rectangular, expanding two sides of the current working space in the horizontal direction by x and expanding two sides of the current working space in the vertical direction by y respectively; the periphery of the current working space can be expanded by a larger value respectively by taking the larger value in x and y. If the current working space is circular, the larger value of x and y can be taken, and the periphery of the current working space is expanded by a larger value. The expansion range determined by the method is reasonable, and the model to be imported which is not yet placed and is traversed at present can be placed and marked faster.
In one example, the current workspace may be expanded according to a preset expansion range.
Step 4023, placing in a third location.
Step 4024, gradually moving the model to be imported along the edge of the current working space from the third position according to a third step length, detecting whether a free space is found before traversing the edge of the finished working space, if yes, entering step 4025, and if no, reentering step 4022.
Step 4025, placing in the free space.
In step 4026, whether the model to be imported that has not yet been placed is traversed. If yes, the process ends, if not, the process goes to step 4027 and then goes to step 4021.
In step 4027, the next model to be imported that is not yet placed is traversed.
Specifically, the third step length can be a preset step length, the preset step length is set according to actual needs, the third step length can also be determined according to the size of the currently traversed model to be imported, and the determined third step length is more accurate; the third position is a preset position, for example: when the working space is rectangular, the first position can be a certain corner or a certain position close to one side; when the working space is circular, the first position may be a position close to the circumference. If the model to be imported which is not placed yet and is currently traversed is a model C, placing the model C in a third position which is in the current working space and is close to the current working space, detecting whether the third position is an idle space, if so, placing the model C in the third position, if not, gradually moving the model C along the edge of the current working space according to a third step length, if one position is the idle space in the moving process along the edge of the current working space, placing the model C in the position, if not, indicating that the expansion is insufficient, continuing to expand the edge of the current working space, and repeatedly executing the steps until the position exists.
The following will be described in detail with reference to an example: as shown in fig. 8, which is a schematic diagram of a working space, wherein the current working space is a rectangle a ' B ' C'd ', the working space before expansion is a rectangle abcd ', the model C is first placed in a third position 1", if yes, whether the model C is a free space or not is detected, the model B is placed in the position 1", if no, the model C is moved from the position 1 "to the right by a third step size, if no, whether the model C exceeds the current working space in the position 2" is detected, if no, whether the model C is collided with or not is detected, the model C is moved from the position 2 "to the right by a third step size, if yes, whether the model C exceeds the current working space in the position 3" is detected, if yes, the model C is moved back by the third step size, until the model C reaches the position 2", if yes, whether the model C is moved up by the third step size from the position 4", if no, whether the model C is moved up by the collision in the position 4", if no, whether the model C is moved up by the third step size from the position 5", if the model C exceeds the current working space in the position 6, if no, whether the model C is moved by the model C exceeds the third step size, if the model C exceeds the current working space in the position 6, if the model C exceeds the third step size, whether the model C exceeds the model C is moved by the third step size, if the model C is detected, the model C is moved from the position 6 "until the model C is moved to the position 6",6 ", moving model C down from position 6 "a third step to position 8", detecting whether model C exceeds the current working space at position 8", if not, detecting whether model C collides with the placed model at position 8", if so, moving model C down from position 6 "a third step to position 9", detecting whether the model C exceeds the current working space at the position 9 ', if so, continuing to expand the edge of the current working space, determining a placement position according to the method, if not, detecting whether the model C is collided at the position 9', if not, placing the model C at the position 9 ', wherein the position 9' is the placement position.
In one example, before traversing the model to be imported, the method further comprises: sequencing the models to be imported according to the sequence from big to small, traversing the models to be imported, and comprising the following steps: traversing the model to be imported according to the sequence; traversing the unset model to be imported, including: traversing the unset models to be imported according to the sequence; traversing the model to be imported which is not yet placed, including: traversing the model to be imported which is not placed yet according to the order.
In one example, before traversing the unset model to be imported, the method further comprises: the placed model is moved to a central location in the workspace.
In this embodiment, through two traversals, as many models as possible can be placed in the working space, so that the models are reasonably laid out, the utilization rate of the working space is improved, and the second traversals start from the second position each time, so that the working space can be reasonably utilized, and when the model to be imported which is not placed in the current traversals can be placed, a reasonable placement position is found for placement; and the placement positions of the currently traversed unset models to be imported are determined from two directions, so that the determined placement positions of the currently traversed unset models to be imported can be reasonable.
A fifth embodiment of the present application relates to a model layout method applied to a computer device, such as: a computer, a mobile phone, etc., and the fifth embodiment is substantially the same as the third embodiment, except that after traversing the model to be imported that is not yet placed, the model to be imported that is not yet marked is also traversed and the model to be imported that is not yet marked is placed in the fifth embodiment. As shown in fig. 9, a flowchart of the model layout method of the present embodiment includes:
step 501, traversing a model to be imported.
Step 502, placing the currently traversed model to be imported into a first position of the workspace and close to the edge of the workspace.
Step 503, detecting whether the first position is a free space, wherein the free space is a space where the model to be imported is put into the working space and is not collided; if yes, go to step 504, if no, go to step 505.
Step 504, gradually moving the currently traversed model to be imported from the first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported by the first step length and placing the model to be imported.
Step 505, the currently traversed model to be imported is moved out of the workspace.
Step 506, whether the model to be imported is traversed. If not, go to step 507, then go to step 502, if yes, go to step 508.
Step 507, traversing the next model to be imported.
At step 508, an unset model to be imported is traversed.
Step 509, placing the currently traversed unset model to be imported into the workspace at a second location near the edge of the workspace.
Step 5010, it is detected whether the currently traversed unset model to be imported exceeds the workspace at the second location. If yes, go to step 5011, if no, go to step 5012.
Step 5011, the currently traversed unset model to be imported is moved out of the workspace.
Step 5012, detecting whether the currently traversed model to be imported which is not placed collides with the model which is placed at the current position. If not, the process proceeds to step 5013, if yes, the process proceeds to step 5014.
Step 5013, place at the current location.
And step 5014, moving the currently traversed unset model to be imported from the current position by a second step length along a third direction.
Step 5015, detecting whether the currently traversed unset model to be imported exceeds the working space on the horizontal axis where the current position is located in the third direction. If not, the process proceeds to step 5012, if yes, the process proceeds to step 5016.
And step 5016, backing the currently traversed unset model to be imported back by a second step length, and moving the second step length to the fourth direction.
Step 5017, detect whether the currently traversed unset model to be imported exceeds the workspace on the horizontal axis where the fourth direction is located. If not, go to step 5019 and then to step 5014, if yes, go to step 5018.
Step 5018, the currently traversed unset model to be imported is moved out of the workspace.
Step 5019, let the third direction be the direction of rollback.
In step 5020, whether the model to be imported is not completely traversed. If not, go to step 5021, and then go to step 509, if yes, go to step 5022.
Step 5021, traversing the next unset model to be imported.
Steps 501-5021 are similar to steps 301-3021 in the third embodiment and will not be described again.
In step 5022, a model to be imported is traversed which is not yet placed.
Step 5023, expanding the current working space, placing the currently traversed model to be imported which is not placed in the current working space and is close to the third position of the current working space, detecting whether the third position is an idle space, if yes, entering step 5023, if yes, entering step 5024.
Step 5024, placing in a third position.
Step 5025, gradually moving the model to be imported along the edge of the current working space from the current position according to a third step length, detecting whether a free space is found before traversing the edge of the finished working space, if yes, proceeding to step 5025, otherwise, proceeding to step 5022 again.
Step 5026, placing in the free space.
In step 5027, whether the model to be imported which is not placed yet is traversed is not completed. If yes, go to end, if no, go to step 5028, and then go to step 5022.
Step 5028, traversing the next model to be imported that is not yet placed.
Steps 5022-5028 are similar to steps 4021-4027 and are not described in detail herein.
In one example, expanding the current workspace includes: and determining an expansion range according to the size of the currently traversed model to be imported which is not placed yet, and expanding the current working space according to the expansion range.
In one example, the current workspace may be expanded according to a preset expansion range.
In one example, before traversing the model to be imported, the method further comprises: sequencing the models to be imported according to the sequence from big to small, traversing the models to be imported, and comprising the following steps: traversing the model to be imported according to the sequence; traversing the unset model to be imported, including: traversing the unset models to be imported according to the sequence; traversing the model to be imported which is not yet placed, including: traversing the model to be imported which is not placed yet according to the order.
In one example, before traversing the unset model to be imported, the method further comprises: the placed model is moved to a central location in the workspace.
In this embodiment, by expanding the working space, the model to be imported which is not yet placed can be placed in the working space, and the user can know which models are out of the working space at this time, and cannot print at this time.
A sixth embodiment of the present application relates to a model layout device, a schematic structural diagram of a model layout device 601 is shown in fig. 10, and the device 601 includes:
the detection module 6011 is configured to traverse the model to be imported, place the currently traversed model to be imported into a first position of the working space, which is close to the edge of the working space, and detect whether the first position is a free space, where the free space is a space where the model to be imported is placed into the working space and is not collided; if so, gradually moving the currently traversed model to be imported from the first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then backing the currently traversed model to be imported by the first step length and placing the model; and if not, the currently traversed model to be imported is moved out of the working space.
Specific limitations regarding the apparatus may be found in the limitations of the methods above and will not be described in detail herein. Each of the modules in the above-described apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
The seventh embodiment of the present application provides a computer device, which may be a terminal, such as: the internal structure of a computer, a mobile phone, etc. can be shown in fig. 11. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a method of generating a print file. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 11 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application applies, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one example, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program which when executed by the processor performs the steps of the method embodiments described above.
An eighth embodiment of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
In one example, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-described method embodiments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (12)

1. A model layout method, comprising:
traversing a model to be imported, placing the currently traversed model to be imported into a first position which is in a working space and is close to the edge of the working space, and detecting whether the first position is a free space, wherein the free space is a space where the model to be imported is placed into the working space and is not collided;
if so, gradually moving the currently traversed model to be imported from a first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then returning the currently traversed model to be imported by the first step length and placing;
if not, the currently traversed model to be imported is moved out of the working space;
The step-by-step movement of the currently traversed model to be imported is performed along a first step length from a first position along a preset direction until the currently traversed model to be imported is collided, the step-by-step movement is performed, and the step-by-step movement is performed after the currently traversed model to be imported is retracted, and the step-by-step movement is performed, including:
entering a first determining step, the first determining step comprising:
moving the currently traversed model to be imported from the current position along a first direction by the first step length, and detecting whether the current position is the free space or not;
if yes, re-entering the first determining step;
if not, the currently traversed model to be imported is retracted by the first step length from the current position along the direction opposite to the first direction, and a second determining step is carried out, wherein the second determining step comprises the following steps: and moving the currently traversed model to be imported from the current position along the second direction by the first step length, detecting whether the current position is the free space, if not, returning the currently traversed model to be imported from the current position along the opposite direction of the second direction by the first step length, placing, and if so, re-entering the second determining step.
2. The model layout method according to claim 1, further comprising, after traversing the model to be imported:
traversing the unset model to be imported, placing the current traversed unset model to be imported into a second position which is close to the edge of the working space, detecting whether the current traversed unset model to be imported exceeds the working space at the second position, if so, moving the current traversed unset model to be imported out of the working space, and if not, entering a third determining step, wherein the third determining step comprises the following steps:
detecting whether the currently traversed model to be imported is collided at the current position, if not, placing the model to be imported at the current position, if so, moving the currently traversed model to be imported at the current position along a third direction for a second step length, detecting whether the currently traversed model to be imported at the current position exceeds the working space on a horizontal axis where the third direction is located, and if not, reentering the third determining step.
3. The model layout method according to claim 2, further comprising, after said detecting whether the current traversed unset model to be imported exceeds the workspace on a horizontal axis in which the third direction is located, the steps of:
If so, moving the currently traversed non-placed model to be imported from the current position to the junction of the horizontal direction of the currently traversed non-placed model to be imported and the vertical direction of the second position, moving the second step length from the current position along the fourth direction, detecting whether the currently traversed non-placed model to be imported exceeds the working space on the horizontal axis of the fourth direction, if not, re-entering the third determining step, and if so, moving the currently traversed non-placed model to be imported out of the working space.
4. The model layout method according to claim 2, further comprising, after said detecting whether the currently traversed unset model to be imported exceeds the workspace on a horizontal axis in which the third direction is located:
if so, the currently traversed unset model to be imported is retracted by the second step length, the second step length is moved to the fourth direction, whether the currently traversed unset model to be imported exceeds the working space on the horizontal axis where the fourth direction is located is detected, if not, the third direction is the direction when the retraction is performed, the third determining step is re-entered, and if so, the currently traversed unset model to be imported is moved out of the working space.
5. The model layout method according to claim 3 or 4, wherein when the workspace is rectangular, the first direction is a direction directed from a current position toward the inside of the workspace and parallel to one side of the workspace, the second direction is a direction perpendicular to the first direction, the third direction is a direction directed from the current position toward the inside of the workspace and parallel to one side of the workspace, and the fourth direction is a direction perpendicular to the third direction.
6. The model layout method according to claim 3 or 4, further comprising, after traversing the unset model to be imported:
traversing the model to be imported which is not placed yet, and entering a fourth determining step, wherein the fourth determining step comprises the following steps:
expanding the current working space, placing the currently traversed model to be imported which is not placed in a third position which is close to the current working space and is in the current working space, and detecting whether the third position is an idle space or not;
if yes, placing at the third position;
if not, gradually moving the model to be imported along the edge of the current working space from the third position according to a third step length, detecting whether the free space is found before the edge of the working space is traversed, if so, placing the model in the free space, and if not, re-entering the fourth determining step.
7. The model layout method according to claim 6, wherein expanding the edges of the current workspace comprises:
and determining an expansion range according to the size of the currently traversed model to be imported which is not placed yet, and expanding the current working space according to the expansion range.
8. The model layout method according to claim 1, further comprising, before the traversing the model to be imported: sequencing the models to be imported according to the sequence from big to small;
the traversing the model to be imported comprises the following steps: traversing the model to be imported according to the sequence.
9. The model layout method according to claim 2, further comprising, before the traversing the unset model to be imported:
the placed model is moved to a central position of the workspace.
10. A model layout apparatus, comprising:
the detection module is used for traversing the model to be imported, placing the currently traversed model to be imported into a first position which is close to the edge of the working space, and detecting whether the first position is a free space or not, wherein the free space is a space where the model to be imported is placed into the working space and is not collided; if so, gradually moving the currently traversed model to be imported from a first position along a preset direction according to a first step length until the currently traversed model to be imported is collided, and then returning the currently traversed model to be imported by the first step length and placing; if not, the currently traversed model to be imported is moved out of the working space;
The step-by-step movement of the currently traversed model to be imported is performed along a first step length from a first position along a preset direction until the currently traversed model to be imported is collided, the step-by-step movement is performed, and the step-by-step movement is performed after the currently traversed model to be imported is retracted, and the step-by-step movement is performed, including:
entering a first determining step, the first determining step comprising:
moving the currently traversed model to be imported from the current position along a first direction by the first step length, and detecting whether the current position is the free space or not;
if yes, re-entering the first determining step;
if not, the currently traversed model to be imported is retracted by the first step length from the current position along the direction opposite to the first direction, and a second determining step is carried out, wherein the second determining step comprises the following steps: and moving the currently traversed model to be imported from the current position along the second direction by the first step length, detecting whether the current position is the free space, if not, returning the currently traversed model to be imported from the current position along the opposite direction of the second direction by the first step length, placing, and if so, re-entering the second determining step.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the model layout method according to any of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the model layout method of any one of claims 1 to 9.
CN202110870950.XA 2021-07-30 2021-07-30 Model layout method, apparatus, computer device and storage medium Active CN113609667B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110870950.XA CN113609667B (en) 2021-07-30 2021-07-30 Model layout method, apparatus, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110870950.XA CN113609667B (en) 2021-07-30 2021-07-30 Model layout method, apparatus, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN113609667A CN113609667A (en) 2021-11-05
CN113609667B true CN113609667B (en) 2024-03-15

Family

ID=78338690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110870950.XA Active CN113609667B (en) 2021-07-30 2021-07-30 Model layout method, apparatus, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN113609667B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104890238A (en) * 2015-04-30 2015-09-09 北京敏速自动控制设备有限公司 Three-dimensional printing method and system thereof
CN107984764A (en) * 2017-09-30 2018-05-04 浙江大学 A kind of 3 D-printing method
CN108714303A (en) * 2018-05-16 2018-10-30 深圳市腾讯网络信息技术有限公司 Collision checking method, equipment and computer readable storage medium
CN108763677A (en) * 2018-05-16 2018-11-06 南华大学 A kind of method, system and the server of dispersion fuel neutron transport simulation
CN109408001A (en) * 2018-08-22 2019-03-01 先临三维科技股份有限公司 3D printing method, apparatus, 3D printing equipment and the storage medium of multi-model
CN110489355A (en) * 2019-08-19 2019-11-22 上海安路信息科技有限公司 The mapping method and its system of logic BRAM
CN110993014A (en) * 2019-11-20 2020-04-10 深圳忆联信息系统有限公司 Behavior test method and device of SSD in idle state, computer equipment and storage medium
CN111216125A (en) * 2019-12-04 2020-06-02 山东省科学院自动化研究所 Obstacle avoidance method and system of moving mechanical arm device facing narrow passage
CN111976135A (en) * 2020-07-13 2020-11-24 深圳市创必得科技有限公司 3D model placing method and device, storage medium and 3D printer
CN112150350A (en) * 2020-09-23 2020-12-29 深圳市创想三维科技有限公司 Model plane layout method, system and computer equipment
CN112546630A (en) * 2020-12-25 2021-03-26 珠海西山居移动游戏科技有限公司 Role moving method and device
CN112802203A (en) * 2021-01-18 2021-05-14 华中科技大学鄂州工业技术研究院 Spatial hash continuous collision detection method based on features
CN112848312A (en) * 2021-02-01 2021-05-28 深圳市创想三维科技有限公司 Method and device for detecting three-dimensional model object, computer equipment and storage medium
CN112989616A (en) * 2017-07-06 2021-06-18 卡尔蔡司光学国际有限公司 Method, apparatus and computer-readable storage medium for virtually fitting spectacle frames
CN113021900A (en) * 2021-03-19 2021-06-25 山东白令三维科技有限公司 Part model placing method in 3D printing and related device

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016173065A1 (en) * 2015-04-30 2016-11-03 北京敏速自动控制设备有限公司 Three-dimensional printing method and system
CN104890238A (en) * 2015-04-30 2015-09-09 北京敏速自动控制设备有限公司 Three-dimensional printing method and system thereof
CN112989616A (en) * 2017-07-06 2021-06-18 卡尔蔡司光学国际有限公司 Method, apparatus and computer-readable storage medium for virtually fitting spectacle frames
CN107984764A (en) * 2017-09-30 2018-05-04 浙江大学 A kind of 3 D-printing method
CN108714303A (en) * 2018-05-16 2018-10-30 深圳市腾讯网络信息技术有限公司 Collision checking method, equipment and computer readable storage medium
CN108763677A (en) * 2018-05-16 2018-11-06 南华大学 A kind of method, system and the server of dispersion fuel neutron transport simulation
CN109408001A (en) * 2018-08-22 2019-03-01 先临三维科技股份有限公司 3D printing method, apparatus, 3D printing equipment and the storage medium of multi-model
CN110489355A (en) * 2019-08-19 2019-11-22 上海安路信息科技有限公司 The mapping method and its system of logic BRAM
CN110993014A (en) * 2019-11-20 2020-04-10 深圳忆联信息系统有限公司 Behavior test method and device of SSD in idle state, computer equipment and storage medium
CN111216125A (en) * 2019-12-04 2020-06-02 山东省科学院自动化研究所 Obstacle avoidance method and system of moving mechanical arm device facing narrow passage
CN111976135A (en) * 2020-07-13 2020-11-24 深圳市创必得科技有限公司 3D model placing method and device, storage medium and 3D printer
CN112150350A (en) * 2020-09-23 2020-12-29 深圳市创想三维科技有限公司 Model plane layout method, system and computer equipment
CN112546630A (en) * 2020-12-25 2021-03-26 珠海西山居移动游戏科技有限公司 Role moving method and device
CN112802203A (en) * 2021-01-18 2021-05-14 华中科技大学鄂州工业技术研究院 Spatial hash continuous collision detection method based on features
CN112848312A (en) * 2021-02-01 2021-05-28 深圳市创想三维科技有限公司 Method and device for detecting three-dimensional model object, computer equipment and storage medium
CN113021900A (en) * 2021-03-19 2021-06-25 山东白令三维科技有限公司 Part model placing method in 3D printing and related device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
3D打印系统中模型放置优化方法研究;吴兴欢;《中国优秀硕士学位论文全文数据库》(第1期);I138-1798 *

Also Published As

Publication number Publication date
CN113609667A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
CN101833418B (en) Method and device for adding icon in interface and mobile terminal
EP2323019A1 (en) Gesture input operation device, method, program, and portable device
CN103793178B (en) Vector graph editing method of touch screen of mobile device
JP2019510309A5 (en)
CN102467519B (en) Visualization plotting method and system based on geographic information system
WO2014153986A1 (en) Method, apparatus, and terminal device for displaying multiple input boxes in a web page
CN105578043A (en) Picture composition method and device for photographing of camera
CN113609667B (en) Model layout method, apparatus, computer device and storage medium
US20140232727A1 (en) Method for generating writing data and an electronic device thereof
CN104112262A (en) Information processing method and electronic apparatus
CN113158281B (en) Pipeline arrangement model generation method and device, computer equipment and storage medium
CN109871517B (en) Text block ordering method and device, storage medium and electronic equipment
US9588603B2 (en) Information processing device
JP6055758B2 (en) Icon display program and icon display device
CN112529984B (en) Method, device, electronic equipment and storage medium for drawing polygon
CN113752561B (en) Method, device, computer equipment and storage medium for generating 3D printing file
EP2608004A1 (en) Method and device for movement of image object
CN111782313B (en) Display method, device, equipment, system and storage medium
CA2390390C (en) Graphics stack system and method
CN104848872A (en) Fast and convenient navigation method, system and equipment
CN106528130B (en) A kind of Edit button adaptation method and device
CN110515511A (en) A kind of operation application program image target method and device
CN114201250B (en) Method for rapidly deploying and implementing unmanned warehouse
CN110750818B (en) Height marking method, system and storage medium for drainage well design
CN111784800A (en) Method and device for selecting graphic object, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant