CN115195126A - Two-dimensional matching method and device for 3D printed object, electronic equipment and medium - Google Patents
Two-dimensional matching method and device for 3D printed object, electronic equipment and medium Download PDFInfo
- Publication number
- CN115195126A CN115195126A CN202210798281.4A CN202210798281A CN115195126A CN 115195126 A CN115195126 A CN 115195126A CN 202210798281 A CN202210798281 A CN 202210798281A CN 115195126 A CN115195126 A CN 115195126A
- Authority
- CN
- China
- Prior art keywords
- code
- subsequence
- placeable
- intersection
- printed object
- 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.)
- Granted
Links
Images
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B29—WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
- B29C—SHAPING OR JOINING OF PLASTICS; SHAPING OF MATERIAL IN A PLASTIC STATE, NOT OTHERWISE PROVIDED FOR; AFTER-TREATMENT OF THE SHAPED PRODUCTS, e.g. REPAIRING
- B29C64/00—Additive manufacturing, i.e. manufacturing of three-dimensional [3D] objects by additive deposition, additive agglomeration or additive layering, e.g. by 3D printing, stereolithography or selective laser sintering
- B29C64/30—Auxiliary operations or equipment
- B29C64/386—Data acquisition or data processing for additive manufacturing
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B29—WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
- B29C—SHAPING OR JOINING OF PLASTICS; SHAPING OF MATERIAL IN A PLASTIC STATE, NOT OTHERWISE PROVIDED FOR; AFTER-TREATMENT OF THE SHAPED PRODUCTS, e.g. REPAIRING
- B29C64/00—Additive manufacturing, i.e. manufacturing of three-dimensional [3D] objects by additive deposition, additive agglomeration or additive layering, e.g. by 3D printing, stereolithography or selective laser sintering
- B29C64/30—Auxiliary operations or equipment
- B29C64/386—Data acquisition or data processing for additive manufacturing
- B29C64/393—Data acquisition or data processing for additive manufacturing for controlling or regulating additive manufacturing processes
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B33—ADDITIVE MANUFACTURING TECHNOLOGY
- B33Y—ADDITIVE MANUFACTURING, i.e. MANUFACTURING OF THREE-DIMENSIONAL [3-D] OBJECTS BY ADDITIVE DEPOSITION, ADDITIVE AGGLOMERATION OR ADDITIVE LAYERING, e.g. BY 3-D PRINTING, STEREOLITHOGRAPHY OR SELECTIVE LASER SINTERING
- B33Y50/00—Data acquisition or data processing for additive manufacturing
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B33—ADDITIVE MANUFACTURING TECHNOLOGY
- B33Y—ADDITIVE MANUFACTURING, i.e. MANUFACTURING OF THREE-DIMENSIONAL [3-D] OBJECTS BY ADDITIVE DEPOSITION, ADDITIVE AGGLOMERATION OR ADDITIVE LAYERING, e.g. BY 3-D PRINTING, STEREOLITHOGRAPHY OR SELECTIVE LASER SINTERING
- B33Y50/00—Data acquisition or data processing for additive manufacturing
- B33Y50/02—Data acquisition or data processing for additive manufacturing for controlling or regulating additive manufacturing processes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
- G06T9/20—Contour coding, e.g. using detection of edges
Landscapes
- Engineering & Computer Science (AREA)
- Chemical & Material Sciences (AREA)
- Materials Engineering (AREA)
- Manufacturing & Machinery (AREA)
- Physics & Mathematics (AREA)
- Mechanical Engineering (AREA)
- Optics & Photonics (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
Abstract
The invention relates to a two-dimensional matching method, a two-dimensional matching device, electronic equipment and a medium for a 3D printed object, wherein the method comprises the following steps: the method comprises the steps of coding two-dimensional projection and a placeable area of a 3D printed object through Freeman chain codes to obtain a first code and a second code, conducting differential processing on the first code and the second code to obtain a third code and a fourth code, determining the longest continuous similar subsequence of the third code and the fourth code, judging the intersection of outlines of the 3D printed object and the placeable area according to the longest continuous similar subsequence, and placing the 3D printed object in the placeable area if the intersection of the outlines is not intersected. By the method, the placeable area of the printing platform is fully utilized, the utilization rate of the printing platform is improved, and the situation that the matching effect of the subsequent 3D printed article and the placeable area is influenced by the fact that the contour intersection judgment is carried out based on the discontinuous similar sequence can be avoided through the longest continuous similar subsequence.
Description
Technical Field
The invention relates to the technical field of 3D printing, in particular to a two-dimensional matching method and device for a 3D printed object, electronic equipment and a medium.
Background
In the prior art, 3D printing or rapid prototyping has been rapidly developed in various fields by means of layer-by-layer manufacturing methods. It can machine highly complex parts without regard to tooling constraints such as tools, fixtures and dies, and multi-material bodies. With the rapid increase of the demand of batch printing, the improvement of printing efficiency has become a main target of the technology, one of the key points is to optimize the layout of a printed object by using computer technology, and a two-dimensional nesting method is mainly used at present. Two-dimensional nesting of 3D printed objects is a complex system problem that not only needs to pay attention to the impact of time and economic benefits, but also needs to consider the impact of part build direction, different processing methods, derived printing accuracy, printing time, material waste, support volume and surface roughness.
In the prior art, a front edge line of a 3D printed object is usually used as a target for determining the contour similarity, and the front edge line may be as shown in fig. 1, based on the above method, a placeable region corresponding to a position below the front edge line may not be fully utilized, and the placeable region includes a free region between the two-dimensional projection of the 3D printed object placed on the printing platform and the printing platform, and a free region inside the 3D printed object placed on the printing platform, so that the utilization rate of the printing platform is low.
Disclosure of Invention
The invention aims to solve at least one technical problem by providing a two-dimensional matching method, a two-dimensional matching device, an electronic device and a medium for a 3D printed object.
In a first aspect, the technical solution for solving the above technical problem of the present invention is as follows: a method of two-dimensional matching of a 3D printed object, the method comprising:
the method comprises the steps of obtaining a 3D printing object to be placed and a placeable area on a printing platform, wherein the placeable area comprises an area on the printing platform except an area occupied by two-dimensional projection of the 3D printing object placed on the printing platform;
respectively coding the two-dimensional projection and the placeable region of the 3D printed object through a Freeman chain code to obtain a first code corresponding to the 3D printed object and a second code corresponding to the placeable region;
the first codes represent the outline of the two-dimensional projection of the 3D printed object, the second codes represent the outline of the placeable area, the first codes comprise each first code element, the second codes comprise each second code element, each first code element represents the trend of the sub-outline corresponding to the two-dimensional projection of the 3D printed object, each second code element represents the trend of the sub-outline corresponding to the placeable area in each sub-outline corresponding to the second code element;
respectively carrying out differential processing on the first code and the second code to obtain a third code and a fourth code;
determining the longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, wherein the longest continuous similar subsequence comprises a similar first subsequence and a second subsequence, the first subsequence is an outline subsequence formed by a plurality of continuous first coding elements in the third code, and the second subsequence is an outline subsequence formed by a plurality of continuous second coding elements in the fourth code;
according to the longest continuous similarity subsequence, judging the intersection of the contours of the 3D printed object and the placeable area, wherein the intersection of the contours is non-intersection or intersection;
and if the intersection of the contours is not intersected, placing the 3D printing object in a placeable area.
The beneficial effects of the invention are: the outline intersection of the 3D printing object and the placeable area is judged based on a first code corresponding to the projection of the 3D printing object on the printing platform and a second code capable of being placed in the area, and the placeable area comprises an area on the printing platform except for an area occupied by the two-dimensional projection of the 3D printing object placed on the printing platform, namely in the scheme, the placeable area takes the idle area formed by the 3D printing object placed on the printing platform and the printing platform into consideration and the idle area inside the 3D printing object placed on the printing platform into consideration, so that in the process of determining the outline intersection of the 3D printing object and the placeable area based on the first code and the second code, the idle area on the printing platform can be fully utilized, and the utilization rate of the printing platform is improved. Meanwhile, the contour of the two-dimensional projection of the 3D printed object and the contour of the placeable area are respectively represented by the third code and the fourth code, so that subsequent contour intersection judgment can be facilitated, and the influence on the matching effect of the subsequent 3D printed object and the placeable area due to contour intersection judgment based on a discontinuous similar sequence can be avoided by the longest continuous similar subsequence.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, the determining the longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code includes:
updating a preset initial similarity judgment matrix according to the third code and the fourth code to obtain an updated matrix, wherein for each element in the updated matrix, the value of the element represents the similarity between the coding element in the third code and the coding element in the fourth code and the sequence length of the longest continuous similar subsequence;
and determining the first subsequence and the second subsequence corresponding to the maximum element in the updated matrix as the longest continuous similar subsequence.
The method has the advantages that the longest continuous similar subsequence is determined by adopting the preset initial similarity judgment matrix, and the longest continuous similar subsequence can be determined more accurately.
Further, the above determining the intersection of the contours of the 3D printed object and the placeable area according to the longest continuous similarity subsequence includes:
determining a first included angle between a first connecting line and a horizontal line according to a first connecting line between a first coding element and a last first coding element of a first subsequence in the longest continuous similar subsequence;
determining a second included angle between a second connecting line and a horizontal line according to a second connecting line between a first second coding element and a last second coding element of a second subsequence in the longest continuous similar subsequence;
rotating the 3D printed object and the placeable area according to the first included angle and the second included angle to obtain a first subsequence after rotation and a second subsequence after rotation, wherein the angle corresponding to the first subsequence after rotation is the same as the angle corresponding to the second subsequence after rotation;
determining the shortest distance between the rotated 3D printed object and the rotated placeable area according to the rotated first subsequence and the rotated second subsequence;
and judging the profile intersection of the 3D printing object and the placeable area according to the shortest distance.
The beneficial effect of adopting the above further scheme is that, by rotating the 3D printed object and the shortest distance determined after the placement area, it can be avoided that part of position points in the outline corresponding to the 3D printed object exceed the outline of the placement area, so that the outline intersection is determined inaccurately.
Further, the above determining the intersection of the contours of the 3D printed object and the placeable area according to the shortest distance includes:
translating the rotated 3D printed object to a rotated placeable area according to the shortest distance, if an intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable area, judging that the contour intersection is intersected, and if the intersection point does not exist between the contour of the translated 3D printed object and the contour of the rotated placeable area, judging that the contour intersection is not intersected.
The method has the advantages that based on the shortest distance, the rotated 3D printed object is translated to the rotated placeable area in a translation mode, and the intersection of the contours is judged more accurately by judging whether an intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable area.
Further, if the intersection of the contours is not intersected, the placing the 3D printed object in a placeable area includes:
reversely rotating the rotated placeable area and the rotated 3D printed object, so that the angle corresponding to the reversely rotated placeable area is a second included angle, and the angle corresponding to the reversely rotated 3D printed object is a second included angle;
and placing the 3D printed object after the reverse rotation into a placeable area after the reverse rotation.
The beneficial effect of adopting above-mentioned further scheme is that, because the position of placeable region on print platform is fixed unchangeable, in order to confirm the profile intersection nature, placeable region and 3D printed object have rotated, so before placing 3D printed object to placeable region, need to restore the previous angle with placeable region after the rotation to can place the same angle in region with 3D printed object after the rotation, so that subsequent matching.
Further, if there are at least two longest continuous similar subsequences, for any one of the at least two longest continuous similar subsequences, the determining the intersection of the contour of the 3D printed object and the outline of the placeable region according to the longest continuous similar subsequence includes:
s1, judging the intersection of the outlines of the 3D printed object and the placeable area according to any longest continuous similar subsequence;
s2, if the intersection of the contours is intersection, judging the intersection of the contours corresponding to another longest continuous similar subsequence according to another longest continuous similar subsequence except any one of the longest continuous similar subsequences in the at least two longest continuous similar subsequences, and repeating the step S2 until the longest continuous similar subsequence corresponding to the condition that the intersection of the contours in the at least two longest continuous similar subsequences is not intersected is judged;
the method has the advantages that if the number of the longest continuous similar subsequences is at least two, when the intersection of the contours corresponding to one of the longest continuous similar subsequences is not intersected, the intersection of the contours corresponding to other longest continuous similar subsequences in the at least two longest continuous similar subsequences can be judged until the intersection of the contours is judged to be the corresponding longest continuous similar subsequences, and the utilization rate of the printing platform is further improved.
Further, if the printing platform includes a plurality of placeable regions, the step S1 and the step S2 specifically include:
s11, judging the intersection of the contour of the 3D printed object and the placeable area according to any one of at least two longest continuous similar subsequences corresponding to a first placeable area in the placeable areas;
s12, if the intersection of the contours is intersection, judging the intersection of the contours corresponding to the other longest continuous similar subsequence according to the other longest continuous similar subsequence except any one of the longest continuous similar subsequences in the at least two longest continuous similar subsequences, and repeating the step S12 until the longest continuous similar subsequence corresponding to the intersection of the contours in the at least two longest continuous similar subsequences is judged to be disjointed;
step S13, if there is no longest continuous similar subsequence corresponding to the disjoint outline intersection in the at least two longest continuous similar subsequences corresponding to the first placeable region, determining the outline intersection between the 3D printed object and the placeable region according to the longest continuous similar subsequence corresponding to the second placeable region in the plurality of placeable regions, and repeating steps S12 to S13 until there is a continuous similar subsequence corresponding to the placeable region corresponding to the disjoint outline intersection in the plurality of placeable regions.
The beneficial effect of adopting the above further scheme is that if the printing platform comprises a plurality of placeable areas, the continuous similar subsequence corresponding to the corresponding placeable area can be determined when the intersection of the outlines is non-intersected from the plurality of placeable areas, so as to fully consider all the placeable areas on the printing platform.
In a second aspect, the present invention provides a two-dimensional matching apparatus for 3D printing an object, which includes:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a 3D printing object to be placed and placeable areas on a printing platform, and the placeable areas comprise areas on the printing platform except for areas occupied by two-dimensional projection of the 3D printing object placed on the printing platform;
the coding module is used for coding the two-dimensional projection and the placeable region of the 3D printed object through the Freeman chain code to obtain a first code corresponding to the 3D printed object and a second code corresponding to the placeable region;
the first codes represent the outline of the two-dimensional projection of the 3D printed object, the second codes represent the outline of the placeable area, the first codes comprise each first code element, the second codes comprise each second code element, each first code element represents the trend of the sub-outline corresponding to the two-dimensional projection of the 3D printed object, and each second code element represents the trend of the sub-outline corresponding to the second code element in each sub-outline forming the placeable area;
the difference module is used for respectively carrying out difference processing on the first code and the second code to obtain a third code and a fourth code;
the longest continuous similar subsequence determining module is used for determining a longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, wherein the longest continuous similar subsequence comprises a similar first subsequence and a second subsequence, the first subsequence is a contour subsequence formed by a plurality of continuous first coding elements in the third code, and the second subsequence is a contour subsequence formed by a plurality of continuous second coding elements in the fourth code;
the contour intersection judging module is used for judging the contour intersection of the 3D printed object and the placeable area according to the longest continuous similar subsequence, and the contour intersection is non-intersection or intersection;
and the placing module is used for placing the 3D printed object in a placeable area when the intersection of the contours is not intersected.
In a third aspect, the present invention provides an electronic device to solve the above technical problem, where the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the two-dimensional matching method for a 3D printed object of the present application.
In a fourth aspect, the present invention further provides a computer-readable storage medium storing thereon a computer program which, when executed by a processor, implements the two-dimensional matching method for a 3D printed object of the present application.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below.
FIG. 1 is a schematic diagram of a front edge according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a two-dimensional matching method for a 3D printed object according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an 8-neighborhood Freeman chain code according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a two-dimensional projection of a 3D printed object provided by one embodiment of the present invention;
FIG. 5 is a schematic diagram of a two-dimensional projection of a 3D printed object provided by one embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating a process for determining a first included angle (Angle 1) and a second included angle (Angle 2) according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a shortest distance provided in accordance with an embodiment of the present invention;
fig. 8 is a schematic flowchart of another two-dimensional matching method for 3D printed objects according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a two-dimensional matching apparatus for 3D printing an object according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with examples which are set forth to illustrate, but are not to be construed to limit the scope of the invention.
The technical solution of the present invention and how to solve the above technical problems will be described in detail with specific embodiments below. These several specific embodiments may be combined with each other below, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
The scheme provided by the embodiment of the invention can be suitable for any application scene needing to match the placeable area of the 3D printing object and the printing platform. The scheme provided by the embodiment of the invention can be executed by any electronic equipment, for example, the terminal equipment can be the terminal equipment of a user, the terminal equipment can be any terminal equipment which can be provided with application and can match a 3D printed object with a placeable area of a printing platform through the application, and the scheme comprises at least one of the following steps: smart phones, tablet computers, notebook computers, desktop computers, smart speakers, smart watches, smart televisions, and smart car-mounted devices.
An embodiment of the present invention provides a possible implementation manner, as shown in fig. 2, a flowchart of a two-dimensional matching method for 3D printed objects is provided, and the scheme may be executed by any electronic device, for example, the scheme may be executed by a terminal device, or by a terminal device and a server, and for convenience of description, the method provided in the embodiment of the present invention is described below by taking a server as an execution subject, and as shown in the flowchart shown in fig. 2, the method may include the following steps:
step S110, acquiring a 3D printing object to be placed and a placeable area on a printing platform, wherein the placeable area comprises an area on the printing platform except an area occupied by two-dimensional projection of the 3D printing object placed on the printing platform;
step S120, respectively coding the two-dimensional projection and the placeable area of the 3D printed object through a Freeman chain code to obtain a first code corresponding to the 3D printed object and a second code corresponding to the placeable area;
the first codes represent the outline of the two-dimensional projection of the 3D printed object, the second codes represent the outline of the placeable area, the first codes comprise each first code element, the second codes comprise each second code element, each first code element represents the trend of the sub-outline corresponding to the two-dimensional projection of the 3D printed object, each second code element represents the trend of the sub-outline corresponding to the second code element in each sub-outline forming the placeable area;
step S130, respectively carrying out differential processing on the first code and the second code to obtain a third code and a fourth code;
step S140, determining a longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, where the longest continuous similar subsequence includes a similar first subsequence and a second subsequence, the first subsequence is a contour subsequence formed by a plurality of continuous first coding elements in the third code, and the second subsequence is a contour subsequence formed by a plurality of continuous second coding elements in the fourth code;
step S150, according to the longest continuous similar subsequence, judging the intersection of the outlines of the 3D printed object and the placeable area, wherein the intersection of the outlines is non-intersection or intersection;
and step S160, if the intersection of the contours is not intersected, placing the 3D printing object in a placeable area.
According to the method, the intersection of the outlines of the 3D printing object and the placeable area is judged based on the first code corresponding to the projection of the 3D printing object on the printing platform and the second code of the placeable area, and the placeable area comprises the area on the printing platform except the area occupied by the two-dimensional projection of the 3D printing object placed on the printing platform, namely in the scheme, the placeable area takes the idle area formed by the 3D printing object placed on the printing platform and the idle area inside the 3D printing object placed on the printing platform into consideration, so that the idle area on the printing platform can be fully utilized in the process of determining the intersection of the outlines of the 3D printing object and the placeable area based on the first code and the second code, and the utilization rate of the printing platform is improved. Meanwhile, the contour of the two-dimensional projection of the 3D printed object and the contour of the placeable area are respectively represented by the third code and the fourth code, so that subsequent contour intersection judgment can be facilitated, and the influence on the matching effect of the subsequent 3D printed object and the placeable area due to contour intersection judgment based on a discontinuous similar sequence can be avoided by the longest continuous similar subsequence.
The scheme of the present invention is further described below with reference to the following specific embodiments, in which the two-dimensional matching method for 3D printed objects may include the following steps:
step S110, acquiring a 3D printing object to be placed and a placeable area on a printing platform, wherein the placeable area comprises an area on the printing platform except an area occupied by two-dimensional projection of the 3D printing object placed on the printing platform;
the 3D printing object to be placed refers to a three-dimensional object to be placed on the printing platform, and can be an object with a complex structure such as a part, other 3D printing objects can be placed on the printing platform in advance, and then the 3D printing object to be placed needs to be placed on the printing platform on which other 3D printing objects are placed. Referring to fig. 1, a schematic diagram of a printing platform on which a 3D printed object has been placed is shown, in the prior art, a first area and a second area in fig. 1 do not consider the 3D printed object to be placed, the first area is an idle area between the 3D printed objects that have been placed on the printing platform, and the second area is a corresponding idle area inside the 3D printed object that has been placed on the printing platform.
Step S120, respectively coding the two-dimensional projection and the placeable area of the 3D printed object through a Freeman chain code to obtain a first code corresponding to the 3D printed object and a second code corresponding to the placeable area, wherein the first code represents the outline of the two-dimensional projection of the 3D printed object, and the second code represents the outline of the placeable area;
according to the scheme, the building direction of the object can be determined, then the two-dimensional projection of the 3D printed object is coded according to the building direction of the object, the geometric information of the outline of the two-dimensional projection of the 3D printed object and the outline of the placeable area can be simplified through the coding mode of the Freeman chain code, and the subsequent outline intersection matching is facilitated. The Freeman chain codes may be Freeman chain codes in 8 neighborhoods or Freeman chain codes in 4 neighborhoods, see a schematic diagram of the Freeman chain codes in 8 neighborhoods shown in fig. 3, that is, coding is performed from 8 directions, 0 to 7 respectively indicate 8 included angles between the building direction and the horizontal direction according to the clockwise direction, and a difference between every two included angles is 45 degrees, according to the clockwise direction, 0 indicates 0 degree, 1 indicates 45 degrees, 2 indicates 90 degrees, 3 indicates 135 degrees, 4 indicates 180 degrees, 5 indicates 225 degrees, 6 indicates 270 degrees, and 7 indicates 315 degrees. It can be understood that the Freeman chain code of the 4 neighborhoods includes 4 directions of angles of 0-3, and the difference between every two angles is 90 degrees.
As an example, referring to the schematic diagram of the two-dimensional projection of the 3D printed object shown in fig. 4, for the two-dimensional projection, the two-dimensional projection is encoded by using a Freeman chain code in the neighborhood of 8, and the obtained first code is: 3432007076664422. the placeable regions may be encoded in the same manner as described above, resulting in a second code.
Because the two-dimensional projection is a polygon, the outline forming the two-dimensional projection includes a plurality of sub-outlines, the first code includes each first code element, each first code element represents that, in each sub-outline corresponding to the two-dimensional projection forming the 3D printed object, the trend of the sub-outline corresponding to the first code element, for example, the 2 nd first code element 4 in the first code represents that the angle corresponding to the trend of the sub-outline corresponding to the first code element is 180 °, that is, in the clockwise direction, the included angle between the sub-outline corresponding to the first code element and the horizontal direction is 180 °, and the 7 th first code element 7 represents that the trend of the sub-outline corresponding to the first code element is the corresponding angle 315 °, that is, in the clockwise direction, the included angle between the sub-outline corresponding to the first code element and the horizontal direction is 315 °.
Similarly, the second coding also includes each second coding element, and each second coding element represents the trend of the sub-outline corresponding to the second coding element in each sub-outline forming the placeable region.
Step S130, respectively carrying out differential processing on the first code and the second code to obtain a third code and a fourth code;
since the first code represents the absolute value of the contour of the 3D printed object and the second code represents the absolute value of the contour of the placeable area, the chain code difference method can be used to change the absolute value into a changed relative value since the absolute value changes due to the rotation of the object.
The process for implementing the differential processing on the first code and the second code to obtain the third code and the fourth code can be referred to as the following process:
M=Sa 1 a 2 a 3 a 4 ...a n ,a i ∈Z[0,7],i=1,2,.....n (1)
M′=Sa 1 ′a 2 ′a 3 ′a 4 ′...a n ′,a i ′∈Z[0′7],i=1,2,....,n (2)
wherein M is the original chain code, i.e. the first code or the second code, M' is the chain code after difference, i.e. the third code or the fourth code, S is the start point of the chain code, a i Is the ith term of the chain code M, i.e. the ith coding element, n is the length of the chain code, a i 'is the ith entry of the chain code M'. a is 1 ’=(a 1 -a n ) mod8 indicates that the first code element in M' is based on the first code element a in M 1 And the last coding element a n Determination of a i ’=(a i -a i-1 ) mod8 indicates that the other code elements in M' are determined based on two adjacent code elements in M.
As an example, for example, the first code shown in fig. 5 is 3432007076664422, and the third code obtained by differentiating the first code is 1177607177006060, the specific process is as follows: if the difference from the last first coding element to the first coding element in the first coding is 45 degrees, namely the difference is one step (one step represents 45 degrees), the step number from the last first coding element to the first coding element is used as the first coding element in the third coding; and then sequentially determining the step size of the phase difference between the first coding elements in the first codes to obtain a third code, for example, if the phase difference is 1 step size from 3 to 4, and if the phase difference is 7 step sizes from 1 to 4 and from 3 to 3, the third coding element in the third code is 7, and so on, to obtain a third code 1177607100677060.
In the prior art, the differential chain code (third coding or fourth coding) is usually normalized, i.e. the smallest integer in the chain code loop is found, and the starting points of the chain codes with the same shape are normalized. However, this method may cause the start point of the chain code to start from the middle of the polygon contour edge, breaking the continuity, and not facilitating the matching of non-identical but similar chain codes. In the matching process, continuity can be performed without interruption from the end points of the polygon, so in the scheme of the application, the third code or the fourth code is not normalized, and matching is performed from any end point of the polygon outline.
Step S140, determining a longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, where the longest continuous similar subsequence includes a similar first subsequence and a second subsequence, the first subsequence is a contour subsequence formed by a plurality of continuous first coding elements in the third code, and the second subsequence is a contour subsequence formed by a plurality of continuous second coding elements in the fourth code.
In the scheme of the application, the longest continuous similar subsequence of the third code and the fourth code can be determined directly according to the third code and the fourth code, wherein the longest continuous similar subsequence refers to a similar subsequence pair with the longest length in each similar subsequence pair in the third code and the fourth code, and one subsequence pair comprises one subsequence in the third code and one subsequence in the fourth code.
Optionally, the determining the longest consecutive similar subsequence of the third code and the fourth code according to the third code and the fourth code includes:
updating a preset initial similarity judgment matrix according to the third code and the fourth code to obtain an updated matrix, wherein for each element in the updated matrix, the value of the element represents the similarity between the coding element in the third code and the coding element in the fourth code and the sequence length of the longest continuous similar subsequence;
and determining the first subsequence and the second subsequence corresponding to the maximum element in the updated matrix as the longest continuous similar subsequence.
Each element in the initial similarity judgment matrix is 0, the matrix size of the initial similarity judgment matrix is (la + 1) × (lb + 1), and la and lb are the lengths of the third code and the fourth code respectively. One implementation manner of updating the preset initial similarity judgment matrix according to the third code and the fourth code to obtain an updated matrix is as follows: and (3) making a difference between each coding element in the third code and each corresponding coding element in the fourth code, and updating the initial similarity judgment matrix according to the following formula (4), wherein the formula (4) is as follows:
wherein C (i, j) is the ith row and jth column element of the initial similarity determination matrix, a [ i ] is the ith element of the a-chain code (third code), b [ j ] is the jth element of the b-chain code (fourth code), and e is the similarity threshold, based on formula (4), if the absolute value of the difference between one coding element in the third code and one coding element in the fourth code is not greater than the similarity threshold, the value C (i, j) of the corresponding element of the updated matrix is C (i-1, -1) +1, and if the absolute value of the difference between one coding element in the third code and one coding element in the fourth code is greater than the similarity threshold, the value C (i, j) of the corresponding element of the updated matrix is 0.
Optionally, an implementation manner of determining the first subsequence and the second subsequence corresponding to the maximum element in the updated matrix as the longest continuous similar subsequence is as follows: and taking the coding element corresponding to the maximum element in the updated matrix in the third coding as the end element of the first subsequence, and taking the coding element corresponding to the maximum element in the updated matrix in the fourth coding as the end element of the second subsequence, so that the subsequence formed by the coding elements corresponding to the first coding element to the maximum element in the third coding is the first subsequence, and the subsequence formed by the coding elements corresponding to the first coding element to the maximum element in the fourth coding is the second subsequence.
As an example, for example, when the third encoding is 2450, the fourth encoding is 1446, and the similarity threshold is 1, the updated matrix is:
wherein, if the maximum element in the updated matrix is 3, the first subsequence corresponding to 3 is 245, and the second subsequence is 144.
And S150, judging the intersection of the contours of the 3D printed object and the placeable area according to the longest continuous similar subsequence, wherein the intersection of the contours is non-intersection or intersection.
Optionally, the determining the intersection of the contours of the 3D printed object and the placeable area according to the longest continuous similar subsequence may include:
determining a first included angle between a first connecting line and a horizontal line according to a first connecting line between a first coding element and a last first coding element of a first subsequence in the longest continuous similar subsequence;
determining a second included angle between a second connecting line and the horizontal line according to a second connecting line between a first second coding element and a last second coding element of a second subsequence in the longest continuous similar subsequence;
rotating the 3D printed object and the placeable area according to the first included angle and the second included angle to obtain the rotated 3D printed object and the rotated placeable area, wherein the angle corresponding to the rotated 3D printed object is the same as the angle corresponding to the rotated placeable area;
determining the shortest distance between the rotated 3D printed object and the rotated placeable area;
and judging the profile intersection of the 3D printing object and the placeable area according to the shortest distance.
The purpose of rotating the 3D printed object and the placeable region is to correspond the rotated 3D printed object to the corresponding similar positions of the rotated placeable region, that is, the rotated 3D printed object and the corresponding similar sub-outlines of the rotated placeable region may correspond to each other.
Referring to the determination process of the first included angle (angle 1) and the second included angle (angle 2) shown in fig. 6, the longest continuous similar subsequence refers to similar outline areas of the 3D printed object and the placeable area (in the present application, the placeable area may also be referred to as a hole) in fig. 6. The shortest distance refers to the rotated 3D printed object and the rotated objectThe shortest distance among the distances between the corresponding positions of the placement areas can be specifically referred to the shortest distance diagram shown in fig. 7, and the shortest distance is represented as the shortest distance d in fig. 7 min As can be seen from fig. 7, the contour region and the non-similar region where the 3D printed object and the placeable region are similar need to be considered in the calculation process of the shortest distance.
After the shortest distance is determined, translating the rotated 3D printed object into the rotated placeable region according to the shortest distance, if an intersection exists between the contour of the translated 3D printed object and the contour of the rotated placeable region, determining that the contour intersection is intersected, if no intersection exists between the contour of the translated 3D printed object and the contour of the rotated placeable region, determining that the contour intersection is not intersected, and if an intersection exists between the contour of the translated 3D printed object and the contour of the rotated placeable region, determining that whether a position relationship between the contour of the translated 3D printed object and the contour of the rotated placeable region is represented by the intersection.
If an intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable region, it indicates that the 3D printed object is not matched with the placeable region, that is, the 3D printed object exceeds the size of the placeable region, and it is not appropriate to place the 3D printed object to be placed in the placeable region, in other words, the placeable region does not have enough space to place the 3D printed object, that is, the 3D printed object cannot be translated into the placeable region, it indicates that the contour of the 3D printed object and the contour of the placeable region are intersected, and at this time, the intersection area of the contour of the translated 3D printed object and the contour of the rotated placeable region is greater than 0; if no intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable area, it indicates that the 3D printed object is matched with the placeable area, that is, the 3D printed object does not exceed the size of the placeable area, and it is appropriate to place the 3D printed object to be placed in the placeable area, in other words, the placeable area has enough space to place the 3D printed object, that is, the 3D printed object can be translated into the placeable area, which means that the contour of the 3D printed object and the contour of the placeable area are not intersected, and at this time, the intersection area of the contour of the translated 3D printed object and the contour of the rotated placeable area is 0.
And step S160, if the intersection of the contours is not intersected, placing the 3D printing object in a placeable area.
Based on the foregoing description, since the placeable area and the 3D printed object are rotated, before the 3D printed object is placed in the placeable area, the placeable area and the 3D printed object need to be rotated back to the original positions, and the specific implementation manner is as follows: can place the region after rotatory and the 3D after the rotation prints object reverse rotation to make the angle that can place the region after the reverse rotation and correspond be the second contained angle, the 3D after the reverse rotation prints the angle that the object corresponds and be the second contained angle, can place the region after being about to rotate and resume to the position before the rotation, print the object with the 3D after the rotation and resume to revolve and can place the same position in region, can print the object with 3D at last and put to can place the region.
In an alternative of the present application, if the longest consecutive similar subsequence is at least two, for any one of the at least two longest consecutive similar subsequences, according to the longest consecutive similar subsequence, determining the intersection of the outlines of the 3D printed object and the placeable area, including:
s1, judging the intersection of the outlines of the 3D printed object and the placeable area according to any longest continuous similar subsequence;
and S2, if the intersection of the contours is intersection, judging the intersection of the contours corresponding to the other longest continuous similar subsequence according to the other longest continuous similar subsequence except any one of the longest continuous similar subsequences in the at least two longest continuous similar subsequences, and repeating the step S2 until the longest continuous similar subsequence corresponding to the intersection of the contours in the at least two longest continuous similar subsequences is judged to be disjointed.
If the intersection of the contours corresponding to each longest continuous similar subsequence in the at least two longest continuous similar subsequences is intersected, the intersection of the contours of the 3D printed object and the placeable area is indicated to be intersected, the 3D printed object to be placed can be obtained again, and a new two-dimensional matching process of the 3D printed object is performed.
If the printing platform includes a plurality of placeable regions, the step S1 and the step S2 specifically include:
s11, judging the profile intersection of the 3D printed object and the placeable area according to any one of at least two longest continuous similar subsequences corresponding to a first placeable area in the placeable areas;
s12, if the intersection of the contours is intersection, judging the intersection of the contours corresponding to the other longest continuous similar subsequence according to the other longest continuous similar subsequence except any one of the longest continuous similar subsequences in the at least two longest continuous similar subsequences, and repeating the step S12 until the longest continuous similar subsequence corresponding to the intersection of the contours in the at least two longest continuous similar subsequences is judged to be disjointed;
step S13, if there is no longest continuous similar subsequence corresponding to the disjoint outline intersection in the at least two longest continuous similar subsequences corresponding to the first placeable region, determining the outline intersection between the 3D printed object and the placeable region according to the longest continuous similar subsequence corresponding to the second placeable region in the plurality of placeable regions, and repeating steps S12 to S13 until there is a continuous similar subsequence corresponding to the placeable region corresponding to the disjoint outline intersection in the plurality of placeable regions.
If a plurality of placeable regions are included on the printing platform, continuous similar subsequences corresponding to the placeable regions can be determined from the placeable regions when the intersection of the contours is not intersected. When the placeable areas corresponding to the non-intersecting contours are determined, the placeable areas can be deleted from the placeable areas so as to update the placeable areas.
For a better illustration and understanding of the principles of the method provided by the present invention, the solution of the invention is described below with reference to an alternative embodiment. It should be noted that the specific implementation manner of each step in this specific embodiment should not be construed as a limitation to the scheme of the present invention, and other implementation manners that can be conceived by a person skilled in the art based on the principle of the scheme provided by the present invention should also be considered as within the protection scope of the present invention.
In this example, based on the foregoing description, the placeable regions in this application may also be referred to as holes, and for one printing platform, the printing platform may include a plurality of placeable regions, and the plurality of placeable regions may form a hole set, that is, the hole set includes a plurality of holes, each hole corresponds to one placeable region, each hole is a complete region on the printing platform, only one hole in the initial hole set, that is, the entire printing platform, needs to be updated each time a 3D printed object is placed in one hole, so that the hole is split into more new holes, thereby utilizing the gap (first region) between the 3D printed objects; the hole in the middle of the 3D printed object projection (second area) is also added to the hole set in order to utilize the hole of the 3D printed object itself.
Referring to fig. 8, a schematic flow chart of a two-dimensional matching method for a 3D printed object includes the following specific flow:
And 2, initializing the hole set by the printing platform, namely determining a current placeable area on the printing platform and determining a fourth code corresponding to the placeable area.
And 4, solving a similar subsequence set of the hole and the object, namely determining the longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, wherein the longest continuous similar subsequence is at least two longest continuous similar subsequences.
And 5, rotationally placing one of the at least two longest continuous similar subsequences according to the similar subsequences, namely rotating the placeable region and the 3D printed object according to the longest continuous similar subsequence, then determining the shortest distance between the rotated 3D printed object and the rotated placeable region, and translating the rotated 3D printed object to the rotated placeable region according to the shortest distance.
And 6, collision detection, also called intersection detection, namely determining whether an intersection point exists between the outline of the translated 3D printed object and the outline of the rotated placeable area according to the position of the translated 3D printed object.
And 7, if collision occurs, namely an intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable area, determining that the contour intersection is intersection, if the rest subsequences are not detected at the moment, namely the longest continuous similar subsequence is not judged to be the contour intersection, searching the next subsequence from the at least two longest continuous similar subsequences, and returning to the step 5 until the longest continuous similar subsequence without collision is searched.
If collision occurs, the similar subsequence of the current hole is detected, and the remaining holes are not detected, the next hole is searched in the current hole, the step S4 is returned until all holes in the hole set are detected, after all holes are detected, if all holes are not placed, the operation is stopped, the objects are deleted from the sequence of the objects to be sorted, the objects which cannot be placed are added, namely the 3D printing objects to be placed cannot be placed in the placeable area of the printing platform, the 3D printing objects to be placed are the objects which cannot be placed, and the 3D printing objects to be placed are moved from the sequence to be sorted to the sequence of the objects which cannot be placed.
If no collision exists, namely no intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable region, determining that the intersection of the contours is non-intersection, and reversely rotating the rotated placeable region and the rotated 3D printed object so as to enable the angle corresponding to the reversely rotated placeable region to be the second included angle and the angle corresponding to the reversely rotated 3D printed object to be the second included angle; and placing the 3D printed object after the reverse rotation into the placeable area after the reverse rotation, and then executing the step 8.
And 8, updating the hole set, deleting the object from the object sequence to be sorted, namely, indicating that the 3D printed object to be placed is placed in the placeable area of the printing platform, deleting the 3D printed object to be placed from the object sequence to be sorted, and updating the hole set, namely deleting the placeable area of the 3D printed object to be placed.
With the solution of the invention, the projected outline of the 3D printed object is used to match the outline of the unoccupied internal areas (i.e. holes and gaps), both using Freeman coding to digitize the representation of the outline shape to facilitate matching. The method of using continuous similar subsequences can more accurately match between chain codes, and the dissimilar subsequences are also included in the range of distance calculation.
Based on the same principle as the method shown in fig. 2, an embodiment of the present invention further provides a two-dimensional matching apparatus 20 for a 3D printed object, as shown in fig. 9, the two-dimensional matching apparatus 20 for a 3D printed object may include an obtaining module 210, an encoding module 220, a difference module 230, a longest continuous similar subsequence determining module 240, a contour intersection determining module 250, and a placing module 260, where:
the acquiring module 210 is configured to acquire a 3D printed object to be placed and a placeable area on the printing platform, where the placeable area includes an area on the printing platform except an area occupied by two-dimensional projection of the 3D printed object placed on the printing platform;
the encoding module 220 is configured to encode the two-dimensional projection and the placeable region of the 3D printed object by using the Freeman chain code, respectively, to obtain a first code corresponding to the 3D printed object and a second code corresponding to the placeable region;
the first codes represent the outline of the two-dimensional projection of the 3D printed object, the second codes represent the outline of the placeable area, the first codes comprise first code elements, the second codes comprise second code elements, each first code element represents the trend of the sub-outline corresponding to the two-dimensional projection of the 3D printed object, and each second code element represents the trend of the sub-outline corresponding to the second code element in the sub-outline corresponding to the placeable area;
a difference module 230, configured to perform difference processing on the first code and the second code, respectively, to obtain a third code and a fourth code;
a longest continuous similar subsequence determining module 240, configured to determine a longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, where the longest continuous similar subsequence includes a similar first subsequence and a second subsequence, the first subsequence is a contour subsequence formed by multiple consecutive first code elements in the third code, and the second subsequence is a contour subsequence formed by multiple consecutive second code elements in the fourth code;
a contour intersection judging module 250, configured to judge, according to the longest continuous similar subsequence, a contour intersection between the 3D printed object and the placeable region, where the contour intersection is non-intersection or intersection;
and the placing module 260 is used for placing the 3D printed object in the placeable area when the intersection of the outlines is not intersected.
Optionally, when determining the longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, the contour intersection determining module 250 is specifically configured to:
updating a preset initial similarity judgment matrix according to the third code and the fourth code to obtain an updated matrix, wherein for each element in the updated matrix, the value of the element represents the similarity between the coding element in the third code and the coding element in the fourth code and the sequence length of the longest continuous similar subsequence;
and determining the first subsequence and the second subsequence corresponding to the maximum element in the updated matrix as the longest continuous similar subsequence.
Optionally, when the contour intersection determining module 250 determines the intersection of the contours of the 3D printed object and the placeable area according to the longest continuous similar subsequence, the contour intersection determining module is specifically configured to:
determining a first included angle between a first connecting line and a horizontal line according to a first connecting line between a first coding element and a last first coding element of a first subsequence in the longest continuous similar subsequence;
determining a second included angle between a second connecting line and a horizontal line according to a second connecting line between a first second coding element and a last second coding element of a second subsequence in the longest continuous similar subsequence;
rotating the 3D printed object and the placeable area according to the first included angle and the second included angle to obtain the rotated 3D printed object and the rotated placeable area, wherein the angle corresponding to the rotated 3D printed object is the same as the angle corresponding to the rotated placeable area;
determining the shortest distance between the rotated 3D printed object and the rotated placeable area;
and judging the intersection of the contour of the 3D printed object and the placeable area according to the shortest distance.
Optionally, when the contour intersection determining module 250 determines the intersection between the 3D printed object and the placeable area according to the shortest distance, the contour intersection determining module is specifically configured to:
and translating the rotated 3D printed object to the rotated placeable area according to the shortest distance, judging that the intersection of the contours is intersected if an intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable area, and judging that the intersection of the contours is not intersected if an intersection point does not exist between the contour of the translated 3D printed object and the contour of the rotated placeable area.
Optionally, if the intersection of the contours is not intersected, the placing module 260 is specifically configured to, when placing the 3D printed object in the placeable area:
reversely rotating the rotated placeable area so that the angle corresponding to the reversely rotated placeable area is a second included angle;
and placing the 3D printed object in a placeable area.
Optionally, if the longest continuous similar subsequence is at least two, for any one of the at least two longest continuous similar subsequences, when the contour intersection judging module 250 judges the contour intersection between the 3D printed object and the placeable area according to the longest continuous similar subsequence, the method specifically includes:
the first processing unit is used for judging the intersection of the outlines of the 3D printed object and the placeable area according to any longest continuous similar subsequence;
and the second processing unit is configured to, when the intersection of the contours is intersection, determine, according to another longest consecutive similar subsequence except any one of the longest consecutive similar subsequences, the intersection of the contours corresponding to the other longest consecutive similar subsequence, and repeat the processing procedure of the second processing unit until the longest consecutive similar subsequence corresponding to the intersection of the contours in the at least two longest consecutive similar subsequences is determined to be disjoint.
Optionally, if the printing platform includes a plurality of placeable regions, the steps of the first processing unit and the second processing unit specifically include:
the third processing unit is used for judging the intersection of the contour of the 3D printed object and the placeable area according to any one of at least two longest continuous similar subsequences corresponding to the first placeable area in the plurality of placeable areas;
a fourth processing unit, configured to, when the intersections of the contours are intersections, determine, according to another longest consecutive similar subsequence except any one of the longest consecutive similar subsequences, an intersection of the contours corresponding to the other longest consecutive similar subsequence, and repeat the processing procedure of the fourth processing unit until the longest consecutive similar subsequence corresponding to the intersection of the contours in the at least two longest consecutive similar subsequences is determined to be the intersection;
a fifth processing unit, configured to, when there is no longest continuous similar subsequence corresponding to the disjoint profile intersection in the at least two longest continuous similar subsequences corresponding to the first placeable region, determine the profile intersection between the 3D printed object and the placeable region according to the longest continuous similar subsequence corresponding to the second placeable region of the multiple placeable regions, and repeat the processing procedures from the fourth processing unit to the fifth processing unit until it is determined that there is a continuous similar subsequence corresponding to the placeable region corresponding to the disjoint profile intersection in the multiple placeable regions.
The two-dimensional matching device for a 3D printed object according to the embodiment of the present invention can execute the two-dimensional matching method for a 3D printed object according to the embodiment of the present invention, and the implementation principles thereof are similar, the actions performed by each module and unit in the two-dimensional matching device for a 3D printed object according to the embodiments of the present invention correspond to the steps in the two-dimensional matching method for a 3D printed object according to the embodiments of the present invention, and the detailed functional description of each module of the two-dimensional matching device for a 3D printed object may specifically refer to the description in the two-dimensional matching method for a corresponding 3D printed object shown in the foregoing text, and will not be described herein again.
The two-dimensional matching device for the 3D printed object may be a computer program (including program code) running in a computer device, for example, the two-dimensional matching device for the 3D printed object is an application software; the apparatus may be used to perform the corresponding steps in the methods provided by the embodiments of the present invention.
In some embodiments, the two-dimensional matching Device for a 3D printed object provided by the embodiments of the present invention may be implemented by combining hardware and software, and as an example, the two-dimensional matching Device for a 3D printed object provided by the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to perform the two-dimensional matching method for a 3D printed object provided by the embodiments of the present invention, for example, the processor in the form of a hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, programmable Logic Devices (PLDs), complex Programmable Logic Devices (CPLDs), field Programmable Gate Arrays (FPGAs), or other electronic elements.
In other embodiments, the two-dimensional matching apparatus for 3D printed objects provided by the embodiments of the present invention may be implemented in a software manner, and fig. 9 illustrates the two-dimensional matching apparatus for 3D printed objects stored in a memory, which may be software in the form of programs and plug-ins, and includes a series of modules, including an obtaining module 210, an encoding module 220, a difference module 230, a longest continuous similarity subsequence determining module 240, a contour intersection judging module 250, and a placing module 260, for implementing the two-dimensional matching method for 3D printed objects provided by the embodiments of the present invention.
The modules described in the embodiments of the present invention may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
Based on the same principle as the method shown in the embodiment of the present invention, an embodiment of the present invention also provides an electronic device, which may include but is not limited to: a processor and a memory; a memory for storing a computer program; a processor for executing the method according to any of the embodiments of the present invention by calling the computer program.
In an alternative embodiment, an electronic device is provided, as shown in fig. 10, the electronic device 4000 shown in fig. 10 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present invention.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 4003 is used for storing application program codes (computer programs) for executing the scheme of the present invention, and execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in the foregoing method embodiments.
The electronic device may also be a terminal device, and the electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the application scope of the embodiment of the present invention.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer is enabled to execute the corresponding content in the foregoing method embodiment.
According to another aspect of the invention, there is also provided a computer program product or computer program comprising 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 to cause the computer device to perform the methods provided in the various embodiment implementations described above.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It should be understood that the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Embodiments of the present invention provide a computer readable storage medium that may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer-readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
The foregoing description is only exemplary of the preferred embodiments of the invention and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents is encompassed without departing from the spirit of the disclosure. For example, the above features and (but not limited to) features having similar functions disclosed in the present invention are mutually replaced to form the technical solution.
Claims (10)
1. A two-dimensional matching method for a 3D printed object is characterized by comprising the following steps:
the method comprises the steps of obtaining a 3D printing object to be placed and a placeable area on a printing platform, wherein the placeable area comprises an area on the printing platform except for an area occupied by two-dimensional projection of the 3D printing object placed on the printing platform;
respectively coding the two-dimensional projection of the 3D printed object and the placeable region through a Freeman chain code to obtain a first code corresponding to the 3D printed object and a second code corresponding to the placeable region;
the first codes represent the outline of the two-dimensional projection of the 3D printed object, the second codes represent the outline of the placeable area, the first codes comprise first code elements, the second codes comprise second code elements, each first code element represents the trend of the sub-outline corresponding to the two-dimensional projection of the 3D printed object, and each second code element represents the trend of the sub-outline corresponding to the second code element in the sub-outline corresponding to the placeable area;
respectively carrying out differential processing on the first code and the second code to obtain a third code and a fourth code;
determining a longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, wherein the longest continuous similar subsequence comprises a similar first subsequence and a second subsequence, the first subsequence is a contour subsequence formed by a plurality of continuous first coding elements in the third code, and the second subsequence is a contour subsequence formed by a plurality of continuous second coding elements in the fourth code;
according to the longest continuous similar subsequence, judging the profile intersection of the 3D printing object and the placeable area, wherein the profile intersection is not intersected or intersected;
and if the intersection of the outlines is not intersected, placing the 3D printing object in the placeable area.
2. The method of claim 1, wherein determining the longest consecutive similar subsequences of the third code and the fourth code from the third code and the fourth code comprises:
updating a preset initial similarity judgment matrix according to the third code and the fourth code to obtain an updated matrix, wherein for each element in the updated matrix, the value of the element represents the similarity between the coding element in the third code and the coding element in the fourth code and the sequence length of the longest continuous similar subsequence;
and determining the first subsequence and the second subsequence corresponding to the maximum element in the updated matrix as the longest continuous similar subsequence.
3. The method according to claim 1, wherein said determining the intersection of the contours of the 3D printed object and the placeable area from the longest continuous similar subsequence comprises:
determining a first included angle between a first connecting line and a horizontal line according to a first connecting line between a first coding element and a last first coding element of a first subsequence in the longest continuous similar subsequence;
determining a second included angle between a second connection line and the horizontal line according to a second connection line between a first second coding element and a last second coding element of a second subsequence in the longest continuous similar subsequence;
rotating the 3D printed object and the placeable area according to the first included angle and the second included angle to obtain a rotated 3D printed object and a rotated placeable area, wherein the angle corresponding to the rotated 3D printed object is the same as the angle corresponding to the rotated placeable area;
determining the shortest distance between the rotated 3D printed object and the rotated placeable area;
and judging the intersection of the outlines of the 3D printed object and the placeable area according to the shortest distance.
4. The method according to claim 3, wherein the determining the intersection of the 3D printed object and the outline of the placeable area according to the shortest distance comprises:
translating the rotated 3D printed object to the rotated placeable area according to the shortest distance, if an intersection point exists between the contour of the translated 3D printed object and the contour of the rotated placeable area, judging that the contour intersection is intersected, and if an intersection point does not exist between the contour of the translated 3D printed object and the contour of the rotated placeable area, judging that the contour intersection is not intersected.
5. The method of claim 4, wherein if the contour intersections are disjoint, the placing the 3D printed object in the placeable area comprises:
reversely rotating the rotated placeable area and the rotated 3D printed object, so that the angle corresponding to the reversely rotated placeable area is the second included angle, and the angle corresponding to the reversely rotated 3D printed object is the second included angle;
and placing the 3D printed object after the reverse rotation to the placeable area after the reverse rotation.
6. The method according to any one of claims 1 to 5, wherein if the longest continuous similar subsequence is at least two, for any one of the at least two longest continuous similar subsequences, the determining the intersection of the outlines of the 3D printed object and the placeable area according to the longest continuous similar subsequence comprises:
s1, judging the profile intersection of the 3D printed object and the placeable area according to any one longest continuous similar subsequence;
and S2, if the contour intersection is intersection, judging the contour intersection corresponding to the other longest continuous similar subsequence according to the other longest continuous similar subsequence except any one of the longest continuous similar subsequences in the at least two longest continuous similar subsequences, and repeating the step S2 until the longest continuous similar subsequence corresponding to the condition that the contour intersection in the at least two longest continuous similar subsequences is not intersected is judged.
7. The method according to claim 6, wherein if the printing platform includes a plurality of placeable regions, the steps S1 and S2 specifically include:
s11, judging the contour intersection of the 3D printed object and the placeable area according to any one of at least two longest continuous similar subsequences corresponding to a first placeable area in the placeable areas;
s12, if the contour intersection is intersection, judging the contour intersection corresponding to the other longest continuous similar subsequence according to the other longest continuous similar subsequence except any one of the longest continuous similar subsequences in the at least two longest continuous similar subsequences, and repeating the step S12 until the longest continuous similar subsequence corresponding to the condition that the contour intersection in the at least two longest continuous similar subsequences is not intersected is judged;
step S13, if there is no longest continuous similar subsequence corresponding to the disjoint outline intersection in the at least two longest continuous similar subsequences corresponding to the first placeable region, determining the outline intersection between the 3D printed object and the placeable region according to the longest continuous similar subsequence corresponding to the second placeable region in the plurality of placeable regions, and repeating the steps S12 to S13 until there is a continuous similar subsequence corresponding to the placeable region corresponding to the disjoint outline intersection in the plurality of placeable regions.
8. A two-dimensional matching device for 3D printed objects, comprising:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a 3D printing object to be placed and a placeable area on a printing platform, and the placeable area comprises an area on the printing platform except for an area occupied by two-dimensional projection of the 3D printing object placed on the printing platform;
the coding module is used for coding the two-dimensional projection of the 3D printed object and the placeable region through Freeman chain codes respectively to obtain a first code corresponding to the 3D printed object and a second code corresponding to the placeable region;
the first codes represent the outline of the two-dimensional projection of the 3D printed object, the second codes represent the outline of the placeable area, the first codes comprise first code elements, the second codes comprise second code elements, each first code element represents each sub-outline corresponding to the two-dimensional projection of the 3D printed object, the trend of the sub-outline corresponding to the first code element is in the first code element, and each second code element represents the trend of the sub-outline corresponding to the second code element in each sub-outline forming the placeable area;
the difference module is used for respectively carrying out difference processing on the first code and the second code to obtain a third code and a fourth code;
a longest continuous similar subsequence determining module, configured to determine a longest continuous similar subsequence of the third code and the fourth code according to the third code and the fourth code, where the longest continuous similar subsequence includes a similar first subsequence and a second subsequence, the first subsequence is a contour subsequence formed by a plurality of consecutive first code elements in the third code, and the second subsequence is a contour subsequence formed by a plurality of consecutive second code elements in the fourth code;
the contour intersection judging module is used for judging the contour intersection of the 3D printed object and the placeable area according to the longest continuous similar subsequence, and the contour intersection is non-intersection or intersection;
and the placing module is used for placing the 3D printed object in the placeable area when the intersection of the contours is not intersected.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210798281.4A CN115195126B (en) | 2022-07-06 | 2022-07-06 | Two-dimensional matching method and device for 3D printed object, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210798281.4A CN115195126B (en) | 2022-07-06 | 2022-07-06 | Two-dimensional matching method and device for 3D printed object, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115195126A true CN115195126A (en) | 2022-10-18 |
CN115195126B CN115195126B (en) | 2023-02-24 |
Family
ID=83580710
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210798281.4A Active CN115195126B (en) | 2022-07-06 | 2022-07-06 | Two-dimensional matching method and device for 3D printed object, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115195126B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116968316A (en) * | 2023-09-22 | 2023-10-31 | 易加三维增材技术(杭州)有限公司 | Model collision detection method, device, storage medium and electronic equipment |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5943235A (en) * | 1995-09-27 | 1999-08-24 | 3D Systems, Inc. | Rapid prototyping system and method with support region data processing |
US5995668A (en) * | 1995-10-25 | 1999-11-30 | U.S. Philips Corporation | Segmented picture coding method and system, and corresponding decoding method and system |
US20150287169A1 (en) * | 2014-04-08 | 2015-10-08 | Roland Dg Corporation | Image projection system and image projection method |
US20170015058A1 (en) * | 2015-07-15 | 2017-01-19 | Roland Dg Corporation | Three-dimensional printing apparatus and three-dimensional object printing method |
CN106898050A (en) * | 2017-02-07 | 2017-06-27 | 浙江大学 | A kind of grid model adaptive layered method based on annular neighborhood reference contour line |
CN107247985A (en) * | 2017-05-27 | 2017-10-13 | 浙江隐齿丽医学技术有限公司 | Coding, positioning and the recognition methods of New Two Dimensional code |
CN107571506A (en) * | 2017-08-30 | 2018-01-12 | 华中科技大学 | A kind of increasing material manufacturing method of adaptive layered |
CN109955486A (en) * | 2019-03-14 | 2019-07-02 | 浙江大学 | It is a kind of based on dot matrixed with sparse compression processing structural model 3D printing method |
CN110533770A (en) * | 2019-08-20 | 2019-12-03 | 厦门大学 | A kind of 3D printing dicing method towards implied expression medical model |
AU2018412530A1 (en) * | 2018-03-08 | 2020-08-20 | Siemens Medical Solutions Usa, Inc. | Systems and methods of three-dimensional printing of collimators using additive approaches |
CN112046006A (en) * | 2020-08-28 | 2020-12-08 | 南京衍构科技有限公司 | 3D printing scanning filling path planning method for thin-wall part |
CN112677488A (en) * | 2021-01-25 | 2021-04-20 | 中国科学院空间应用工程与技术中心 | Printing path planning method and system and 3D printer |
US20210276249A1 (en) * | 2020-03-03 | 2021-09-09 | Bmf Material Technology Inc. | Immersion multi-material projection micro stereolithography |
CN113878879A (en) * | 2021-09-29 | 2022-01-04 | 陈付辉 | Slicing method for various 3D printing processes |
CN114434802A (en) * | 2021-12-20 | 2022-05-06 | 西安理工大学 | 3D printing contour offset filling path planning algorithm |
-
2022
- 2022-07-06 CN CN202210798281.4A patent/CN115195126B/en active Active
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5943235A (en) * | 1995-09-27 | 1999-08-24 | 3D Systems, Inc. | Rapid prototyping system and method with support region data processing |
US5995668A (en) * | 1995-10-25 | 1999-11-30 | U.S. Philips Corporation | Segmented picture coding method and system, and corresponding decoding method and system |
US20150287169A1 (en) * | 2014-04-08 | 2015-10-08 | Roland Dg Corporation | Image projection system and image projection method |
US20170015058A1 (en) * | 2015-07-15 | 2017-01-19 | Roland Dg Corporation | Three-dimensional printing apparatus and three-dimensional object printing method |
CN106898050A (en) * | 2017-02-07 | 2017-06-27 | 浙江大学 | A kind of grid model adaptive layered method based on annular neighborhood reference contour line |
CN107247985A (en) * | 2017-05-27 | 2017-10-13 | 浙江隐齿丽医学技术有限公司 | Coding, positioning and the recognition methods of New Two Dimensional code |
CN107571506A (en) * | 2017-08-30 | 2018-01-12 | 华中科技大学 | A kind of increasing material manufacturing method of adaptive layered |
AU2018412530A1 (en) * | 2018-03-08 | 2020-08-20 | Siemens Medical Solutions Usa, Inc. | Systems and methods of three-dimensional printing of collimators using additive approaches |
CN109955486A (en) * | 2019-03-14 | 2019-07-02 | 浙江大学 | It is a kind of based on dot matrixed with sparse compression processing structural model 3D printing method |
CN110533770A (en) * | 2019-08-20 | 2019-12-03 | 厦门大学 | A kind of 3D printing dicing method towards implied expression medical model |
US20210276249A1 (en) * | 2020-03-03 | 2021-09-09 | Bmf Material Technology Inc. | Immersion multi-material projection micro stereolithography |
CN112046006A (en) * | 2020-08-28 | 2020-12-08 | 南京衍构科技有限公司 | 3D printing scanning filling path planning method for thin-wall part |
CN112677488A (en) * | 2021-01-25 | 2021-04-20 | 中国科学院空间应用工程与技术中心 | Printing path planning method and system and 3D printer |
CN113878879A (en) * | 2021-09-29 | 2022-01-04 | 陈付辉 | Slicing method for various 3D printing processes |
CN114434802A (en) * | 2021-12-20 | 2022-05-06 | 西安理工大学 | 3D printing contour offset filling path planning algorithm |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116968316A (en) * | 2023-09-22 | 2023-10-31 | 易加三维增材技术(杭州)有限公司 | Model collision detection method, device, storage medium and electronic equipment |
CN116968316B (en) * | 2023-09-22 | 2024-02-20 | 易加三维增材技术(杭州)有限公司 | Model collision detection method, device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN115195126B (en) | 2023-02-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20180121789A1 (en) | Data processing method and apparatus | |
WO2022105125A1 (en) | Image segmentation method and apparatus, computer device, and storage medium | |
CN115195126B (en) | Two-dimensional matching method and device for 3D printed object, electronic equipment and medium | |
CN115359219B (en) | Virtual world virtual image processing method and device | |
CN111767965B (en) | Image matching method and device, electronic equipment and storage medium | |
CN112085033A (en) | Template matching method and device, electronic equipment and storage medium | |
US10983983B2 (en) | Entity resolution based on multiple attributes | |
CN112729166B (en) | Structured light encoding method, encoding and decoding method, device, computer device and medium | |
CN116612204B (en) | Image generation method, training device, electronic equipment and storage medium | |
CN112819893A (en) | Method and device for constructing three-dimensional semantic map | |
CN111680680A (en) | Object code positioning method and device, electronic equipment and storage medium | |
CN111145293B (en) | Method and device for reconstructing outline of house-type graph and electronic equipment | |
CN112396048A (en) | Picture information extraction method and device, computer equipment and storage medium | |
US8630477B2 (en) | Electronic device and method for outputting measurement data | |
WO2016121998A1 (en) | Information matching device and method therefor | |
CN112288759A (en) | Boundary extraction method, device, equipment and storage medium | |
CN107092702B (en) | Geographic information element position comparison checking method and device based on overlapping proportion | |
US9911229B2 (en) | Transmission and configuration of three dimensional digital content | |
CN113066006B (en) | Airborne laser radar point cloud data resolving method and device and electronic equipment | |
CN110807119B (en) | Face duplicate checking method and device | |
CN116758198B (en) | Image reconstruction method, device, equipment and storage medium | |
CN116402842B (en) | Edge defect detection method, device, computer equipment and storage medium | |
CN110334681B (en) | Finger vein identity recognition method and system based on block chain | |
CN117739993B (en) | Robot positioning method and device, robot and storage medium | |
CN113780313A (en) | Line feature extraction method and device and electronic equipment |
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 |