CN115195126B - 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 PDF

Info

Publication number
CN115195126B
CN115195126B CN202210798281.4A CN202210798281A CN115195126B CN 115195126 B CN115195126 B CN 115195126B CN 202210798281 A CN202210798281 A CN 202210798281A CN 115195126 B CN115195126 B CN 115195126B
Authority
CN
China
Prior art keywords
code
subsequence
placeable
printed object
intersection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210798281.4A
Other languages
Chinese (zh)
Other versions
CN115195126A (en
Inventor
杨依哲
刘兵山
李浩琛
张可鑫
王功
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Technology and Engineering Center for Space Utilization of CAS
Original Assignee
Technology and Engineering Center for Space Utilization of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Technology and Engineering Center for Space Utilization of CAS filed Critical Technology and Engineering Center for Space Utilization of CAS
Priority to CN202210798281.4A priority Critical patent/CN115195126B/en
Publication of CN115195126A publication Critical patent/CN115195126A/en
Application granted granted Critical
Publication of CN115195126B publication Critical patent/CN115195126B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B29WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
    • B29CSHAPING 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/00Additive 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/30Auxiliary operations or equipment
    • B29C64/386Data acquisition or data processing for additive manufacturing
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B29WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
    • B29CSHAPING 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/00Additive 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/30Auxiliary operations or equipment
    • B29C64/386Data acquisition or data processing for additive manufacturing
    • B29C64/393Data acquisition or data processing for additive manufacturing for controlling or regulating additive manufacturing processes
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B33ADDITIVE MANUFACTURING TECHNOLOGY
    • B33YADDITIVE 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/00Data acquisition or data processing for additive manufacturing
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B33ADDITIVE MANUFACTURING TECHNOLOGY
    • B33YADDITIVE 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/00Data acquisition or data processing for additive manufacturing
    • B33Y50/02Data acquisition or data processing for additive manufacturing for controlling or regulating additive manufacturing processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/20Contour coding, e.g. using detection of edges

Abstract

The invention relates to a two-dimensional matching method, a two-dimensional matching device, electronic equipment and a two-dimensional matching medium for a 3D printed object, wherein the method comprises the following steps of: 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 contour intersection judgment based on the discontinuous similar sequence can be avoided through the longest continuous similar subsequence.

Description

Two-dimensional matching method and device for 3D printed object, electronic equipment and medium
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 printed objects 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 a 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, electronic equipment and a two-dimensional matching 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 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 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 invention has the beneficial effects that: the method comprises the steps of judging the outline intersection of a 3D printed object and a placeable area based on a first code corresponding to the projection of the 3D printed object on a printing platform and a second code of the placeable area, wherein the first code is a code of two-dimensional projection, and the placeable area comprises an area on the printing platform except for an area occupied by the two-dimensional projection of the 3D printed object placed on the printing platform. Meanwhile, the outline of the two-dimensional projection of the 3D printed object and the outline of the placeable area are respectively represented by the third code and the fourth code, so that subsequent outline intersection judgment can be facilitated, and the influence on the matching effect of subsequent 3D printed objects and the placeable area due to the fact that the outline intersection judgment is carried out based on a discontinuous similar sequence can be avoided through 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 rotated subsequence and a second rotated subsequence, wherein the angle corresponding to the first rotated subsequence is the same as the angle corresponding to the second rotated subsequence;
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 the shortest distance determined after the 3D printed object and the placeable area are rotated can avoid that part of the position points in the outline corresponding to the 3D printed object exceed the outline of the placeable area, so that the intersection of the outlines 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 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 contours of the 3D printed object and the placeable area 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 contour corresponding to one of the at least two 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 longest continuous similar subsequences corresponding to the non-intersected subsequences, and the utilization rate of the printing platform is further improved.
Further, if the printing platform includes a plurality of placeable areas, 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 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 S12 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;
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 regions, the continuous similar subsequence corresponding to the corresponding placeable region can be judged when the intersection of the contours is not intersected from the plurality of placeable regions, so as to fully consider all the placeable regions on the printing platform.
In a second aspect, the present invention provides a two-dimensional matching apparatus for 3D printed objects, 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 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 and the placeable region of the 3D printed object through a 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 all first code elements, the second codes comprise all second code elements, each first code element represents the trend of the sub-outline corresponding to the first code element in each 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 an outline subsequence formed by a plurality of continuous first code elements in the third code, and the second subsequence is an outline subsequence formed by a plurality of continuous second code elements in the fourth code;
the contour intersection judging module is used for judging the intersection of the 3D printed object and the contour of the placeable area according to the longest continuous similar subsequence, wherein the intersection of the contours 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 implements the two-dimensional matching method for 3D printed objects of the present application when executing the computer program.
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 illustrating a shortest distance according to an embodiment of the present invention;
FIG. 8 is a schematic flow chart of a further method for two-dimensional matching of a 3D printed object 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. The following several specific embodiments may be combined with each other, 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 a 3D printed object is provided, and this 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 the 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 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 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;
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;
wherein, the 3D who waits to put prints the object and indicates the three-dimensional object that need place on print platform, can be the object of more complex structures such as part, can place other 3D in advance on this print platform and print the object, then the 3D who waits to put prints the object and need place on the print platform who has placed other 3D and print the object. Referring to a schematic diagram of a printing platform on which a 3D printed object has been placed shown in fig. 1, in the prior art, a first area and a second area in fig. 1 do not consider a 3D printed object to be placed, the first area is an idle area between 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 geometrical 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 a coding mode of Freeman chain codes, and the subsequent outline intersection matching is convenient to perform. 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 is understood that the Freeman chain code of the 4 neighborhoods includes angles of 4 directions 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 areas may be encoded in the same manner as described above, resulting in a second encoding.
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 code also includes each second 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 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)
Figure BDA0003733010760000101
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 taken 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 outline 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 multiple continuous first code elements in the third code, and the second subsequence is a contour subsequence formed by multiple continuous second code 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:
Figure BDA0003733010760000121
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 code is 2450, the fourth code is 1446, and the similarity threshold is 1, the updated matrix is:
Figure BDA0003733010760000122
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 intersection of the contour of the 3D printed 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.
See fig. 6 for a process of determining the first angle (angle 1) and the second angle (angle 2), wherein 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 shortest distance among the distances between the rotated 3D printed object and the corresponding position of the rotated placeable area, and in particular, refer 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 printing 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 region, it indicates that the 3D printed object and the placeable region are matched, that is, the 3D printed object does not exceed the size of the placeable region, it is appropriate to place the 3D printed object to be placed in the placeable region, in other words, the placeable region has enough space to place the 3D printed object, that is, the 3D printed object can be translated into the placeable region, which indicates that the contour of the 3D printed object and the contour of the placeable region 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 region 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 regional and the rotatory 3D after printing object reverse rotation after will rotating to make the angle that can place the regional correspondence after the reverse rotation 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 will rotating and resume to the position before the rotation, print the object with the 3D after will rotating and resume to revolve and can place regional the same position, can place the object with 3D at last and put to can place the region.
In an alternative of the present application, if the longest continuous similar subsequence is at least two, for any one of the at least two longest continuous similar subsequences, determining the intersection of the contours of the 3D printed object and the placeable area 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;
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 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.
If a plurality of placeable regions are included on the printing platform, continuous similar subsequences corresponding to placeable regions corresponding to disjoint contour intersections can be determined from the placeable regions. 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 those 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 areas in this application may also be referred to as holes, and for one printing platform, the printing platform may include a plurality of placeable areas, and the plurality of placeable areas may form one hole set, that is, the hole set includes a plurality of holes, each hole corresponds to one placeable area, each hole is a complete area 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 printing object is placed in one hole, so that the hole is split into more new holes, thereby utilizing the gap (the first area) between the 3D printing objects; a hole in the middle of the 3D printed object projection (second area) is also added to the hole set in order to use the 3D printed object's own hole.
Referring to fig. 8, a schematic flow chart of a two-dimensional matching method for a 3D printed object includes the following specific flow:
step 1, generating object projection contour information, namely determining a third code corresponding to a 3D printing object to be placed.
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.
Step 3, judging whether the hole set or the object placed with the hole set is 0, wherein the hole set can comprise a plurality of placeable areas, if the hole set is 0, the placeable areas are not used for placing the 3D printed object to be placed, all the placeable areas in the hole set are placed with other 3D printed objects, and the algorithm is stopped at the moment; if the hole set is not 0, indicating that the hole set still has an unused placeable area, namely, the hole set has a placeable area in which a 3D printed object to be placed can be placed, executing step 4; if the object to be placed is 0, it indicates that no 3D printing object needs to be placed on the printing platform, the algorithm is stopped, and if the object to be placed is not 0, it indicates that there is another 3D printing object that needs to be placed on the printing platform, step 4 is executed.
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 area, determining that the contour intersection is non-intersection, and reversely rotating the rotated placeable area and the rotated 3D printed object so as to enable the angle corresponding to the reversely rotated placeable area 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 to 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 spaces), both using Freeman coding to digitize a representation of the outline shape to facilitate matching. The method of utilizing continuous similar subsequences can more accurately match between chain codes, and also can bring dissimilar subsequences into 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 similarity subsequence determining module 240, a contour intersection judging 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 through a 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 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;
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 contour intersection between 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:
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.
Optionally, if the intersection of the contours is not intersected, when the placing module 260 places the 3D printed object in the placeable area, the placing module is specifically configured to:
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 longest continuous similar subsequence in 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;
a second processing unit, 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, intersection of 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 judged intersection of contours in the at least two longest consecutive similar subsequences is 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 outline intersection in at least two longest continuous similar subsequences corresponding to the first placeable region, determine 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 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 outline 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 principle is similar, the actions executed 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 function 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 by way of 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 execute 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 components.
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 does not in some cases 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 further 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 a 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.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 10, but that does not indicate only one bus or one type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device 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 device, 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 thereto.
The memory 4003 is used for storing application program codes (computer programs) for executing the aspects of the present invention, and the 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 range of the embodiment of the present invention.
Embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments.
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, so that the computer device executes the method provided in the implementation modes of the various embodiments.
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 which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer readable storage medium provided by the embodiments of the present invention may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. 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 combinations of features described above or equivalents thereof 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 (9)

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 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;
performing differential processing on the first code and the second code respectively 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;
if the intersection of the contours is not intersected, placing the 3D printing object in the placeable area;
the determining the intersection of the outlines of the 3D printed object and the placeable area according to the longest continuous similar subsequence includes:
determining a first included angle between a first connecting line and a horizontal line according to the first connecting line between the first coding element and the last first coding element of the 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 profile intersection of the 3D printed object and the placeable area according to the shortest distance.
2. The method of claim 1, wherein determining the longest consecutive similar subsequences of the third code and the fourth code according to 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 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.
4. The method of claim 3, wherein if the contour intersections are disjoint, said 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 into the placeable area after the reverse rotation.
5. The method according to any one of claims 1 to 4, 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 intersection of the outlines 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.
6. The method according to claim 5, wherein if the printing platform includes a plurality of placeable areas, 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.
7. A two-dimensional matching device of a 3D printed object, 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 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;
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;
a contour intersection judging module, configured to judge, according to the longest continuous similar subsequence, a contour intersection between the 3D printed object and the placeable area, where the contour intersection is disjoint or intersected;
the placing module is used for placing the 3D printed object in the placeable area when the intersection of the contours is not intersected;
the contour intersection judging 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 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 profile intersection of the 3D printed object and the placeable area according to the shortest distance.
8. 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-6 when executing the computer program.
9. 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-6.
CN202210798281.4A 2022-07-06 2022-07-06 Two-dimensional matching method and device for 3D printed object, electronic equipment and medium Active CN115195126B (en)

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 CN115195126A (en) 2022-10-18
CN115195126B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116968316B (en) * 2023-09-22 2024-02-20 易加三维增材技术(杭州)有限公司 Model collision detection method, device, storage medium and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5995668A (en) * 1995-10-25 1999-11-30 U.S. Philips Corporation Segmented picture coding method and system, and corresponding decoding method and system
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
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
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

