Model shell extraction method, device, electronic device and computer-readable storage medium
By traversing and processing the triangular facets of the 3D printed model, the polygons that need to be retained are determined, which solves the problem of high computational complexity of existing shell extraction methods, and achieves a faster and lower resource consumption shell extraction process.
Patent Information
- Application Number
- CN202111667793.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing 3D printing shell extraction method has high computational complexity, which can easily lead to program failure and has high requirements for equipment hardware.
By traversing the preset shell extraction area and the triangular facets of the original model, the intersecting and unintersecting triangular facets are obtained, and the polygons that need to be retained are determined using directed cut line segments and edge long line segments, and the intersecting and unintersecting triangular facets are processed to obtain the model after shell extraction.
It reduces the computational complexity of model shell extraction, reduces the requirements for equipment hardware, and can quickly determine the model after shell extraction.
Smart Images

Figure CN114332375B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of 3D printing technology, and in particular to a model shell extraction method, device, electronic device and computer-readable storage medium. Background Art
[0002] 3D printing is a revolutionary technology developed in the 1980s that overturned traditional production methods. It is also known as rapid prototyping, additive manufacturing, etc. In some cases, it is necessary to first perform a shell extraction operation on the three-dimensional solid model (i.e., the original model, also known as the 3D printing model) in the slicing software, that is, to create a shell or a hollow wall with a specified thickness from the original model (i.e., hollow out the middle of a solid model to become a shell with a wall thickness) to obtain a shell model corresponding to the original model. For example, when the middle of the three-dimensional solid model is a vacuum, it is necessary to perform a shell extraction operation on the three-dimensional solid model in the slicing software to form a hole when performing photocuring printing, so that the shell model corresponding to the original model can flow out the internal liquid through the formed hole when performing photocuring printing.
[0003] The existing shell extraction method for 3D printing is mainly based on the Boolean operation of the third-party CGAL library to realize the shell extraction operation of the model, that is, to perform operations such as intersection between the original model and the shell extraction area of the set size, and separate the original model from the shell extraction area to obtain the shelled model. The existing model shell extraction method involves a large amount of calculation, which is easy to cause the program to crash and has high requirements on the equipment hardware. Summary of the invention
[0004] In view of this, the present application proposes a model shelling method, device, electronic device and computer-readable storage medium, which can reduce the computational complexity of model shelling and reduce the requirements of model shelling calculation on device hardware.
[0005] In a first aspect, an embodiment of the present application provides a model shelling method, comprising:
[0006] Traversing the triangular facets of the preset shell area and the triangular facets of the original model, obtaining the triangular facets in the preset shell area that intersect with the original model and the triangular facets that do not intersect;
[0007] According to the intersecting triangular facets and the triangular facets of the original model, obtaining directed cutting line segments of the original model on the preset shelling area;
[0008] Determine the polygons to be retained according to the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangular facets;
[0009] Determining the triangular facets that need to be retained among the non-intersecting triangular facets according to the positional relationship between the intersecting triangular facets and the polygon;
[0010] The triangular facets in the polygon, the triangular facets to be retained and the triangular facets of the original model are intersected to obtain a shelled model.
[0011] In some embodiments, determining the polygon to be retained according to the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangular facets includes:
[0012] Traversing each of the intersecting triangular facets, obtaining a target directed cutting line segment corresponding to the traversed target triangular facet, and cutting the target directed edge length line segments corresponding to the three sides of the target triangular facet to obtain a directed line segment;
[0013] Screening the directed line segment and the target directed cutting line segment to obtain a first target line segment;
[0014] Selecting a second target line segment based on the first target line segment and the target directed cutting line segment;
[0015] The second target line segments are connected end to end in sequence to obtain the polygon to be retained.
[0016] In some embodiments, the step of screening the directed line segment and the target directed cutting line segment to obtain the first target line segment includes:
[0017] Obtaining a cutting point where the target directed cutting line segment intersects with the target directed edge length line segment;
[0018] Determining whether the cutting point is a starting point or an end point according to the direction of the target directed cutting line segment;
[0019] Determining whether an endpoint of the target directed edge length line segment is a starting point or an end point according to the direction of the target directed edge length line segment;
[0020] The directed line segments on the target directed edge length line segment are traversed, and the directed line segments and the target directed cutting line segments are screened according to the starting point and the end point to obtain the first target line segment.
[0021] In some embodiments, the step of screening the directed line segment and the target directed cutting line segment according to the starting point and the end point to obtain the first target line segment includes:
[0022] For a directed line segment connected by an endpoint of the target directed edge length line segment and the cutting point, determining the directed line segment whose endpoint and the cutting point are both the starting point or the end point as the first target line segment;
[0023] For the directed line segment connected by the cutting points, determine the first point and the second point in sequence according to the direction of the directed line segment, and determine the directed line segment where the first point is the end point and the second point is the starting point as the first target line segment;
[0024] For a target directed edge length line segment without a cutting point, the target directed edge length line segment is determined as the first target line segment.
[0025] In some embodiments, determining the triangular facets to be retained among the non-intersecting triangular facets according to the positional relationship between the triangular facets in the polygon and the polygon includes:
[0026] Obtaining the positional relationship between three vertices of the intersecting triangular facets and the polygon;
[0027] If at least one of the three vertices is inside the polygon, the non-intersecting triangular facets adjacent to the intersecting triangular facets are taken as the triangular facets that need to be retained.
[0028] In some embodiments, obtaining the directed cutting line segments of the original model on the preset shelling area according to the intersecting triangular facets and the triangular facets of the original model includes:
[0029] Obtaining the intersection points of the intersecting triangular facets and the triangular facets of the original model, and connecting the triangular facets where the intersection points are located as related faces;
[0030] The relevant surface is intersected with the intersecting triangular facets to obtain a directed cutting line segment of the original model on the preset shelling area.
[0031] In some embodiments, the step of obtaining the triangular facets intersecting with the original model and the triangular facets not intersecting with the original model in the preset shell region includes:
[0032] The triangular facets of the preset shelling area are intersected with the triangular facets of the original model to obtain the intersecting triangular facets and the non-intersecting triangular facets.
[0033] In the second aspect, the present application provides a model shell extraction device, comprising: a traversal module, used to traverse the triangular faces of a preset shell extraction area and the triangular faces of an original model, and obtain the triangular faces in the preset shell extraction area that intersect with the original model and the triangular faces that do not intersect; an acquisition module, used to obtain the directed cutting line segments of the original model on the preset shell extraction area based on the intersecting triangular faces and the triangular faces of the original model; an algorithm module, used to determine the polygons that need to be retained based on the directed cutting line segments and the directed side length line segments corresponding to the three sides of the intersecting triangular faces; a judgment module, used to determine the triangular faces that need to be retained among the non-intersecting triangular faces based on the positional relationship between the intersecting triangular faces and the polygon; a processing module, used to perform intersection processing on the triangular face faces in the polygon, the triangular faces that need to be retained, and the triangular faces of the original model, to obtain the model after shell extraction.
[0034] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores a plurality of computer programs, and the processor is used to implement the steps of the model shell extraction method as described in the first aspect when executing the computer programs stored in the memory.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the model shell extraction method described in the first aspect are implemented.
[0036] The model shelling method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application obtain the triangular faces that intersect and do not intersect with the original model in a preset shelling area, and then respectively process the corresponding algorithms of the intersecting triangular faces and the non-intersecting triangular faces to obtain the triangular faces within the polygon that need to be retained and the triangular faces that need to be retained among the non-intersecting triangular faces. In this way, it is only necessary to perform correlation calculations on these retained triangular faces and the triangular faces of the original model, and there is no need to perform correlation calculations on all triangular faces in the preset shelling area and the triangular faces of the original model, that is, the calculation of irrelevant areas is removed, and the model after shelling can be quickly determined, thereby reducing the computational complexity of model shelling, thereby reducing the requirements of the model shelling calculation on the device hardware. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 The figure is a schematic flow chart of the steps of a model shell extraction method according to an embodiment of the present application.
[0038] Figure 2 It is a structural schematic diagram of the original model and the preset shell area of one embodiment of the present application.
[0039] Figure 3It is a structural schematic diagram of the original model and the preset shell area of another embodiment of the present application.
[0040] Figure 4 For this application Figure 2 The schematic diagram of the structure of the model after shell extraction in the illustrated embodiment.
[0041] Figure 5 For this application Figure 3 The schematic diagram of the structure of the model after shell extraction in the illustrated embodiment.
[0042] Figure 6 For this application Figure 1 A schematic diagram of a detailed process flow of a step process of the illustrated embodiment.
[0043] Figure 7 For this application Figure 6 A schematic diagram of a detailed process flow of a step process of the illustrated embodiment.
[0044] Figure 8 For this application Figure 2 A schematic structural diagram of a target cutting line segment and intersecting triangular facets in the illustrated embodiment.
[0045] Fig. 9 For this application Figure 3 A schematic structural diagram of a target cutting line segment and intersecting triangular facets in the illustrated embodiment.
[0046] Fig.10 Schematic diagram of the functional modules of a model shell extraction device according to an embodiment of the present application.
[0047] Main component symbols
[0048] Original Model 10
[0049] Part 11
[0050] Part 212
[0051] Default Shell Area 20
[0052] Model after shelling 30
[0053] Model shell extraction device 40
[0054] Traversal module 41
[0055] Get module 42
[0056] Algorithm module 43
[0057] Judgment module 44
[0058] Processing module 45
[0059] The following specific implementation methods will further illustrate the present application in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0061] It should be noted that, in the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the present application. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.
[0062] It should be noted that, in the embodiments of the present application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. Features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0063] See also Figure 1 , which is a flow chart of a model shell extraction method provided in one embodiment of the present application.
[0064] Further integration Figure 2 As shown, in this embodiment, the original model 10 and the preset shell extraction area 20 are used as examples for explanation. The original model 10 and the preset shell extraction area 20 can be three-dimensional solid models of any shape, and this application does not limit this. Specifically, the model shell extraction method may include:
[0065] S100, traversing the triangular facets of the preset shell area and the triangular facets of the original model, and obtaining the triangular facets in the preset shell area that intersect with the original model and the triangular facets that do not intersect with the original model.
[0066] In this embodiment, the original model 10 may be composed of multiple triangular facets, the preset shell area 20 may be composed of multiple triangular facets, and there may be multiple groups of intersecting triangular facets and non-intersecting triangular facets in the preset shell area 20 with the original model 10 .
[0067] Specifically, the triangular facets intersecting with the original model 10 and the triangular facets not intersecting with the original model 10 in the preset shell area 20 can be obtained in the following manner: the maximum and minimum coordinate values of the original model 10 and the preset shell area 20 can be obtained, and the data information of the triangular facets of the original model 10 and the triangular facets of the preset shell area 20 can be determined by the maximum and minimum coordinate values of the original model 10 and the preset shell area 20; all the triangular facets of the original model 10 and all the triangular facets of the preset shell area 20 are traversed, and the triangular facets of the preset shell area 20 are intersected with the triangular facets of the original model 10; if the triangular facets of the preset shell area 20 and the triangular facets of the original model 10 have intersecting parts, the intersection of the triangular facets of the preset shell area 20 and the triangular facets of the original model 10 is determined, and the index numbers of all intersecting triangular facets are recorded. In this way, the triangular facets intersecting with the original model 10 in the preset shell area 20 can be obtained. Furthermore, the triangular facets in the preset shelling area 20 that do not intersect with the original model 10 can be obtained.
[0068] S200, obtaining directed cutting line segments of the original model on a preset shelling area according to the intersecting triangular facets and the triangular facets of the original model.
[0069] In this embodiment, the intersection points of the intersecting triangular facets and the triangular facets of the original model 10 can be obtained, and the triangular facets at the intersection points are connected as the relevant surface, that is, the side surface in contact with the original model 10 in the preset shell area 20. The relevant surface is intersected with the intersecting triangular facets to obtain a directed cutting line segment of the original model 10 on the preset shell area 20.
[0070] After the preset shell region 20 is determined on the original model 10 , the computer can directly determine the directions of the directed edge length segments and directed cutting segments of the triangular facets of the preset shell region 20 .
[0071] In one embodiment, the directions of the directed edge length line segments of the triangular facets of the preset shell region 20 are determined according to the order of the coordinate points on the preset shell region 20 .
[0072] In one embodiment, the direction determination step of the directed cutting line segment is as follows: according to the preset observation direction, determine whether the triangle face where the directed cutting line segment is located in the original model 10 is an external triangle face or an internal triangle face. If the triangle face that can be seen according to the preset observation direction is an external triangle face, the direction of the directed cutting line segment is counterclockwise; if the triangle face that cannot be seen according to the preset observation direction is an internal triangle face, the direction of the directed cutting line segment is clockwise;
[0073] In this embodiment, further combined Figure 2As shown, the preset observation direction is the first direction A. According to the first direction A, the left side surface of the original model 10 is determined as an external triangular face, and the direction of the directed cutting line segment here is counterclockwise; according to the first direction A, the right side surface of the original model 10 is determined as an internal triangular face, and the direction of the directed cutting line segment here is clockwise.
[0074] In one embodiment, when the middle part of the preset shell area 20 does not intersect with the original model 10, it is necessary to divide the triangular faces where the preset shell area 20 intersects with the original model 10 into various parts according to the shape of the original model 10, and determine whether the triangular faces where the directed cutting line segments are located in each part are external triangular faces or internal triangular faces according to the preset observation direction.
[0075] In one embodiment, further combining Figure 3 As shown, the original model 10 is a "concave"-shaped structure, and the preset shell area 20 has a middle part that does not intersect with the original model 10, so the original model 10 needs to be divided into a first part 11 and a second part 12. According to the first direction A, the triangular facets on the left side of the first part 11 with the directed cutting line segment are respectively determined as external triangular facets, where the direction of the directed cutting line segment is counterclockwise; the triangular facets on the right side of the first part 11 are internal triangular facets, where the direction of the directed cutting line segment is clockwise. The triangular facets on the left side of the second part 12 are external triangular facets, where the direction of the directed cutting line segment is counterclockwise; the triangular facets on the left side of the second part 12 are external triangular facets, where the direction of the directed cutting line segment is counterclockwise; the triangular facets on the left side of the second part 12 are external triangular facets, where the direction of the directed cutting line segment is clockwise.
[0076] S300: Determine the polygons to be retained according to the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangle facets.
[0077] In one embodiment, each intersecting triangular facet is traversed, and the polygons to be retained are determined by calculation based on the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangular facets.
[0078] S400: Determine the triangles that need to be retained among the non-intersecting triangles according to the positional relationship between the intersecting triangles and the polygon.
[0079] In this embodiment, the triangular facets in the preset shell region 20 that do not intersect with the original model 10 are as follows: Figure 2 The two ends of the preset shell area 20 are located at the bottom of the cylinder outside the original model 10. Whether the triangular facets in the preset shell area 20 that do not intersect with the original model 10 are retained needs to be determined by obtaining the positional relationship between the three vertices of the intersecting triangular facets and the polygons that need to be retained in step S300, thereby determining the triangular facets that need to be retained among the non-intersecting triangular facets.
[0080] In one embodiment, if it is determined that at least one of the three vertices is inside the polygon, the non-intersecting triangular facets adjacent to the triangular facet are taken as triangular facets that need to be retained, that is, the triangular facets that need to be retained in the preset shell area 20 that do not intersect with the original model 10.
[0081] S500, performing intersection processing on the triangular facets in the polygon, the triangular facets to be retained, and the triangular facets of the original model to obtain a shelled model.
[0082] In this embodiment, the triangles in the polygon to be retained in step S300, the triangles to be retained in step S400 and the triangles of the original model 10 can be directly intersected to obtain the following: Figure 4 The shelled model 30 is shown.
[0083] In one embodiment, the triangular facets in the polygon in step S300 and the triangular facets to be retained in step S400 may be intersected first, and then the triangular facets obtained by intersecting the triangular facets in the polygon in step S300 and the triangular facets to be retained in step S400 are intersected with the triangular facets of the original model 10, so as to obtain the following: Figure 5 The shelled model 30 is shown.
[0084] In one embodiment, if Figure 5 As shown, step S300 may further include:
[0085] S310, traversing each intersecting triangular face, obtaining a target directed cutting line segment corresponding to the traversed target triangular face, and cutting the target directed edge length line segments corresponding to the three sides of the target triangular face to obtain a directed line segment.
[0086] S320, screening the directed line segment and the target directed cutting line segment to obtain a first target line segment.
[0087] S330: Select a second target line segment based on the first target line segment and the target directed cutting line segment.
[0088] S340, connecting the second target line segments end to end in sequence to obtain a polygon to be retained.
[0089] In one embodiment, if Figure 6 As shown, step S320 may also include:
[0090] S321, obtaining the cutting point where the target directed cutting line segment intersects with the target directed edge length line segment.
[0091] S322, determining whether the cutting point is a starting point or an end point according to the direction of the target directed cutting line segment.
[0092] S323: Determine whether the endpoint of the target directed edge length line segment is a starting point or an end point according to the direction of the target directed edge length line segment.
[0093] S324, traverse the directed line segments on the target directed edge length line segment, screen the directed line segments and the target directed cutting line segments according to the starting point and the end point, and obtain a first target line segment.
[0094] For a directed line segment connected by an endpoint and a cutting point of a target directed edge length line segment, a directed line segment whose endpoint and cutting point are both a starting point or an end point is determined as a first target line segment;
[0095] For a directed line segment connected by a cutting point, the first point and the second point are determined in sequence according to the direction of the directed line segment, and the directed line segment whose first point is the end point and the second point is the starting point is determined as the first target line segment;
[0096] For a target directed edge length line segment without a cutting point, the target directed edge length line segment is determined as a first target line segment.
[0097] In this embodiment, if Figure 8 As shown, Figure 2 The diagram shown is a combination diagram of a directed cutting line segment and one of the triangular facets of the predetermined shelling area 20 intersecting with the triangular facets of the original model 10 observed along the first direction A.
[0098] like Figure 7 As shown, taking the triangle patch P1->P2->P3 as an example, the target directed edge length line segments obtained from the triangle patch P1->P2->P3 are P1->P2, P2->P3, P3->P1, and the target directed cutting line segments are P5->P4, P6->P7.
[0099] The target directed cutting line segments P5->P4 and P6->P7 show that the cutting points on the target directed edge length line segment P1->P2 are P4 and P6 respectively; there is no cutting point on P2->P3; the cutting points on P3->P1 are P7 and P5 respectively. Among them, the cutting points P5 and P6 are the starting points, and P4 and P7 are the end points.
[0100] According to the target directed edge length line segment P1->P2, P2->P3, P3->P1, traverse P1->P2->P3 in order. The algorithm is as follows:
[0101] 1. Target directed edge length line segment P1->P2:
[0102] (1) Directed line segment P1->P4: A directed line segment connecting the endpoint P1 of the target directed edge segment P1->P2 and the cutting point P4.
[0103] Since endpoint P1 is the starting point and cutting point P4 is the end point, the directed line segment P1->P4 is discarded.
[0104] (2) Directed line segment P4->P6: a directed line segment connected by cutting point P4 and cutting point P6.
[0105] Since the cutting point P4 is the end point and the cutting point P6 is the starting point, the new directed line segment P4->P6 is recorded as the first target line segment.
[0106] (3) Directed line segment P6->P2: a directed line segment connecting the endpoint P2 of the target directed edge segment P1->P2 and the cutting point P6.
[0107] Since endpoint P2 is the end point and cutting point P6 is the starting point, the directed line segment P6->P2 is discarded.
[0108] Then the first target line segment on the first target directed edge length line segment P1->P2 has been determined.
[0109] 2. Target directed edge length line segment P2->P3:
[0110] Since there is no cutting point on the target side length line segment P2->P3, the target directed side length line segment P2->P3 is directly obtained as the first target line segment in the direction of P2->P3.
[0111] Then the first target line segment on the second target directed edge length line segment P2->P3 has been determined.
[0112] 3. Target directed edge length line segment P3->P1:
[0113] (1) Directed line segment P3->P7: A directed line segment connecting the endpoint P3 of the target directed edge segment P3->P1 and the cutting point P7.
[0114] Since endpoint P3 is the starting point and cutting point P7 is the end point, the directed line segment P3->P7 is discarded.
[0115] (2) Directed line segment P7->P5: a directed line segment connected by cutting point P7 and cutting point P5.
[0116] Since the cutting point P7 is the end point and the cutting point P5 is the starting point, the new directed line segment P7->P5 is recorded as the first target line segment.
[0117] (3) Directed line segment P5->P1: a directed line segment connected by the endpoint P1 of the target directed edge segment P3->P1 and the cutting point P5.
[0118] Since endpoint P1 is the end point and cutting point P5 is the starting point, the directed line segment P5->P1 is discarded.
[0119] Thus, the first target line segments P4->P6, P2->P3, P5->P4, P6->P7, P7->P5 are obtained. Based on the first target line segments P4->P6, P2->P3, P5->P4, P6->P7, P7->P5, the second target line segments P4->P6, P5->P4, P6->P7, P7->P5 are selected, which can be tried to be connected end to end. P5->P4, P4->P6, P6->P7, P7->P5 are connected end to end in order to obtain the polygons P5P4P6P7P5 that need to be retained.
[0120] According to the above method, polygons are obtained by cutting all intersecting triangles in turn, and then the triangles in the polygon are intersected with the triangles to be retained in step S400 and the triangles of the original model 10, so as to obtain Figure 4 The shelled model 30 is shown.
[0121] In one embodiment, if Figure 8 As shown, Figure 3 The diagram shown is a combination diagram of a directed cutting line segment and one of the triangular facets of the predetermined shelling area 20 intersecting with the triangular facets of the original model 10 observed along the first direction A.
[0122] like Fig. 9 As shown, taking the triangle patch P10->P11->P12 as an example, the target directed edge length line segments obtained from the triangle patch P10->P11->P12 are P10->P11, P11->P12, P12->P13, and the target directed cutting line segments are P13->P14, P15->P16, P17->P18, P19->P20.
[0123] The target directed cutting line segments P13->P14, P15->P16, P17->P18, P19->P20 show that the cutting points on the target directed edge length line segment P10->P11 are P14, P15, P18, and P19 respectively; there is no cutting point on P11->P12; the cutting points on P12->P10 are P20, P17, P16, and P13 respectively. Among them, the cutting points P13, P15, P17, and P19 are the starting points, and P14, P16, P18, and P20 are the end points.
[0124] According to the target directed edge length line segment P10->P11, P11->P12, P12->P13, traverse P10->P11->P12 in the order of the target directed edge length line segment P10->P11->P12. The algorithm is as follows:
[0125] 1. Target directed edge length line segment P10->P11:
[0126] (1) Directed line segment P10->P14: a directed line segment connected by the endpoint P10 of the target directed edge segment P10->P11 and the cutting point P14.
[0127] Since the endpoint P10 is the starting point and the cutting point P14 is the end point, the directed line segment P10->P14 is discarded.
[0128] (2) Directed line segment P14->P15: a directed line segment connected by cutting point P14 and cutting point P15.
[0129] Since the cutting point P14 is the end point and the cutting point P15 is the starting point, the new directed line segment P14->P15 is recorded as the first target line segment.
[0130] (3) Directed line segment P15->P18: a directed line segment connected by cutting point P15 and cutting point P18.
[0131] Since the cutting point P15 is the starting point and the cutting point P18 is the end point, the directed line segment P14->P15 is discarded.
[0132] (4) Directed line segment P18->P19: a directed line segment connected by cutting point P18 and cutting point P19.
[0133] Since the cutting point P18 is the end point and the cutting point P19 is the starting point, the new directed line segment P18->P19 is recorded as the first target line segment.
[0134] (5) Directed line segment P19->P11: a directed line segment connected by the endpoint P11 of the target directed edge segment P10->P11 and the cutting point P19.
[0135] Since endpoint P11 is the end point and cutting point P19 is the starting point, directed line segment P19->P11 is discarded.
[0136] Then the first target line segment on the first target directed edge length line segment P10->P11 has been determined.
[0137] 2. Target directed edge length line segment P11->P12:
[0138] Since there is no cutting point on the target side length line segment P11->P12, the target directed side length line segment P11->P12 is directly obtained as the first target line segment according to the direction of P11->P12.
[0139] Then the first target line segment on the second target directed edge length line segment P11->P12 has been determined.
[0140] 3. Target directed edge length line segment P12->P10:
[0141] (1) Directed line segment P12->P20: a directed line segment connected by the endpoint P12 of the target directed edge segment P12->P10 and the cutting point P20.
[0142] Since the endpoint P12 is the starting point and the cutting point P20 is the end point, the directed line segment P12->P20 is discarded.
[0143] (2) Directed line segment P20->P17: a directed line segment connected by the cutting point P20 and the cutting point P17.
[0144] Since the cutting point P20 is the end point and the cutting point P17 is the starting point, the new directed line segment P20->P17 is recorded as the first target line segment.
[0145] (3) Directed line segment P17->P16: a directed line segment connected by cutting point P17 and cutting point P16.
[0146] Since the cutting point P17 is the starting point and the cutting point P16 is the end point, the directed line segment P17->P16 is discarded.
[0147] (4) Directed line segment P16->P13: a directed line segment connected by cutting point P16 and cutting point P13.
[0148] Since the cutting point P16 is the end point and the cutting point P13 is the starting point, the new directed line segment P16->P13 is recorded as the first target line segment.
[0149] (5) Directed line segment P13->P10: a directed line segment connected by the endpoint P10 of the target directed edge segment P12->P10 and the cutting point P13.
[0150] Since the endpoint P10 is the end point and the cutting point P13 is the starting point, the directed line segment P13->P10 is discarded.
[0151] Then the first target line segment on the third target directed edge length line segment P12->P10 has been determined.
[0152] Thus, the first target line segments P14->P15, P18->P19, P11->P12, P20->P17, P16->P13, P13->P14, P15->P16, P17->P18, P19->P20 are obtained. Based on the first target line segments P14->P15, P18->P19, P11->P12, P20->P17, P16->P13, P13->P14, P15->P16, P17->P18, P19->P20, the second target line segment P13-> P14, P14->P15, P15->P16, P16->P13 and P17->P18, P18->P19, P19->P20, P20->P17, connect the second target lines P13->P14, P14->P15, P15->P16, P16->P13 and P17->P18, P18->P19, P19->P20, P20->P17 end to end in order, so as to obtain two polygons P13P14P15P16P13, P17P18P19P20P17 that need to be retained.
[0153] According to the above method, polygons are obtained by cutting all intersecting triangles in turn, and then the triangles in the polygon are intersected with the triangles to be retained in step S400, and then the triangles in the polygon are intersected with the triangles to be retained in step S400. The triangles obtained by intersecting the triangles in the polygon and the triangles to be retained in step S400 are intersected with the triangles of the original model 10, so as to obtain the following: Figure 5 The shelled model 30 is shown.
[0154] The model shelling method of the present embodiment obtains the triangular faces that intersect and do not intersect the preset shelling area 20 with the original model 10, and then processes the corresponding algorithms of the intersecting triangular faces and the non-intersecting triangular faces respectively, to obtain the triangular faces within the polygon that need to be retained and the triangular faces that need to be retained among the non-intersecting triangular faces. In this way, only the retained triangular faces need to be correlated with the triangular faces of the original model 10, and there is no need to correlate all the triangular faces of the preset shelling area 20 with the triangular faces of the original model 10. That is, the calculation of irrelevant areas is removed, and the model 30 after shelling can be quickly determined, thereby reducing the calculation complexity of the model shelling, thereby reducing the requirements of the model shelling calculation on the device hardware.
[0155] Further integration Fig.10 As shown, a model shell extraction device 40 provided in one embodiment of the present application includes:
[0156] The traversal module 41 is used to traverse the triangular facets of the preset shell area 20 and the triangular facets of the original model 10 to obtain the triangular facets in the preset shell area 20 that intersect with the original model 10 and the triangular facets that do not intersect with the original model 10.
[0157] The acquisition module 42 is used to acquire the directed cutting line segments of the original model 10 on the preset shelling area 20 according to the intersecting triangular facets and the triangular facets of the original model 10 .
[0158] The algorithm module 43 determines the polygons to be retained according to the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangle facets.
[0159] The judgment module 44 is used to determine the triangles that need to be retained among the non-intersecting triangles according to the positional relationship between the intersecting triangles and the polygon.
[0160] The processing module 45 is used to perform intersection processing on the triangular facets in the polygon, the triangular facets to be retained, and the triangular facets of the original model 10 to obtain the shelled model 30 .
[0161] The present application also discloses an electronic device, which includes a processor and a memory, wherein a plurality of computer programs are stored in the memory, and the processor is used to implement the steps of the model shell extraction method in the above embodiment when executing the computer programs stored in the memory. The terminal device may be a computing device such as a desktop computer, a notebook, a handheld computer, and a cloud server, and the terminal device may interact with a user through a keyboard, a mouse, a remote control, a touchpad, or a voice control device.
[0162] The present application also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the model shell extraction method in the above embodiment are implemented. The storage medium can be a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc., which can store program codes.
[0163] The model shelling method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application obtain the triangular faces that intersect and do not intersect the preset shelling area 20 with the original model 10, and then respectively process the corresponding algorithms of the intersecting triangular faces and the non-intersecting triangular faces to obtain the triangular faces within the polygon that need to be retained and the triangular faces that need to be retained among the non-intersecting triangular faces. In this way, it is only necessary to perform correlation calculations on these retained triangular faces and the triangular faces of the original model 10, and there is no need to perform correlation calculations on all triangular faces of the preset shelling area 20 and the triangular faces of the original model 10, that is, the calculation of irrelevant areas is removed, and the model 30 after shelling can be quickly determined, thereby reducing the computational complexity of model shelling, thereby reducing the requirements of the model shelling calculation on the device hardware.
[0164] Those skilled in the art should recognize that the above embodiments are only used to illustrate the present application and are not intended to be limiting of the present application. As long as they are within the spirit and scope of the present application, appropriate changes and modifications to the above embodiments are within the scope of protection claimed in the present application.
Claims
1. A model shelling method, characterized in that: include: Traversing the triangular facets of the preset shell area and the triangular facets of the original model, obtaining the triangular facets in the preset shell area that intersect with the original model and the triangular facets that do not intersect; According to the intersecting triangular facets and the triangular facets of the original model, obtaining directed cutting line segments of the original model on the preset shelling area; Determine the polygons to be retained according to the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangular facets; Determining the triangular facets that need to be retained among the non-intersecting triangular facets according to the positional relationship between the intersecting triangular facets and the polygon, including: obtaining the positional relationship between three vertices of the intersecting triangular facets and the polygon; If at least one of the three vertices is inside the polygon, the non-intersecting triangular facets adjacent to the intersecting triangular facets are used as the triangular facets that need to be retained; The triangular facets in the polygon, the triangular facets to be retained and the triangular facets of the original model are intersected to obtain a shelled model.
2. The model shelling method according to claim 1, characterized in that: The step of determining the polygon to be retained according to the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangular facets comprises: Traversing each of the intersecting triangular facets, obtaining a target directed cutting line segment corresponding to the traversed target triangular facet, and cutting the target directed edge length line segments corresponding to the three sides of the target triangular facet to obtain a directed line segment; Screening the directed line segment and the target directed cutting line segment to obtain a first target line segment; Selecting a second target line segment based on the first target line segment and the target directed cutting line segment; The second target line segments are connected end to end in sequence to obtain the polygon to be retained.
3. The model shelling method according to claim 2, characterized in that: The step of screening the directed line segment and the target directed cutting line segment to obtain a first target line segment includes: Obtaining a cutting point where the target directed cutting line segment intersects with the target directed edge length line segment; Determining whether the cutting point is a starting point or an end point according to the direction of the target directed cutting line segment; Determining whether an endpoint of the target directed edge length line segment is a starting point or an end point according to the direction of the target directed edge length line segment; The directed line segments on the target directed edge length line segment are traversed, and the directed line segments and the target directed cutting line segments are screened according to the starting point and the end point to obtain the first target line segment.
4. The model shelling method according to claim 3, characterized in that: The step of screening the directed line segment and the target directed cutting line segment according to the starting point and the end point to obtain the first target line segment includes: For a directed line segment connected by an endpoint of the target directed edge length line segment and the cutting point, determining the directed line segment whose endpoint and the cutting point are both the starting point or the end point as the first target line segment; For the directed line segment connected by the cutting point, determine the first point and the second point in sequence according to the direction of the directed line segment, and determine the directed line segment where the first point is the end point and the second point is the starting point as the first target line segment; For a target directed edge length line segment without a cutting point, the target directed edge length line segment is determined as the first target line segment.
5. The model shelling method according to claim 1, characterized in that: The step of obtaining the directed cutting line segments of the original model on the preset shelling area according to the intersecting triangular facets and the triangular facets of the original model comprises: Obtaining the intersection points of the intersecting triangular facets and the triangular facets of the original model, and connecting the triangular facets where the intersection points are located as related faces; The relevant surface is intersected with the intersecting triangular facets to obtain a directed cutting line segment of the original model on the preset shelling area.
6. The model shelling method according to claim 1, characterized in that: The step of obtaining the triangular facets intersecting with the original model and the triangular facets not intersecting with the original model in the preset shell region includes: The triangular facets of the preset shelling area are intersected with the triangular facets of the original model to obtain the intersecting triangular facets and the non-intersecting triangular facets.
7. A model shell extraction device, characterized in that: include: A traversal module, used for traversing the triangular facets of the preset shell area and the triangular facets of the original model, and obtaining the triangular facets in the preset shell area that intersect with the original model and the triangular facets that do not intersect; An acquisition module, used for acquiring directed cutting line segments of the original model on the preset shelling area according to the intersecting triangular facets and the triangular facets of the original model; An algorithm module, used for determining the polygons to be retained according to the directed cutting line segments and the directed edge length line segments corresponding to the three sides of the intersecting triangular facets; A judgment module, used for determining the triangle facets that need to be retained among the non-intersecting triangle facets according to the positional relationship between the intersecting triangle facets and the polygon, comprising: obtaining the positional relationship between three vertices of the intersecting triangle facets and the polygon; if at least one of the three vertices is inside the polygon, taking the non-intersecting triangle facets adjacent to the intersecting triangle facets as the triangle facets that need to be retained; The processing module is used to perform intersection processing on the triangular facets in the polygon, the triangular facets to be retained and the triangular facets of the original model to obtain a shelled model.
8. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein a plurality of computer programs are stored in the memory, and the processor is used to implement the steps of the model shell extraction method as described in any one of claims 1 to 6 when executing the computer programs stored in the memory.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the model shelling method as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Slicing method and printing method for three-dimensional model and related equipment
CN113715338A
Method for obtaining polygon information of three-dimensional object model
KR101552828B1