A filling method, device, electronic equipment and medium for three-dimensional components
By dividing the three-dimensional components into blocks and judging the position relationship of virtual cells, the filling area is determined in advance, which solves the problems of low filling success rate and waste of computing resources in the existing technology and realizes efficient three-dimensional component filling.
Patent Information
- Application Number
- CN202510969928.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-15
AI Technical Summary
The existing technology has a low success rate and serious waste of computing resources when filling meter-level three-dimensional components, especially when performing full-area Boolean operations on small components after block formation, resulting in long filling time and low efficiency.
By obtaining the geometric parameters of the three-dimensional component to be filled and the cell sample, the three-dimensional component is divided into blocks, the pre-filled area is determined, and the positional relationship of the virtual cells is judged based on the blocks. The cell area to be filled is determined in advance to avoid judging the non-filled area.
It greatly improves the filling efficiency of three-dimensional components, reduces the calculation complexity, reduces the calculation pressure during calculation, improves the filling efficiency of three-dimensional components, reduces the filling complexity, improves the filling efficiency of three-dimensional components, improves the filling efficiency of three-dimensional components, reduces the filling efficiency, improves the filling effect, improves the filling effect, improves the filling efficiency, improves the filling success rate, and reduces the waste of computing resources.
Smart Images

Figure CN120472005B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of printing technology, and in particular to a filling method, device, electronic equipment and medium for three-dimensional components. Background Art
[0002] With the rapid development of additive printing technology, the demand for printing and manufacturing 3D models in aerospace, aviation and other fields is becoming increasingly widespread. In 3D model printing, quickly and accurately filling the model is a crucial step to ensure structural stability.
[0003] In recent years, the size of three-dimensional components to be filled has reached the meter level. Since meter-level three-dimensional components include a large number of triangles and vertices, and their shapes are usually irregular, if the three-dimensional components are directly filled, the success rate is low and a large amount of computing resources is required.
[0004] To improve the success rate of filling and reduce filling computational resources, currently, three-dimensional components are typically divided into blocks and each small component is individually filled. This can effectively improve the filling success rate. However, when performing individual filling calculations on small components after block filling, Boolean operations are often performed on all areas of the small component, resulting in large areas that do not need to be filled being calculated. This results in long filling times, low efficiency, and wasted computing resources.
[0005] Therefore, how to improve the filling efficiency of three-dimensional components and save computing resources is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0006] In view of this, one aspect of the present application provides a filling method for a three-dimensional component, the method comprising:
[0007] Acquire a first geometric parameter of a three-dimensional component to be filled and a second geometric parameter of a cell sample; the cell sample is a cell used to fill the three-dimensional component to be filled;
[0008] Dividing the to-be-filled three-dimensional component into blocks according to the first geometric parameter and the second geometric parameter to obtain a plurality of sub-components;
[0009] Determine a pre-filled area of the subcomponent; the pre-filled area is composed of a plurality of virtual cell arrangements and combinations that are congruent with the cell sample, and the subcomponent is within the pre-filled area;
[0010] When it is determined that the area where the virtual cell is located belongs to the interior of the corresponding sub-component, the area where the virtual cell is located is used as the cell area to be filled;
[0011] The cell area to be filled is filled with the cell sample.
[0012] Optionally, in a pre-constructed three-dimensional space coordinate system, the first geometric parameters include a first starting coordinate and a first dimension on the X-axis, Y-axis and Z-axis respectively, and the second geometric parameters include a second starting coordinate and a second dimension on the X-axis, Y-axis and Z-axis respectively.
[0013] Optionally, dividing the to-be-filled three-dimensional component into blocks according to the first geometric parameter and the second geometric parameter to obtain a plurality of sub-components includes:
[0014] Determine first ratios of the first dimension divided by the second dimension on the same axis of the X axis, the Y axis, and the Z axis respectively;
[0015] The axis corresponding to the one with the largest first ratio is used as the spatial block axis of the three-dimensional component to be filled;
[0016] Taking the first starting coordinate as a starting point, along the spatial block axis, a second size corresponding to the spatial block axis is stepped once to perform block division to obtain the sub-component.
[0017] Optionally, determining the pre-filled area of the sub-component includes:
[0018] Acquire a third starting coordinate of the subcomponent, and third sizes of the subcomponent on the X-axis, the Y-axis, and the Z-axis;
[0019] Determine a second ratio of the third dimension divided by the second dimension on the same axis of the X axis, the Y axis, and the Z axis respectively;
[0020] Rounding up the product of the second ratios of the same subcomponent to determine the target number of virtual cells corresponding to each subcomponent;
[0021] Starting from the third starting coordinate, the pre-filled area is obtained by stepping along the X-axis, the Y-axis, and the Z-axis by a single step corresponding to the second dimension of the axis, and the number of steps is the target number.
[0022] Optionally, determining whether the region where the virtual cell is located belongs to the interior of the corresponding subcomponent includes:
[0023] Uniformly extracting a preset number of sampling point coordinates from the virtual cell;
[0024] Based on the fast winding number algorithm, if it is determined that at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding sub-component, then it is determined that the area where the virtual cell is located belongs to the interior of the corresponding sub-component.
[0025] Optionally, determining that at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding subcomponent includes:
[0026] Obtaining the vertex coordinates and triangle face index of the subcomponent;
[0027] According to the vertex coordinates and the triangle patch index, the winding value corresponding to each sampling point coordinate is calculated in parallel by the fast winding number algorithm;
[0028] If at least one of the winding values is greater than a threshold, it is determined that at least one of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding sub-component.
[0029] Optionally, filling the cell area to be filled with the cell sample includes:
[0030] The area where the target virtual cell is located in the cell area to be filled is used as the first filling area; the target virtual cell is a cell where the coordinates of the preset number of sampling points belong to the interior of the corresponding sub-component;
[0031] Extracting a designated virtual cell from the cell region to be filled; the designated virtual cell is a cell in which at least one coordinate point of the preset number of sampling points does not belong to the interior of the corresponding sub-component;
[0032] Determine, through Boolean operations, a target area in the area where the designated virtual cell is located that belongs to the interior of the corresponding sub-component; and use the target area as a second filling area;
[0033] The first filling area and the second filling area are filled with the cell sample.
[0034] Another aspect of the present application provides a filling device for a three-dimensional structure, the device comprising:
[0035] A geometric parameter acquisition module, configured to acquire first geometric parameters of a to-be-filled three-dimensional component and second geometric parameters of a cell sample; the cell sample is a cell used to fill the to-be-filled three-dimensional component;
[0036] A component segmentation module, configured to segment the three-dimensional component to be filled into multiple sub-components according to the first geometric parameter and the second geometric parameter;
[0037] A pre-filled area determination module is used to determine a pre-filled area of the sub-component; the pre-filled area is composed of a plurality of virtual cells that are congruent with the cell sample, and the sub-component is within the pre-filled area;
[0038] a cell region determination module to be filled, configured to, when determining that the region where the virtual cell is located belongs to the interior of the corresponding sub-component, use the region where the virtual cell is located as the cell region to be filled;
[0039] A cell filling module is used to fill the cell area to be filled with the cell sample.
[0040] Another aspect of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps of the filling method of the three-dimensional component are implemented.
[0041] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the three-dimensional component filling method when the program is executed by a processor.
[0042] The present application provides a method, device, electronic device and medium for filling three-dimensional components, which have the following beneficial effects: by dividing the three-dimensional components to be filled into blocks, the filling complexity is reduced; on the basis of the blocks, the positional relationship between the sub-components and virtual cells after the blocks is judged, so that before the cells are filled, the area that needs to be filled with cells is determined in advance, that is, the area of cells to be filled is determined, thereby avoiding the computational pressure caused by judging the non-filled area during filling, and greatly improving the filling efficiency of the three-dimensional components. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic flow chart of a method for filling a three-dimensional component provided in an embodiment of the present application;
[0044] Figure 2 A schematic structural diagram of a three-dimensional component to be filled provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of the structure of a cell sample provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of a three-dimensional component to be filled and a pre-filled area provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of another three-dimensional component to be filled and a pre-filled area provided in an embodiment of the present application;
[0048] Figure 6 for Figure 2 The three-dimensional component to be filled is shown Figure 3 Schematic diagram of the effect after the cell sample is filled;
[0049] Figure 7 for Figure 6 Filled partial schematic diagram;
[0050] Figure 8 A schematic structural diagram of a filling device for a three-dimensional component provided in an embodiment of the present application;
[0051] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0052] The accompanying drawings are marked as follows: 80 is a geometric parameter acquisition module, 81 is a component segmentation module, 82 is a pre-filled area determination module, 83 is a cell area determination module to be filled, 84 is a cell filling module, 90 is a memory, 91 is a processor, 92 is a display screen, 93 is an input and output interface, 94 is a communication interface, 95 is a power supply, 96 is a communication bus, 901 is a computer program, 902 is an operating system, and 903 is data. DETAILED DESCRIPTION
[0053] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0054] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0055] Figure 1 A flow chart of a filling method for a three-dimensional component provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the method includes:
[0056] S10: Acquire a first geometric parameter of the three-dimensional component to be filled and a second geometric parameter of a cell sample; the cell sample is a cell used to fill the three-dimensional component to be filled;
[0057] S11: Dividing the three-dimensional component to be filled into blocks according to the first geometric parameter and the second geometric parameter to obtain a plurality of sub-components;
[0058] In a specific embodiment, in order to avoid the waste of resources and low success rate caused by filling the entire three-dimensional component to be filled, the filling method of the three-dimensional component provided in this application can divide the three-dimensional component to be filled into blocks. Wherein, the three-dimensional component to be filled refers to a three-dimensional structure that needs to be filled with cells.
[0059] It is understood that the number of sub-components into which the three-dimensional component to be filled is divided is crucial for filling efficiency and accuracy. Therefore, in an optional embodiment, when dividing the three-dimensional component to be filled into blocks, the first geometric parameters of the three-dimensional component to be filled and the second geometric parameters of the cell sample are first obtained. The cell sample refers to the basic unit used to fill the three-dimensional component to be filled.
[0060] Furthermore, in an optional embodiment, the three-dimensional component to be filled is divided into multiple subcomponents based on the first and second geometric parameters. It is understood that in specific embodiments, if the three-dimensional component to be filled is randomly divided into blocks, the number of blocks may be small, the success rate cannot be guaranteed, and the filling efficiency is also low. Furthermore, if the number of blocks is large, that is, if there are many subcomponents, the filling efficiency will also be affected to some extent.
[0061] Therefore, in the embodiment of the present application, the blocks are divided based on the first geometric parameters of the three-dimensional component to be filled and the second geometric parameters of the cell sample, taking into account both the filling success rate and efficiency. It should be noted that the first geometric parameters and the second geometric parameters are parameters used to reflect information such as the volume, shape, and size of the three-dimensional component to be filled and the cell sample. In an optional embodiment, the geometric parameters include but are not limited to coordinates in a pre-constructed three-dimensional space coordinate system and sizes on the X-axis, Y-axis, and Z-axis.
[0062] In an optional embodiment, when dividing the three-dimensional component to be filled, the cell sample can be used as a basis and the three-dimensional component to be filled can be divided into blocks according to a preset multiple of the cell sample volume. It can also be divided according to the size of the cell sample and the three-dimensional component to be filled on the X-axis, Y-axis and Z-axis. This application does not limit the method of dividing the three-dimensional component to be filled.
[0063] Figure 2 This is a schematic structural diagram of a three-dimensional component to be filled provided in an embodiment of the present application. Figure 3 This is a schematic diagram of the structure of a cell sample provided in the embodiment of the present application. For ease of understanding, the following will be combined with Figure 2 and Figure 3 Provide explanation.
[0064] Figure 2 A schematic diagram showing a three-dimensional component to be filled, Figure 3For filling Figure 2 The basic unit of the three-dimensional component to be filled is shown, that is, a cell sample. In a specific embodiment, as shown in FIG. Figure 2 As shown, the three-dimensional component to be filled can be divided into multiple sub-components through dotted lines. It should be noted that the sub-components after division can be of the same shape or different shapes, which is not limited in this application.
[0065] S12: determining a pre-filled region of the subcomponent; the pre-filled region is composed of a plurality of virtual cell arrangements and combinations that are congruent with the cell sample, and the subcomponent is within the pre-filled region;
[0066] After dividing the three-dimensional component to be filled into multiple subcomponents, it is necessary to further determine the pre-filled region of each subcomponent. The pre-filled region is formed by the arrangement and combination of multiple virtual cells that are congruent to the cell sample. The virtual cell is not a physical cell, but rather represents the three-dimensional space that can be used to fill the cell sample. The virtual cells are tightly connected without gaps, that is, they are arranged and combined closely. In addition, it should be noted that the obtained pre-filled region completely encloses the subcomponent, that is, the subcomponent is completely within the pre-filled cell region.
[0067] Figure 4 This is a schematic diagram of a three-dimensional component to be filled and a pre-filled area provided in an embodiment of the present application. For ease of understanding, the following will be combined with Figure 4 Provide explanation. Figure 4 The blue area on the left is the top view of the three-dimensional component to be filled. Figure 4 After the three-dimensional component to be filled is divided into blocks in the Y-axis direction as shown, Figure 4 As shown in the left figure, each blue block after the dividing line is recorded as a sub-component.
[0068] Figure 4 The picture on the right is a schematic diagram of the pre-filled area. Figure 4 The right picture and Figure 4 Corresponding to the left figure, each sub-component corresponds to a pre-filled area, and each pre-filled area is composed of multiple virtual cell arrangements and combinations. Figure 4 In the right figure, the top view of the virtual cell and the cell sample is a square three-dimensional structure, for example, it can be a cube. The top view of the virtual cell is as follows: Figure 4 The grid shown in the right figure. Among them, the pre-filled area is, for example, Figure 4 The two rightmost columns of squares in the right figure, that is, the pre-filled area corresponding to the rightmost sub-component is composed of two columns of virtual cells.
[0069] It should be noted that due to Figure 4The figure shows a top view. In fact, the pre-filled area is a three-dimensional space formed by arranging multiple virtual cells. The sub-components are in the corresponding three-dimensional space, and the entire pre-filled three-dimensional component is in the area formed by all pre-filled areas, that is, all pre-filled areas completely wrap the entire three-dimensional component to be filled.
[0070] Figure 5 This is a schematic diagram of another three-dimensional component to be filled and a pre-filled area provided in an embodiment of the present application. For ease of understanding, further according to Figure 5 Explain. Figure 5 The rabbit shown in the left picture is a three-dimensional component to be filled, where the dotted box is a sub-component after being divided along the Z axis.
[0071] like Figure 5 As shown in the right figure, the virtual cell is a blue cube, corresponding to Figure 5 The sub-component in the dashed box on the left corresponds to the red rabbit in the dashed box on the far left of the right image. Furthermore, the arrangement of multiple blue cubes within the dashed box constitutes a pre-filled area, which also refers to a three-dimensional space that can be used to fill in word components.
[0072] according to Figure 5 As can be seen from the right figure, the sub-components are in the corresponding pre-filled areas, and the three-dimensional space composed of all virtual cells (i.e., all cubes) (i.e., all pre-filled areas) completely contains the entire three-dimensional component to be filled, that is, the entire three-dimensional component to be filled is inside all pre-filled areas.
[0073] S13: When it is determined that the area where the virtual cell is located belongs to the interior of the corresponding sub-component, the area where the virtual cell is located is used as the cell area to be filled;
[0074] S14: Fill the cell area to be filled with cell samples.
[0075] It is understandable that if Figure 4 and Figure 5 As shown, the pre-filled area includes the cell area to be filled and the non-filled cell area that does not need to be filled. In a specific embodiment, before filling the three-dimensional component to be filled, it is first determined which areas need to be filled and which areas do not need to be filled. This allows the cell area to be filled to be quickly filled, thereby improving the filling efficiency of the component.
[0076] Specifically, after obtaining the pre-filled area of each sub-component, it is sequentially determined whether the virtual cell corresponding to each sub-component is within the corresponding sub-component. It can be understood that when the virtual cell is within the corresponding sub-component, that is, when the virtual cell is part of the sub-component, it can be determined that the virtual cell is an area that needs to be filled, and the area where the virtual cell is located is marked as a cell area to be filled. Of course, if the area where the virtual cell is located does not belong to the corresponding sub-component, the area where the virtual cell is located can be marked as a non-filled cell area.
[0077] like Figure 4 As shown in the right figure, the completely blank squares are the non-cell filling areas, and the virtual cells in the blue area are marked as the cell areas to be filled. Figure 5 As shown in the right figure, the area corresponding to the completely blank cube is the non-filled cell area, and the area where the virtual cell with the red rabbit is located is the cell area to be filled.
[0078] Finally, after determining the cell region to be filled, when filling the three-dimensional component, the cell region to be filled is directly filled with cell samples. Figure 6 for Figure 2 The three-dimensional component to be filled is shown Figure 3 The schematic diagram of the effect after the cell sample is filled is shown. Figure 7 for Figure 6 Schematic diagram of the filled part.
[0079] like Figure 6 As shown, Figure 2 The three-dimensional component to be filled is shown Figure 3 The filling effect is obtained after the provided cell sample is filled. Among them, the local effect of filling is as follows Figure 7 shown.
[0080] Therefore, the filling method of the three-dimensional component provided in the embodiment of the present application reduces the filling complexity by dividing the three-dimensional component to be filled into blocks. On the basis of the block division, the position relationship between the sub-components and virtual cells after the block division is judged, so as to achieve the advance determination of the area requiring cell filling before the cell filling, that is, the cell area to be filled is determined, thereby avoiding the computational pressure caused by judging the non-filled area during filling, and greatly improving the filling efficiency of the three-dimensional component.
[0081] In an optional embodiment, the first geometric parameters and the second geometric parameters are both obtained based on a pre-constructed three-dimensional space coordinate system, wherein the first geometric parameters include a first starting coordinate and a first dimension on the X-axis, Y-axis and Z-axis respectively, and the second geometric parameters include a second starting coordinate and a second dimension on the X-axis, Y-axis and Z-axis respectively.
[0082] In fact, when this application divides the three-dimensional component to be filled into blocks according to the first geometric parameter and the second geometric parameter, it is sufficient to know the size information of the three-dimensional component to be filled and the cell sample. This application does not limit how to obtain the geometric parameters and the content included in the obtained geometric parameters.
[0083] However, in order to quickly obtain the first geometric parameter and the second geometric parameter, in an optional embodiment, based on a pre-constructed three-dimensional space coordinate system, the starting coordinates of the three-dimensional component to be filled and the cell sample in the three-dimensional space coordinate system, as well as the dimensions (i.e., length) on the X-axis, Y-axis, and Z-axis respectively are directly obtained.
[0084] Among them, the first starting coordinate of the three-dimensional component to be filled can be recorded as ( ), and the first dimensions of the three-dimensional component to be filled on the X-axis, Y-axis and Z-axis are respectively recorded as 、 and The second starting coordinate of the cell sample is marked as ( ), and the second dimensions of the cell samples on the X-axis, Y-axis, and Z-axis are recorded as , and .
[0085] It should be noted that the pre-constructed three-dimensional space coordinates can be a Cartesian coordinate system, for example, Figure 2 The three-dimensional space coordinate system constructed as shown can also be other three-dimensional space coordinate systems, which is not limited in this application.
[0086] Based on the above embodiment, as an optional embodiment, the three-dimensional component to be filled is divided into blocks according to the first geometric parameter and the second geometric parameter to obtain multiple sub-components, including:
[0087] Determine first ratios of the first dimension divided by the second dimension on the same axis of the X axis, the Y axis, and the Z axis respectively;
[0088] The axis corresponding to the one with the largest first ratio is used as the spatial block axis of the three-dimensional component to be filled;
[0089] Taking the first starting coordinate as the starting point, along the spatial block axis, a second size corresponding to the spatial block axis is stepped once to perform block division to obtain a subcomponent.
[0090] In a specific embodiment, when dividing the three-dimensional component to be filled, in order to balance computational complexity and computational efficiency, the division is performed based on the original second geometric parameter of the cell, and as many sub-components as possible are divided.
[0091] Specifically, a first ratio is calculated by dividing a first dimension by a second dimension on the same axis. For example, the dimension of the to-be-filled three-dimensional component on the X-axis (i.e., the length of the to-be-filled three-dimensional component on the X-axis) is divided by the dimension of the cell sample (i.e., the length of the cell sample on the X-axis). Thus, a first ratio is calculated for each of the X-axis, Y-axis, and Z-axis, resulting in three first ratios.
[0092] Furthermore, to obtain more subcomponents, the axis corresponding to the largest first ratio is used as the spatial partitioning axis of the 3D component to be filled, that is, as the reference axis for the final subcomponent division. For example, if the first ratio corresponding to the X-axis is 100, the first ratio corresponding to the Y-axis is 69, and the first ratio corresponding to the Z-axis is 86, then the X-axis is used as the spatial partitioning axis.
[0093] After determining the spatial partitioning axis, starting from the first starting coordinate of the three-dimensional component to be filled, steps are performed along the spatial partitioning axis, with each step length being equal to the second dimension corresponding to the spatial partitioning axis, thereby forming multiple sub-components. It should be noted that in an optional embodiment, the length of a single step can also be set based on actual business needs, and this application does not impose any restrictions on this.
[0094] For example, in the above example, the X-axis is used as the spatial division axis, where the original second dimension of the corresponding cell on the X-axis is 3 centimeters (cm). Then, along the X-axis direction, a single step of 3 cm is used to divide the three-dimensional component to be filled.
[0095] like Figure 2 As shown, with the Y axis as the spatial block axis, the second dimension corresponding to the Y axis is stepped once to divide the three-dimensional component to be filled into blocks, and the obtained Figure 4 Multiple sub-components are shown.
[0096] It is worth noting that, based on the above embodiment, after the three-dimensional component to be filled is divided into blocks, the coordinate range of each sub-component in the three-dimensional space coordinate system needs to be determined for subsequent cell filling calculations.
[0097] Specifically, if the space partition axis is the X axis, The calculation formula for the three-dimensional space coordinate range of the block component is as follows:
[0098] , ;
[0099] , ;
[0100] , ;
[0101] If the space partition axis is the Y axis, The calculation formula for the three-dimensional space coordinate range of the block component is as follows:
[0102] , ;
[0103] , ;
[0104] , ;
[0105] If the space block axis is the Z axis, The calculation formula for the three-dimensional space coordinate range of the block component is as follows:
[0106] , ;
[0107] , ;
[0108] , ;
[0109] in, , and They represent the starting coordinate positions of the nth subcomponent on the X-axis, Y-axis, and Z-axis respectively. , and Respectively represent the coordinate end position of the nth sub-component on the X-axis, Y-axis and Z-axis.
[0110] Therefore, the filling method of the three-dimensional component provided in the embodiment of the present application divides the three-dimensional component to be filled into blocks based on the second geometric parameter of the cell sample, and uses the maximum of the first ratio as the spatial blocking axis, thereby reducing the computational complexity while further improving the filling efficiency of the three-dimensional component to be filled.
[0111] In an optional embodiment, determining a pre-filled area of a sub-component includes:
[0112] Get the third starting coordinate of the subcomponent, as well as the third size of the subcomponent on the X-axis, Y-axis, and Z-axis;
[0113] Determine a second ratio of the third dimension divided by the second dimension on the same axis of the X axis, the Y axis, and the Z axis respectively;
[0114] Rounding up the product of the second ratios of the same subcomponent to determine the target number of virtual cells corresponding to each subcomponent;
[0115] Starting from the third starting coordinate, along the X-axis, Y-axis, and Z-axis, a single step is made for the second dimension on the corresponding axis, and the number of steps is the target number to obtain the pre-filled area.
[0116] In fact, in a specific embodiment, when determining the pre-filled area of a sub-component, it is sufficient to ensure that the sub-component is within the corresponding pre-filled area. The specific determination method and rules are not limited in this application. In addition, the units (i.e., virtual cells) that constitute the pre-filled area can be of any structure, which is not limited in this application.
[0117] However, in order to further improve the filling efficiency of the three-dimensional component to be filled, in an optional embodiment, the virtual cell selects a spatial structure that is congruent with the cell sample, that is, the size, structural shape, volume, and space occupied are all the same as the cell sample.
[0118] In a specific embodiment, the number of virtual cells arranged and combined to form each pre-filled area is first determined. Specifically, the number of virtual cells required to enclose each subcomponent is determined. In an optional embodiment, the third starting coordinate of each subcomponent and its third dimensions along the X, Y, and Z axes are first obtained.
[0119] Furthermore, the second ratio of the third dimension divided by the second dimension on the same axis is calculated respectively, and all the second ratios corresponding to the same subcomponent are multiplied, and the multiplication result is rounded up, so as to obtain the number of virtual cells corresponding to each subcomponent.
[0120] It is understandable that the second ratio may not be a positive integer. In this case, for ease of calculation and to ensure subsequent filling accuracy, the multiplication result is rounded up to ensure that the pre-filled area completely encloses the sub-component. For example, the product of all the second ratios corresponding to a sub-component is 56.2, which is rounded up to 57. That is, the number of virtual cells corresponding to this sub-component is 57, and the pre-filled area is composed of 57 virtual cells.
[0121] After obtaining the target number of virtual cells, further, starting from the third starting coordinate of the subcomponent, steps are performed along the X-axis, Y-axis, and Z-axis respectively, and the length of each step is the corresponding second dimension on each axis. The number of steps is the same as the calculated target number of virtual cells.
[0122] For example, if the second dimension on the X-axis is 5 cm and the target number is 30, then the X-axis is stepped by 5 cm each time, and the number of steps is 30. Thus, after the X-axis, Y-axis, and Z-axis are all stepped, multiple virtual cells are obtained. That is, the multiple virtual cells are arranged and combined to form the pre-filled area.
[0123] Based on the above embodiment, after calculating the pre-filled area for each sub-component after segmentation, the position range of the pre-filled area can be determined according to the three-dimensional coordinate range of the sub-component. The calculation formula is as follows:
[0124] ;
[0125] ;
[0126] ;
[0127] ;
[0128] ;
[0129] ;
[0130] in, , and Respectively represent the current sub-component X axis nth row, Y axis mth column, Z axis The starting coordinate position of the virtual cell of the row. , and Respectively represent the current sub-component X axis nth row, Y axis mth column, Z axis The ending coordinate position of the virtual cell of the row.
[0131] Therefore, the filling method of the three-dimensional component provided in the embodiment of the present application calculates the pre-filling area of each component based on the geometric parameters of the cell sample, thereby further improving the filling efficiency and accuracy.
[0132] In an optional embodiment, determining whether the region where the virtual cell is located belongs to the interior of the corresponding sub-component includes:
[0133] Uniformly extract the coordinates of a preset number of sampling points from the virtual cell;
[0134] Based on the fast winding number algorithm, if it is determined that at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding sub-component, then the area where the virtual cell is located is determined to belong to the interior of the corresponding sub-component.
[0135] Based on the above embodiment, after obtaining the pre-filled area, it is necessary to determine which virtual cells in the pre-filled area corresponding to each sub-component need to be filled and which cells do not need to be filled. Specifically, in an optional embodiment, a preset number of sampling point coordinates are uniformly extracted from each virtual cell.
[0136] It is worth noting that in order to ensure filling accuracy, the extracted sampling point coordinates must be evenly distributed on the virtual cells. This application does not limit the number of extracted sampling point coordinates. In an optional embodiment, 8 coordinate points are evenly extracted on each virtual cell along the X-axis, Y-axis, and Z-axis, thereby obtaining 512 coordinate points.
[0137] Furthermore, the sampling point coordinates are calculated using the Fast Winding Number algorithm to determine whether at least one of the sampling coordinate points of each virtual cell belongs to the interior of the corresponding sub-component. If so, the area where the virtual cell is located is determined to belong to the interior of the corresponding sub-component, and the area where the virtual cell is located is marked as the cell area to be filled.
[0138] Therefore, the three-dimensional component filling method provided in the embodiments of the present application, based on the fast winding number algorithm, only requires calculating the positional relationship of the sampling point coordinates relative to the subcomponent, eliminating the need to calculate the specific distance between the virtual cell and the subcomponent, thus reducing computational complexity. Furthermore, when the coordinates of any sampling point of a virtual cell fall within the subcomponent, the area containing that virtual cell is considered to be within the cell area to be filled, eliminating the need to calculate the coordinates of other sampling points, significantly reducing the computational effort.
[0139] As an optional embodiment, determining that at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding subcomponent includes:
[0140] Get the vertex coordinates and triangle index of the subcomponent;
[0141] According to the vertex coordinates and triangle face index, the winding value corresponding to each sampling point coordinate is calculated in parallel through the fast winding number algorithm;
[0142] If there is at least one winding value greater than the threshold, it is determined that at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding sub-component.
[0143] like Figure 5 As shown, the triangle face index is the number of the triangle face in the entire three-dimensional component to be filled, which is used to index and identify each triangle face, and the vertex coordinates are the vertex coordinates of each triangle face.
[0144] In a specific embodiment, each subcomponent is traversed in turn to determine the area in each subcomponent that needs to be filled with cells. Specifically, the sampling point coordinates of the current subcomponent are traversed, and the vertex coordinates of the subcomponent are obtained based on the triangle patch index.
[0145] Furthermore, to further improve filling efficiency, based on vertex coordinates and triangle facet indices, a fast winding number algorithm is used to calculate the winding values of the sampling point coordinates using the industry-popular Libigl library. During the calculation, the coordinates of multiple sampling points are calculated in parallel on the GPU. Among all the winding values calculated for the virtual cell, if at least one is greater than a threshold value (for example, when the threshold is 0.5, if at least one of the winding values is greater than 0.5), it is determined that the sampling point coordinates are inside the subcomponent, indicating that the virtual cell partially or completely overlaps with the corresponding subcomponent. Therefore, the area where the virtual cell is located can be marked as the cell area to be filled.
[0146] like Figure 4 As shown in the right figure, areas where the grid partially or completely overlaps with the subcomponent are marked as unfilled cell regions. Areas where there is no overlap (i.e., blank squares) are marked as unfilled cell regions. Therefore, if the coordinates of any sampling point fall within the subcomponent, the area containing the corresponding virtual cell is considered to be in the unfilled cell region, and no further sampling points for that virtual cell need to be calculated.
[0147] Each subcomponent and its virtual cells are traversed sequentially until all subcomponents and all virtual cells are traversed, thereby determining the areas in all subcomponents that need cell filling. It is worth noting that when filling cells, the filling is performed on a subcomponent-by-block basis, thus reducing the amount of calculation and filling complexity.
[0148] Thus, the three-dimensional component filling method provided in the embodiments of this application divides complex three-dimensional components into blocks. When determining whether each virtual cell belongs to the area to be filled, only the three-dimensional information of the sub-components after the block is calculated, reducing the amount of calculation and complexity. In addition, compared with the tens of threads of traditional CPUs, the parallel acceleration of GPUs with thousands of threads further reduces calculation time.
[0149] In an optional embodiment, filling the cell area to be filled with cell samples includes:
[0150] The area where the target virtual cell is located in the cell area to be filled is used as the first filling area; the target virtual cell is a cell whose coordinates of a preset number of sampling points belong to the interior of the corresponding sub-component;
[0151] Extracting a specified virtual cell from the cell area to be filled; the specified virtual cell is a cell in which at least one coordinate point of a preset number of sampling points does not belong to the interior of the corresponding sub-component;
[0152] Through Boolean operations, determine the target area in the area where the specified virtual cell is located, which belongs to the corresponding sub-component; and use the target area as the second filling area;
[0153] The first filling area and the second filling area are filled with cell samples.
[0154] like Figure 4 As shown in the right figure, in a specific embodiment, the calculated cell area to be filled actually requires filling of the entire cell area, while some areas only require partial filling. For example, the edge of a three-dimensional component to be filled often only requires partial filling.
[0155] Therefore, in order to improve the filling accuracy, based on the above embodiment, as an optional embodiment, after obtaining the cell area to be filled, when actually filling each sub-component, the area where the coordinates of the preset number of sampling points collected are all inside the corresponding sub-component is marked as the first filling area, for example, Figure 4 The area in the right picture where the entire square is blue can be the first filled area.
[0156] In addition, the cells in the cell region to be filled in which at least one sampling coordinate point is not inside the corresponding sub-component are marked as designated cells, that is, cells in which only part of the region exists inside the corresponding sub-component. Further, the designated cells are calculated by Boolean operations to determine which parts of the designated cells need to be filled, that is, to determine the second filling region. For example, Figure 4 In the right picture, there are some blue areas within the squares, and these blue areas are the second filling areas.
[0157] Finally, after obtaining the first filling area and the second filling area, the cell samples are filled in the first filling area and the second filling area in parallel. For example, Figure 2 The areas to be filled are Figure 3 After filling the cell sample shown, we get Figure 6 The 3D component of the fill effect shown.
[0158] Therefore, on the basis of determining the area to be filled and the non-filled area, Boolean operations are used to accurately determine the area at the edge of the three-dimensional component that needs to be partially filled, thereby further improving the filling accuracy.
[0159] In the above embodiments, the filling method of the three-dimensional component is described in detail. The present application also provides a corresponding embodiment of a filling device for a three-dimensional component.
[0160] Figure 8 A schematic structural diagram of a filling device for a three-dimensional component provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the device includes:
[0161] The geometric parameter acquisition module 80 is used to acquire the first geometric parameters of the three-dimensional component to be filled and the second geometric parameters of the cell sample; the cell sample is the cell used to fill the three-dimensional component to be filled;
[0162] A component segmentation module 81 is configured to segment the three-dimensional component to be filled into multiple sub-components according to the first geometric parameter and the second geometric parameter;
[0163] A pre-filled region determination module 82 is used to determine a pre-filled region of a subcomponent; the pre-filled region is composed of a plurality of virtual cells that are congruent with the cell sample, and the subcomponent is within the pre-filled region;
[0164] A cell region determination module 83 for determining the cell region to be filled, for determining the region where the virtual cell is located as the cell region to be filled when it is determined that the region where the virtual cell is located belongs to the interior of the corresponding sub-component;
[0165] The cell filling module 84 is used to fill the cell area to be filled with cell samples.
[0166] In addition, the filling device for the three-dimensional component provided in the embodiment of the present application further includes:
[0167] A first ratio determination module is used to determine first ratios of a first dimension divided by a second dimension on the same axis of the X axis, the Y axis, and the Z axis respectively;
[0168] a spatial block axis determination module, configured to use the axis corresponding to the one with the largest first ratio as the spatial block axis of the three-dimensional component to be filled;
[0169] The first stepping module is used to take the first starting coordinate as the starting point, and step the second size corresponding to the spatial block axis once along the spatial block axis to perform block division to obtain sub-components.
[0170] The geometric parameter acquisition module is further used to obtain the third starting coordinate of the sub-component and the third size of the sub-component on the X axis, Y axis and Z axis;
[0171] A second ratio determination module is used to determine a second ratio of the third dimension on the same axis of the X axis, the Y axis and the Z axis divided by the second dimension;
[0172] a target quantity determination module, configured to round up the product of the second ratios of the same subcomponent to an integer to determine the target quantity of virtual cells corresponding to each subcomponent;
[0173] The second stepping module is used to take the third starting coordinate as the starting point, and step the second size on the corresponding axis along the X-axis, Y-axis and Z-axis respectively, with the number of steps being the target number, to obtain a pre-filled area.
[0174] A sampling point coordinate extraction module is used to uniformly extract a preset number of sampling point coordinates from the virtual cell;
[0175] The first processing module is configured to determine, based on a fast winding number algorithm, that the region where the virtual cell is located belongs to the interior of the corresponding subcomponent if at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding subcomponent.
[0176] Target acquisition module, used to obtain the vertex coordinates and triangle face index of the sub-component;
[0177] The second processing module is used to calculate the winding values corresponding to the coordinates of each sampling point in parallel according to the vertex coordinates and the triangle face index through a fast winding number algorithm; if at least one winding value is greater than the threshold, it is determined that at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding sub-component.
[0178] A first filling area determination module is configured to determine an area in the cell area to be filled where the target virtual cell is located as a first filling area; the target virtual cell is a cell whose coordinates of a preset number of sampling points belong to the interior of the corresponding sub-component;
[0179] A designated virtual cell extraction module is used to extract designated virtual cells from the cell area to be filled; the designated virtual cells are cells in which at least one coordinate point of a preset number of sampling points does not belong to the interior of the corresponding sub-component;
[0180] A second filling area determination module is used to determine, through Boolean operations, a target area within the corresponding sub-component in the area where the designated virtual cell is located, and use the target area as the second filling area;
[0181] The target filling module is used to fill the first filling area and the second filling area with cell samples.
[0182] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 9 As shown, the electronic device includes: a memory 90 for storing computer programs;
[0183] The processor 91 is configured to implement the steps of the three-dimensional component filling method mentioned in the above embodiment when executing a computer program.
[0184] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0185] Among them, the processor 91 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 91 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 91 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 91 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 91 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0186] The memory 90 may include one or more computer-readable storage media, which may be non-transitory. The memory 90 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 90 is at least used to store the following computer program 901, wherein, after the computer program is loaded and executed by the processor 91, it can implement the relevant steps of the three-dimensional component filling method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 90 may also include an operating system 902 and data 903, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 902 may include Windows, Unix, Linux, etc. The data 903 may include but is not limited to the relevant data involved in the three-dimensional component filling method, etc.
[0187] In some embodiments, the electronic device may further include a display screen 92 , an input / output interface 93 , a communication interface 94 , a power supply 95 , and a communication bus 96 .
[0188] Those skilled in the art will understand that Figure 9 The structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure.
[0189] The electronic device provided in an embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the filling method of the three-dimensional component in the above embodiment.
[0190] It should be noted that although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
Claims
1. A filling method for a three-dimensional component, characterized in that: The method comprises: Acquire a first geometric parameter of a three-dimensional component to be filled and a second geometric parameter of a cell sample; the cell sample is a cell used to fill the three-dimensional component to be filled; Dividing the to-be-filled three-dimensional component into blocks according to the first geometric parameter and the second geometric parameter to obtain a plurality of sub-components; Determine a pre-filled area of the subcomponent; the pre-filled area is composed of a plurality of virtual cell arrangements and combinations that are congruent with the cell sample, and the subcomponent is within the pre-filled area; When it is determined that the area where the virtual cell is located belongs to the interior of the corresponding sub-component, the area where the virtual cell is located is used as the cell area to be filled; Filling the cell area to be filled with the cell sample; The filling of the cell area to be filled with the cell sample includes: Uniformly extracting a preset number of sampling point coordinates from the virtual cell; The area where the target virtual cell is located in the cell area to be filled is used as the first filling area; the target virtual cell is a cell where the coordinates of the preset number of sampling points belong to the interior of the corresponding sub-component; Extracting a designated virtual cell from the cell region to be filled; the designated virtual cell is a cell in which at least one coordinate point of the preset number of sampling point coordinates does not belong to the interior of the corresponding sub-component; Determine, through Boolean operations, a target area in the area where the designated virtual cell is located that belongs to the interior of the corresponding sub-component; and use the target area as a second filling area; The first filling area and the second filling area are filled with the cell sample.
2. The filling method of a three-dimensional component according to claim 1, characterized in that: In a pre-constructed three-dimensional space coordinate system, the first geometric parameters include a first starting coordinate and a first size on the X-axis, Y-axis and Z-axis respectively, and the second geometric parameters include a second starting coordinate and a second size on the X-axis, Y-axis and Z-axis respectively.
3. The filling method of a three-dimensional component according to claim 2, characterized in that: The step of dividing the three-dimensional component to be filled into blocks according to the first geometric parameter and the second geometric parameter to obtain a plurality of sub-components includes: Determine first ratios of the first dimension divided by the second dimension on the same axis of the X axis, the Y axis, and the Z axis respectively; The axis corresponding to the one with the largest first ratio is used as the spatial block axis of the three-dimensional component to be filled; Taking the first starting coordinate as a starting point, along the spatial block axis, a second size corresponding to the spatial block axis is stepped once to perform block division to obtain the sub-component.
4. The filling method of a three-dimensional component according to claim 2, characterized in that: Determining the pre-filled area of the sub-component includes: Acquire a third starting coordinate of the subcomponent, and third sizes of the subcomponent on the X-axis, the Y-axis, and the Z-axis; Determine a second ratio of the third dimension divided by the second dimension on the same axis of the X axis, the Y axis, and the Z axis respectively; Rounding up the product of the second ratios of the same subcomponent to determine the target number of virtual cells corresponding to each subcomponent; Starting from the third starting coordinate, the pre-filled area is obtained by stepping along the X-axis, the Y-axis, and the Z-axis by a single step corresponding to the second dimension of the axis, and the number of steps is the target number.
5. The filling method of a three-dimensional component according to claim 2, characterized in that: Determining whether the region where the virtual cell is located belongs to the interior of the corresponding subcomponent includes: Based on the fast winding number algorithm, if it is determined that at least one coordinate point of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding sub-component, then it is determined that the area where the virtual cell is located belongs to the interior of the corresponding sub-component.
6. The filling method of a three-dimensional component according to claim 5, characterized in that: Determining that at least one of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding subcomponent includes: Obtaining the vertex coordinates and triangle face index of the subcomponent; According to the vertex coordinates and the triangle patch index, the winding value corresponding to each sampling point coordinate is calculated in parallel by the fast winding number algorithm; If at least one of the winding values is greater than a threshold, it is determined that at least one of the sampling point coordinates of the virtual cell belongs to the interior of the corresponding sub-component.
7. A filling device for a three-dimensional component, characterized in that: The device comprises: A geometric parameter acquisition module, configured to acquire first geometric parameters of a to-be-filled three-dimensional component and second geometric parameters of a cell sample; the cell sample is a cell used to fill the to-be-filled three-dimensional component; A component segmentation module, configured to segment the three-dimensional component to be filled into multiple sub-components according to the first geometric parameter and the second geometric parameter; A pre-filled area determination module is used to determine a pre-filled area of the sub-component; the pre-filled area is composed of a plurality of virtual cells that are congruent with the cell sample, and the sub-component is within the pre-filled area; a cell region determination module to be filled, configured to, when determining that the region where the virtual cell is located belongs to the interior of the corresponding sub-component, use the region where the virtual cell is located as the cell region to be filled; A cell filling module, configured to fill the cell area to be filled with the cell sample; A sampling point coordinate extraction module, configured to uniformly extract a preset number of sampling point coordinates from the virtual cell; A first filling area determination module is configured to determine an area in the to-be-filled cell area where a target virtual cell is located as a first filling area; the target virtual cell is a cell where the coordinates of the preset number of sampling points all belong to the interior of the corresponding sub-component; A designated virtual cell extraction module is configured to extract designated virtual cells from the cell region to be filled; the designated virtual cells are cells in which at least one coordinate point of the preset number of sampling points does not belong to the interior of the corresponding sub-component; A second filling area determination module is configured to determine, through Boolean operations, a target area within the corresponding sub-component in the area where the designated virtual cell is located, and use the target area as a second filling area; A target filling module is used to fill the first filling area and the second filling area with the cell sample.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the program, the steps of the three-dimensional component filling method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the three-dimensional component filling method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Three-period minimal curved surface structure efficient design system for multiple application scenes
CN118194588A