Family Cites Families (7)

* Cited by examiner, † Cited by third party
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
JP6377392B2 (en) * 2014-04-08 2018-08-22 ローランドディー.ジー.株式会社 Image projection system and image projection method
JP6599670B2 (en) * 2015-07-15 2019-10-30 ローランドディー.ジー.株式会社 3D modeling apparatus and 3D modeling method
CN106898050B (en) * 2017-02-07 2019-08-23 浙江大学 A kind of grid model adaptive layered method based on annular neighborhood reference contour line
CN109955486B (en) * 2019-03-14 2020-08-04 浙江大学 Structure model 3D printing method based on lattice and sparse compression processing
US11654619B2 (en) * 2020-03-03 2023-05-23 Bmf Material Technology Inc. Immersion multi-material projection micro stereolithography with non-stick gas permeable transparent membrane
CN112046006B (en) * 2020-08-28 2021-03-16 南京衍构科技有限公司 3D printing scanning filling path planning method for thin-wall part

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5995668A (en) * 1995-10-25 1999-11-30 U.S. Philips Corporation Segmented picture coding method and system, and corresponding decoding method and system
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
CN110533770A (en) * 2019-08-20 2019-12-03 厦门大学 A kind of 3D printing dicing method towards implied expression medical model
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

Also Published As

Publication number Publication date
CN115195126A (en) 2022-10-18

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
CN112085033A (en) Template matching method and device, electronic equipment and storage medium
CN111767965B (en) Image matching method and device, electronic equipment and storage medium
CN115630236B (en) Global quick retrieval and positioning method, storage medium and equipment for passive remote sensing image
US10983983B2 (en) Entity resolution based on multiple attributes
CN112729166B (en) Structured light encoding method, encoding and decoding method, device, computer device and medium
CN116385947B (en) Video target segmentation method, device, computer equipment and storage medium
CN112396048A (en) Picture information extraction method and device, computer equipment and storage medium
CN111145293B (en) Method and device for reconstructing outline of house-type graph and electronic equipment
US8630477B2 (en) Electronic device and method for outputting measurement data
CN111666442A (en) Image retrieval method and device and computer equipment
US11281935B2 (en) 3D object detection from calibrated 2D images
CN116402842B (en) Edge defect detection method, device, computer equipment and storage medium
CN113869390B (en) Information processing method and device for multi-view three-dimensional reconstruction
CN113066006B (en) Airborne laser radar point cloud data resolving method and device and electronic equipment
CN113792169B (en) Digital archive management method and system based on big data application
CN115359219B (en) Virtual world virtual image processing method and device
CN112669212B (en) Face image super-resolution reconstruction method, device, computer equipment and medium
CN110334681B (en) Finger vein identity recognition method and system based on block chain
CN116883966A (en) Vehicle-mounted camera pose calculation method and device and computer readable storage medium
CN113780313A (en) Line feature extraction method and device and electronic equipment
CN117633973A (en) CAD file identification method, device, electronic equipment and storage medium
CN114279456A (en) Picture construction/vehicle positioning method, system, terminal and computer storage medium

Legal Events

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