Material modeling method, device and equipment and computer readable storage medium
By performing voxelization processing and distance calculation on the original geometric model, the voxel material type is automatically allocated, which solves the problem of inefficient modeling in multi-material 3D printing, and achieves efficient material attribute allocation and model accuracy.
Patent Information
- Application Number
- CN202510301594.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-07-29
AI Technical Summary
In the field of multi-material 3D printing, material modeling is inefficient and it is difficult to directly express the discrete distribution and diversified properties of internal materials. It requires manual manual setting of material properties and repeated adjustments.
By voxelizing the original geometric model, a voxel model is generated, and the distance between the voxel and the reference geometry is calculated. The material type of voxel is automatically allocated based on the distance and the preset material type, and a target model that meets the preset index requirements is obtained.
It improves the efficiency of material modeling, realizes automated material attribute allocation, and improves the accuracy and efficiency of modeling.
Smart Images

Figure CN120388656A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer modeling technology, and in particular, to a material modeling method, device, equipment, and computer-readable storage medium. Background Art
[0002] With the continuous development of technology, multi-material 3D printing technology has become an important technology in the field of advanced manufacturing, showing great application potential in product prototype design, complex structure manufacturing, and functional material integration.
[0003] Currently, in the field of multi-material 3D printing, common computer-aided design mainly focuses on geometric model design, fails to directly express the discrete distribution of internal materials, and it is difficult to define diverse material properties in specific regions. Therefore, common material model design usually requires researchers to manually set material properties and repeatedly adjust, resulting in low modeling efficiency.
[0004] Therefore, how to improve material modeling efficiency is an urgent problem to be solved currently. Summary of the Invention
[0005] The main purpose of this application is to provide a material modeling method, device, equipment, and computer-readable storage medium, aiming to improve material modeling efficiency.
[0006] To achieve the above object, this application provides a material modeling method, and the material modeling method includes: performing voxelization processing on an original geometric model to obtain a voxel model;
[0007] Calculating the distance between each first voxel in the voxel model and a preset reference geometry;
[0008] Based on each of the distances and each preset material type, determining the material type of each of the first voxels to obtain a target model that meets the preset index requirements.
[0009] In one embodiment, the step of performing voxelization processing on the original geometric model to obtain a voxel model includes:
[0010] Converting the original geometric model into a boundary representation model, and determining the hexahedron bounding box of the boundary representation model, where the boundary representation model is located inside the hexahedron bounding box;
[0011] Dividing the hexahedron bounding box into a plurality of second voxels according to a preset segmentation rule;
[0012] Determining a voxel model based on each of the second voxels.
[0013] In one embodiment, the step of determining a voxel model based on each of the second voxels includes:
[0014] For any target voxel among the second voxels, determine the central point position of the target voxel;
[0015] Determine whether the central point position is inside the original geometric model;
[0016] In the case where the central point position is inside the original geometric model, use the target voxel as the first voxel.
[0017] In one embodiment, before the step of calculating the distances between the first voxels in the voxel model and a preset reference geometry, the method further includes:
[0018] Scale and translate the original geometric model based on the model parameters of the original geometric model to obtain the reference geometry.
[0019] In one embodiment, the preset index includes Shore hardness. The step of determining the material type of each first voxel based on the distances and each preset material type to obtain a target model that meets the requirements of the preset index includes:
[0020] Arrange the distances according to a preset rule to obtain a distance list;
[0021] Determine the distance sub - lists corresponding to each preset material type based on the Shore hardness, where the distance sub - lists are obtained by splitting the distance list;
[0022] For any target sub - list in each of the distance sub - lists, assign the voxels corresponding to the target sub - list to the preset material type corresponding to the target sub - list to obtain a target model that meets the Shore hardness requirements.
[0023] In one embodiment, the step of determining the distance sub - lists corresponding to each preset material type based on the Shore hardness includes:
[0024] Determine the arrangement order of each preset material type based on the Shore hardness, and the number of voxels in the voxel model that are respectively assigned to each preset material type;
[0025] Based on the quantities sorted according to the arrangement order, split the distance list into multiple distance sub - lists;
[0026] For any target material among each of the preset material types, determine the distance sub - list arranged in the target order in the multiple distance sub - lists as the distance sub - list corresponding to the target material, where the target order is the arrangement order of the target material among each of the preset material types.
[0027] In one embodiment, after the step of determining the material type of each of the first voxels based on each of the distances and each preset material type to obtain a target model that meets the preset index requirements, the method further includes:
[0028] Combining voxel faces that are on the same plane on the surface of the target model and can be directly or indirectly connected into independent faces;
[0029] Combining each of the independent faces into a surface shell model, and performing coplanar merging processing on the surface shell model to obtain a simplified model;
[0030] Converting the simplified model into a mesh model for printing.
[0031] In addition, to achieve the above object, the present application further provides a material modeling device, where the material modeling device includes:
[0032] A voxelization module, configured to perform voxelization processing on an original geometric model to obtain a voxel model;
[0033] A distance field module, configured to calculate the distance between each first voxel in the voxel model and a preset reference geometry;
[0034] A material allocation module, configured to determine the material type of each of the first voxels based on each of the distances and each preset material type to obtain a target model that meets the preset index requirements.
[0035] In addition, to achieve the above object, the present application further provides a storage medium, where the storage medium is a computer-readable storage medium, and a program for implementing the material modeling method is stored on the computer-readable storage medium, and the program for implementing the material modeling method is executed by a processor to implement the steps of the material modeling method as described above.
[0036] In addition, to achieve the above object, the present application further provides a computer program product, including a computer program, where the computer program, when executed by a processor, implements the steps of the material modeling method as described above.
[0037] The present application provides a material modeling method. The present application first performs voxelization processing on an original geometric model to obtain a voxel model, then calculates the distance between each first voxel in the voxel model and a preset reference geometry, and finally determines the material type of each first voxel based on the distance between each first voxel and the reference geometry and each preset material type to obtain a target model carrying voxel material types and meeting the preset index requirements.
[0038] In summary, compared with the traditional method of manually setting the material properties of each part in the geometric model, in this application, the original geometric model is voxelized to obtain a voxel model containing multiple voxels, and then based on the distance between each voxel and the reference geometry and multiple preset material types, the material type corresponding to each voxel is automatically assigned to obtain a target model that meets the requirements of the preset indicators, thereby improving the efficiency of material modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application.
[0040] To more clearly illustrate the technical solutions in the embodiments of the present application or in the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0041] Figure 1 It is a schematic flowchart of the first embodiment of the material modeling method of the present application;
[0042] Figure 2 It is a schematic flowchart of the voxelization process involved in an embodiment of the material modeling method of the present application;
[0043] Figure 3 It is a schematic diagram of function mapping involved in an embodiment of the material modeling method of the present application;
[0044] Figure 4 It is a schematic flowchart of the material distribution process involved in an embodiment of the material modeling method of the present application;
[0045] Figure 5 It is a schematic flowchart of the voxel material allocation process involved in an embodiment of the material modeling method of the present application;
[0046] Figure 6 It is a schematic flowchart of the model simplification process involved in an embodiment of the material modeling method of the present application;
[0047] Figure 7 It is a schematic diagram of the module structure of the material modeling device of the present application;
[0048] Figure 8 It is a schematic diagram of the device structure of the hardware operating environment involved in the material modeling method in the embodiments of the present application.
[0049] The implementation, functional features, and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not used to limit the present application.
[0051] To better understand the technical solutions of the present application, the following will be described in detail in conjunction with the accompanying drawings of the specification and specific implementation manners.
[0052] The main solution of the present application is: performing voxelization processing on the original geometric model to obtain a voxel model; calculating the distances between each first voxel in the voxel model and a preset reference geometry; and determining the material type of each first voxel based on each of the distances and multiple preset material types to obtain a target model that meets the requirements of preset indicators.
[0053] Currently, in the field of multi-material 3D printing, common computer-aided design mainly focuses on geometric model design, fails to directly express the discrete distribution of internal materials, and is difficult to define diverse material properties in specific regions. Therefore, common material model design usually requires researchers to manually set material properties and repeatedly adjust, resulting in low modeling efficiency.
[0054] Therefore, how to improve the efficiency of material modeling is an urgent problem to be solved currently.
[0055] Compared with the traditional method of manually setting the material properties of each part in the geometric model, the present application performs voxelization on the original geometric model to obtain a voxel model containing multiple voxels, and then automatically assigns the corresponding material type to each voxel based on the distance between each voxel and the reference geometry and multiple preset material types, obtaining a target model that meets the requirements of preset indicators, thereby improving the efficiency of material modeling.
[0056] It should be noted that the execution subject of the method in each embodiment of the material modeling method of the present application can be a material modeling system, or a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a material modeling device capable of implementing the above functions, etc. This embodiment does not make specific limitations on this. The following takes the material modeling system as the execution subject as an example to illustrate this embodiment and the following embodiments.
[0057] Based on this, the present application proposes a material modeling method for the first embodiment. Please refer to Figure 1 , and the material modeling method includes steps S10 to S30:
[0058] Step S10, performing voxelization processing on the original geometric model to obtain a voxel model;
[0059] It should be noted that the original geometric model is a three-dimensional model of the material to be allocated. The model obtained after voxelizing the original geometric model is called a voxel model for distinction. Among them, the voxel model is composed of multiple cubes of the same volume, and such a cube is called a voxel.
[0060] In this embodiment, step S10 may include:
[0061] Step S101, convert the original geometric model into a boundary representation model, and determine the hexahedron bounding box of the boundary representation model, where the boundary representation model is located inside the hexahedron bounding box;
[0062] It should be noted that the original geometric model is imported into the Rhino environment, and the model parameters of the original geometric model are obtained through a parametric algorithm. Then, the original geometric model is converted into the Brep (Boundary Representation) format, which can accurately represent the geometric boundaries of the model, including but not limited to the detailed information of faces, edges, and vertices, to provide an accurate geometric basis for subsequent modeling operations. The model converted into the Brep format is called a boundary representation model for distinction.
[0063] After converting the original geometric model into a boundary representation model, determine the hexahedron bounding box of the boundary representation model, and the hexahedron bounding box completely wraps the boundary representation model. Specifically, the steps for generating the hexahedron bounding box based on the boundary representation model include: first calculating the minimum circumscribed rectangle of the boundary representation model, and then generating a cube or cuboid that tightly wraps the entire model, that is, the hexahedron bounding box. In addition, extract the geometric attributes of the hexahedron bounding box, that is, the dimension information such as length, width, and height, to provide a reference for subsequent operations.
[0064] Step S102, equally divide the hexahedron bounding box into multiple second voxels according to a preset segmentation rule;
[0065] It should be noted that the preset segmentation rule can be a rule that specifies the voxel size or a rule that specifies the number of segments.
[0066] Equally divide the hexahedron bounding box into multiple voxels (hereinafter referred to as second voxels for distinction) according to the preset segmentation rule.
[0067] In a feasible embodiment, according to the voxel size or the number of divisions input by the user, the hexahedron bounding box is equally divided in the x, y, and z directions of the pre-constructed spatial coordinate system. Specifically, when the preset division rule specifies the voxel size, first, according to the ratio between the coordinate length of the hexahedron bounding box in each coordinate axis direction and the voxel size, determine the number of divisions in each coordinate axis direction; then, based on the number of divisions of the x-axis and y-axis, equally divide the xy plane (the plane formed by the x-axis and y-axis) of the hexahedron bounding box into multiple two-dimensional small intervals; then, equally divide the intervals of the hexahedron bounding box in the z direction according to the number of divisions of the z-axis to obtain multiple small intervals. In this way, according to the interval information obtained by the equal division, a series of cubic voxels are constructed in space, and the boundary of each voxel is determined by the equal division interval of the hexahedron bounding box, ensuring that the generated voxel model has the same size as the hexahedron bounding box.
[0068] Step S103, determining a voxel model based on each of the second voxels;
[0069] Extract some voxels from each of the second voxels as the first voxels that make up the voxel model.
[0070] In this embodiment, the step S103 may include:
[0071] Step A10, for any target voxel in each of the second voxels, determining the central point position of the target voxel;
[0072] For each voxel in each of the second voxels (hereinafter referred to as the target voxel for distinction), determine the central point position of the target voxel, that is, the coordinates of the midpoint of the target voxel in the preset spatial coordinate system.
[0073] Exemplarily, represent the voxel position by the geometric center point of the voxel. Specifically, by analyzing the coordinate interval of each voxel, calculate the geometric center of each voxel, and use the coordinates of the geometric center as the spatial position of the voxel.
[0074] Step A20, determining whether the central point position is inside the original geometric model;
[0075] Determine whether the central point position is within the three-dimensional space occupied by the original geometric model.
[0076] Step A30, when the central point position is inside the original geometric model, use the target voxel as the first voxel.
[0077] Use the voxels whose central point positions are within the three-dimensional space occupied by the original geometric model as the first voxels.
[0078] Exemplarily, taking the original geometric model as a cylinder as an example, the original geometric model is voxelized. Specifically, as Figure 2 shown in the schematic diagram of the voxelization process. First, the boundary representation model obtained after converting the original geometric model into the Brep format, and the boundary representation model is referenced by label (1); based on the boundary representation model, its hexahedron bounding box is generated, and the hexahedron bounding box contains the boundary representation model, specifically referenced by label (2); the hexahedron bounding box is equally divided into multiple partitions, specifically referenced by label (3); based on the interval information after equal division, cubic voxels are constructed, specifically referenced by label (4); the central point positions of each voxel are determined, and the view corresponding to label (5) shows the distribution of each central point position; then it is judged whether the central point position of each voxel is within the three-dimensional space occupied by the original geometric model, specifically referenced by label (6); the voxels located within the three-dimensional space occupied by the original geometric model are determined, specifically referenced by label (7); the voxels corresponding to the central point positions not within the three-dimensional space occupied by the original geometric model are removed, and the remaining first voxels used to form the voxel model are obtained, specifically referenced by label (8); and it should be understood that when the voxel size is small enough, the finally obtained voxel model is infinitely close to the original geometric model, specifically referenced by label (9).
[0079] In this way, in the process of converting the original geometric model into a voxel model in this application, discrete cubes, that is, voxels, are first generated within the volume of the hexahedron bounding box of the model, and then the cubes whose geometric centers are located within the bounding volume of the original geometric model are retained, aiming to convert a three-dimensional model of any shape into a voxel model. At the same time, the screening process of the voxels improves the calculation efficiency and ensures that the finally obtained voxel model only contains valid voxels located inside the model.
[0080] Step S20, calculate the distance between each first voxel in the voxel model and a preset reference geometry;
[0081] It should be noted that the specific shape and specific position of the reference geometry are not limited in the embodiments of this application, and can be set according to the requirements of the user for the finished product printed based on the model.
[0082] Determine the reference geometry in the same coordinate system as the voxel model, and calculate the distance between each first voxel in the voxel model and the reference geometry.
[0083] In one feasible embodiment, when the reference geometry is a plane, the distance between the first voxel and the reference geometry is the distance between the center point of the voxel and the plane. Based on the spatial distance between each first voxel and the reference geometry, a gradient-changing influence field (i.e., distance field) is generated. It should be understood that in the influence field, the voxels that are closer to the reference geometry are more affected. Specifically, the smoothness and transition mode of the material distribution of the voxel point can be controlled by adjusting the gradient of the influence force on the voxel (linear gradient, quadratic gradient, or exponential gradient). The steeper the influence force gradient, the more drastic the change in material transition. In addition, mathematical functions (such as linear functions, quadratic functions, or exponential functions, etc.) can also be used to map the relationship between the distance value and the influence force in the distance field. The distribution range and transition effect of the material can be controlled by adjusting the parameters of these functions (such as weight factors, starting thresholds, and ending thresholds). For example, as Figure 3 In the function mapping diagram shown in the figure, the Dx axis represents the original data. The x coordinate is mapped to the function line, and each Dx mapped value becomes Dy. The initial function is Y1, and the adjusted function is Y2. In this way, it can be understood that if the threshold used in the subsequent region division (i.e., voxel point classification) remains unchanged, the voxel mapping value Dy can be changed by changing the function, thereby changing the region to which the voxel belongs. In other words, by adjusting the distance between the voxel and the reference geometry, the material it ultimately uses can be changed.
[0084] In this embodiment, step S20 may include:
[0085] Step S201 : scaling and translating the original geometric model based on the model parameters of the original geometric model to obtain the reference geometry.
[0086] It should be noted that the reference geometry is obtained by scaling and translating the original geometric model. There are four parameters to control it, namely scaling along the x-axis, scaling along the y-axis, scaling along the z-axis, and translation distance.
[0087] Step S30 : determining the material type of each of the first voxels based on the distances and the preset material types, and obtaining a target model that meets preset index requirements.
[0088] It should be noted that the preset index requirements are the user's requirements for the finished product printed based on the model. Preset indicators include but are not limited to Shore hardness, mechanical properties, cost-effectiveness, etc. For example, if the preset index is Shore hardness and the user requires a Shore hardness of 20HSD, if the Shore hardness of the finished product printed based on the target model is 20HSD, the target model is considered to meet the preset index requirements. The user pre-sets the material types to be used in the material allocation, namely the preset material types mentioned above.
[0089] Based on the distances between each first voxel in the voxel model and the reference geometry and each preset material type, allocate the constituent materials for each first voxel to obtain a target model that meets the requirements of the preset indicators.
[0090] In the embodiment of the present application, by voxelizing the original geometric model, a voxel model containing multiple voxels is obtained. Then, based on the distances between each voxel and the reference geometry and multiple preset material types, the material type corresponding to each voxel is automatically allocated to obtain a target model that meets the requirements of the preset indicators, thereby improving the efficiency of material modeling.
[0091] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar content as that in the above-mentioned first embodiment can be referred to the above introduction and will not be repeated hereinafter. On this basis, the preset indicator includes the Shore hardness, and the step S30 may include:
[0092] Step S301, arrange the distances according to a preset rule to obtain a distance list;
[0093] It should be noted that the arrangement rule of each distance is preset in advance, that is, the above-mentioned preset rule. Specifically, the preset rule may be arranged from small to large or from large to small. In this embodiment, the preset rule is arranged from small to large.
[0094] Arrange the distances in ascending order to obtain a distance list.
[0095] Step S302, determine the distance sub-lists corresponding to each preset material type based on the Shore hardness, where the distance sub-lists are obtained by splitting the distance list;
[0096] Determine the distance sub-lists corresponding to each preset material type based on the preset Shore hardness, where the distance sub-lists are obtained by splitting the distance list, and each preset material type corresponds to a distance sub-list.
[0097] In this embodiment, the step S302 may include:
[0098] Step B10, determine the arrangement order of each preset material type based on the Shore hardness, and the number of voxels in the voxel model that are respectively assigned to each preset material type;
[0099] It should be noted that the material modeling system of the present application can determine the material types of each voxel extending outward from the reference geometry, that is, the arrangement order of each preset material type, and determine the number of voxels in the voxel model that are assigned to each preset material type according to the Shore hardness indicated by the user and each preset material type that can be used.
[0100] Step B20: Based on the quantities after being sorted in the said arrangement order, divide the distance list into multiple distance sub-lists;
[0101] Sort the voxel quantities corresponding to each preset material type in the arrangement order, and then based on the sorted quantities, divide the distance list into multiple distance sub-lists. It should be noted that the number of distances in the distance sub-list ranked at the nth position is the same as the number of voxels ranked at the nth position.
[0102] Step B30: For any target material in each of the preset material types, determine the distance sub-list ranked at the target order in the multiple distance sub-lists as the distance sub-list corresponding to the target material, where the target order is the arrangement order of the target material in each of the preset material types.
[0103] For any one of the preset material types (hereinafter referred to as the target material for distinction), determine the distance sub-list ranked at the target order in the multiple distance sub-lists as the distance sub-list corresponding to the target material, where the target order is the arrangement order of the target material in each of the preset material types.
[0104] In a feasible implementation manner, there are 6 preset material types, and the number of distances between the voxels and the reference geometry is 1200. Then, based on the Shore hardness, determine the number of voxels divided into each material in the voxel model. Here, the number can also be a ratio; then sort the corresponding quantities in the arrangement order of each preset material type, which can be 200, 100, 150, 300, 250, and 200 in sequence; then, according to the sorted quantities, divide the distance list into 6 distance sub-lists.
[0105] Step S303: For any target sub-list in each of the distance sub-lists, assign the voxels corresponding to the target sub-list to the preset material type corresponding to the target sub-list to obtain a target model that meets the Shore hardness requirement.
[0106] For any one of the sub-lists in each of the distance sub-lists (hereinafter referred to as the target sub-list for distinction), assign the voxels corresponding to each distance in the target sub-list to the preset material type corresponding to the target sub-list to obtain a target model that meets the Shore hardness requirement.
[0107] In a feasible implementation, to obtain a colored visualization model, according to the number of preset material types input, a corresponding number of color tags are generated through a gradient technique; then, the distances from each first voxel to the reference geometry are sorted to obtain a distance list, and a voxel list corresponding to this distance list is determined, that is, in the new voxel list, the positions of each voxel will be sorted in ascending or descending order according to its distance to the reference geometry. For example, if it is in ascending order, the voxel closest to the reference geometry will be placed at the front of the list; then, the voxels are divided into multiple groups according to the distance by setting a threshold, that is, multiple distance sub-lists are obtained, where the threshold defines the boundary of each group of voxels to ensure that each voxel matches the corresponding color tag according to its distance, thereby controlling the distribution of materials; then, the grouped voxels are matched with the color tags. Since the number of voxels corresponding to each distance sub-list may be different, the color tag list needs to be extended. The extension method is to repeat or cycle the color tag list until its length is the same as the voxel list; then, the position of each voxel in the original voxel list is found through index information. The original voxel list is generated based on the spatial position of each voxel when the voxel model is generated. The original voxel list includes the identifiers of the arranged voxels, and then the color tags are corresponded to each voxel in the original voxel list to rearrange the color tags in the order of the voxels in the original voxel list; finally, the rearranged color tags and the voxel points are input into the visualization module to generate a voxel model with a color gradient effect. This model shows the distribution of different materials in the design space and can intuitively present the material color information corresponding to different voxels.
[0108] Exemplarily, as Figure 4 shown in the schematic diagram of the material distribution process. First, the reference geometry is determined. Referring to reference numeral (10), the reference geometry is located at the center of the voxel model. In this embodiment, the reference geometry is a plane; the distance between each first voxel and the reference geometry is calculated, that is, the distance between a point and a plane, specifically referring to reference numeral (11); then, color tags are assigned to each voxel in the voxel model, and each color tag corresponds to a material type, specifically referring to reference numeral (12); finally, a visualized voxel model with a color gradient effect is generated, specifically referring to reference numeral (13). Further, as Figure 5 shown in the schematic diagram of the voxel material assignment process, it can be understood that Figure 5 for the above Figure 4For the specific implementation of reference numeral (12), component a is used to calculate the number of distances in the distance list and determine that there are 1200 distance values in the distance list; assuming that the maximum value of each distance is D and there are 6 preset material types, then component b is used to input 5 ratios and perform the first division using the first ratio x1, that is, perform the division at a distance of D·x1, and divide to obtain a sub-list with distances ∈[0, D·x1] and a sub-list with distances ∈[D·x1, D]. Continue to divide the second sub-list, using the second ratio x2, that is, perform the division at a distance of (D - D·x1)·x2 + D·x1, divide to obtain two sub-lists, and continue to divide the second sub-list, repeat the operation until the fifth division, and finally obtain 6 distance sub-lists; component c is used to display the distance list obtained by arranging the distances in ascending order; component d is used to display the distance values (such as D·x1) generated by each list division; the list division process is equivalent to partitioning the voxels according to the distance from near to far to obtain 6 regions, and 6 color tags representing each preset material type in component e can be assigned to the 6 regions respectively, and one color represents one material type.
[0109] In the embodiment of the present application, through the voxel classification and color label matching technologies, the gradient distribution and transition of multiple materials are accurately realized, ensuring the material effect and structural stability during model printing.
[0110] Based on the first embodiment and the second embodiment of the present application, in the third embodiment of the present application, the same or similar content as in the above-mentioned first embodiment and second embodiment can be referred to the above introduction and will not be repeated hereinafter.
[0111] On this basis, after the step S30, the material modeling method of the present application may further include:
[0112] Step C10, merging the voxel faces on the surface of the target model that are in the same plane and can be directly or indirectly connected into independent faces;
[0113] It should be noted that an independent face refers to a face obtained by merging voxel faces on the surface that are in the same plane and can be directly or indirectly connected. If two voxel faces are adjacent, then these two voxel faces are considered to be directly connected. If two voxel faces are not adjacent, but can be connected through the voxel faces between them, then these two voxel faces are considered to be indirectly connected. Among them, a voxel face refers to a face of a voxel.
[0114] Identify the voxel faces on the surface of the target model that are in the same plane and can be directly or indirectly connected and merge them into an independent face.
[0115] Step C20, merging each of the independent faces into a surface shell model, and performing coplanar merging processing on the surface shell model to obtain a simplified model;
[0116] It should be noted that the coplanar merging process refers to merging multiple connected independent faces into one surface.
[0117] Generate a surface shell model based on each independent face, then merge the connected faces in the surface shell model into one face, and generate a new model (hereinafter referred to as the simplified model for distinction) based on each merged surface.
[0118] Step C30, convert the simplified model into a mesh model for printing.
[0119] It should be noted that the simplified model is in Brep format. After obtaining multiple independent faces, convert the simplified model into a mesh model to ensure that it meets the input requirements of the 3D printer. The generated mesh model will be exported in OBJ format for subsequent printing.
[0120] In a feasible embodiment, first, decompose the target model into several independent faces, and detect whether there are overlapping faces by calculating the positions of the center points of each independent face. If overlapping faces are found, delete the duplicate faces, only retain the independent faces, and output the geometric information of the independent faces. This process ensures that there are no duplicates in the external surface structure of the model, improving the subsequent calculation efficiency; then merge all the independent faces into a complete surface shell model, and merge the adjacent patches that are in the same plane into one face through coplanar merging to further reduce the number of model faces and simplify its geometric structure; finally, convert the simplified Brep model into a mesh model to ensure that it meets the input requirements of the 3D printer, and the generated mesh model will be exported in OBJ format for subsequent printing operations.
[0121] Exemplarily, as Figure 6 shown is a schematic diagram of the model simplification process. The label (14) represents the target model obtained after color label assignment; perform voxel face merging processing on the target model to obtain multiple faces, and obtain the surface shell model, specifically referring to the label (15); then perform coplanar merging processing on the surface shell model to obtain the simplified model, specifically referring to the label (16).
[0122] The embodiment of the present application effectively removes overlapping faces by adopting the center coincidence detection method, retains the surface shell model, and further simplifies the model through coplanar merging, optimizing the calculation bottleneck of traditional Boolean operations. Moreover, by generating a high-quality model suitable for 3D printing and converting the model into a mesh format, the smooth progress of the printing process is ensured.
[0123] The embodiment of the present application also provides a material modeling device, please refer to Figure 7 , the material modeling device includes:
[0124] A voxelization module 10, configured to perform voxelization processing on the original geometric model to obtain a voxel model;
[0125] A distance field module 20 for calculating the distance between each first voxel in the voxel model and a preset reference geometry;
[0126] A material distribution module 30 for determining the material type of each of the first voxels based on the distances and preset material types, to obtain a target model that meets the requirements of preset indicators.
[0127] Optionally, the voxelization module 10 is further configured to:
[0128] Convert the original geometry model into a boundary representation model, and determine a hexahedron bounding box of the boundary representation model, where the boundary representation model is located inside the hexahedron bounding box;
[0129] Divide the hexahedron bounding box into a plurality of second voxels according to a preset segmentation rule;
[0130] Determine a voxel model based on each of the second voxels.
[0131] Optionally, the voxelization module 10 is further configured to:
[0132] For any target voxel in each of the second voxels, determine the central point position of the target voxel;
[0133] Determine whether the central point position is inside the original geometry model;
[0134] In the case where the central point position is inside the original geometry model, use the target voxel as a first voxel.
[0135] Optionally, the material modeling device further includes a reference determination module, and the reference determination module is configured to:
[0136] Scale and translate the original geometry model based on the model parameters of the original geometry model to obtain the reference geometry.
[0137] Optionally, the preset indicator includes Shore hardness, and the material distribution module 30 is further configured to:
[0138] Arrange the distances according to a preset rule to obtain a distance list;
[0139] Determine distance sub-lists corresponding to preset material types based on the Shore hardness, where the distance sub-lists are obtained by dividing the distance list;
[0140] For any target sub-list in each of the distance sub-lists, assign the voxels corresponding to the target sub-list to the preset material type corresponding to the target sub-list to obtain a target model that meets the Shore hardness requirement.
[0141] Optionally, the material distribution module 30 is further configured to:
[0142] Determine the arrangement order of each preset material type based on the Shore hardness, and the number of voxels in the voxel model that are respectively assigned to each of the preset material types;
[0143] Based on the respective quantities sorted according to the arrangement order, divide the distance list into multiple distance sub-lists;
[0144] For any target material in each of the preset material types, determine that the distance sub-list arranged in the target order in the multiple distance sub-lists is the distance sub-list corresponding to the target material, where the target order is the arrangement order of the target material in each of the preset material types.
[0145] Optionally, the material modeling device further includes a simplification module, and the simplification module is configured to:
[0146] Merge the voxel faces on the surface of the target model that are in the same plane and can be directly or indirectly connected into independent faces;
[0147] Merge each of the independent faces into a surface shell model, and perform coplanar merging processing on the surface shell model to obtain a simplified model;
[0148] Convert the simplified model into a mesh model for printing.
[0149] The material modeling device provided in the embodiments of the present application adopts the material modeling method in the above embodiments, and can solve the technical problem of how to improve the material modeling efficiency. Compared with the prior art, the beneficial effects of the material modeling device provided in the embodiments of the present application are the same as the beneficial effects of the material modeling method provided in the above embodiments, and the other technical features in the material modeling device are the same as the features disclosed in the method of the above embodiments, and will not be elaborated here.
[0150] The present application provides a material modeling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the material modeling method in the first embodiment above.
[0151] Next, refer to Figure 8, which shows a schematic structural diagram of a material modeling device suitable for implementing the embodiments of the present application. The material modeling device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The shown material modeling device is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0152] As Figure 8 shown, the material modeling device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to the program stored in the read-only memory 1002 or the program loaded from the storage device 1003 into the random access memory 1004. In the random access memory 1004, various programs and data required for the operation of the material modeling device are also stored. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. The input / output interface 1006 is also connected to the bus. Generally, the following systems may be connected to the input / output interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the material modeling device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a material modeling device with various systems, it should be understood that it is not required to implement or have all the shown systems. Instead, more or fewer systems may be implemented or had.
[0153] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by a processing device 1001, the above functions defined in the methods of the embodiments disclosed in the present application are executed.
[0154] The material modeling device provided by the present application adopts the material modeling method in the above embodiments and can solve the technical problem of how to improve the efficiency of material modeling. Compared with the prior art, the beneficial effects of the material modeling device provided by the present application are the same as those of the material modeling method provided by the above embodiments, and other technical features in the material modeling device are the same as the features disclosed in the method of the previous embodiment, which will not be elaborated here.
[0155] It should be understood that the various parts disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0156] As described above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0157] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the material modeling method in the above embodiments.
[0158] The computer-readable storage medium provided by this application can, for example, be a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0159] The above computer-readable storage medium can be included in a material modeling device; or it can exist separately without being assembled into the material modeling device.
[0160] The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by a material modeling device, the material modeling device is caused to: perform voxelization processing on an original geometric model to obtain a voxel model; calculate the distances between each first voxel in the voxel model and a preset reference geometry; and determine the material type of each first voxel based on each of the distances and each preset material type to obtain a target model that meets the requirements of preset indicators.
[0161] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by connecting through the Internet service provider via the Internet).
[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and this module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutively represented blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0163] The modules involved in the embodiments described in this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0164] The readable storage medium provided in this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned material modeling method, and can solve the technical problem of how to improve the efficiency of material modeling. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the material modeling method provided in the above embodiments, and will not be elaborated here.
[0165] An embodiment of the present application provides a computer program product, including a computer program, which when executed by a processor implements the steps of the material modeling method as described above.
[0166] The computer program product provided by the present application can improve the efficiency of material modeling. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiments of the present application are the same as those of the material modeling method provided by the above embodiments, and will not be elaborated here.
[0167] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent scope of the present application.
Claims
1. A material modeling method, characterized in that, The described material modeling method includes: Performing voxelization on the original geometric model to obtain a voxel model; Calculating the distances between each first voxel in the voxel model and a preset reference geometry; Based on each of the distances and each preset material type, determining the material type of each of the first voxels respectively to obtain a target model that meets the requirements of the preset indicators.
2. The method according to claim 1, characterized in that The step of performing voxelization on the original geometric model to obtain a voxel model includes: Converting the original geometric model into a boundary representation model and determining the hexahedron bounding box of the boundary representation model, wherein the boundary representation model is located inside the hexahedron bounding box; Dividing the hexahedron bounding box into a plurality of second voxels according to a preset segmentation rule; Determining a voxel model based on each of the second voxels.
3. The method according to claim 2, wherein The step of determining a voxel model based on each of the second voxels includes: For any target voxel among each of the second voxels, determining the central point position of the target voxel; Judging whether the central point position is inside the original geometric model; In the case where the central point position is inside the original geometric model, taking the target voxel as a first voxel.
4. The method according to claim 1, characterized in that, Before the step of calculating the distances between each first voxel in the voxel model and a preset reference geometry, the method further includes: Scaling and translating the original geometric model based on the model parameters of the original geometric model to obtain the reference geometry.
5. The method according to claim 1, characterized in that, The preset indicator includes Shore hardness. The step of determining the material type of each of the first voxels respectively based on each of the distances and each preset material type to obtain a target model that meets the requirements of the preset indicators includes: Arranging each of the distances according to a preset rule to obtain a distance list; Determining the distance sub - lists corresponding to each preset material type based on the Shore hardness, wherein the distance sub - lists are obtained by splitting the distance list; For any target sub - list among each of the distance sub - lists, assigning the voxels corresponding to the target sub - list to the preset material type corresponding to the target sub - list to obtain a target model that meets the Shore hardness requirement.
6. The method according to claim 5, characterized in that The step of determining the distance sub - lists corresponding to each preset material type based on the Shore hardness includes: Determining the arrangement order of each preset material type based on the Shore hardness, and the number of voxels in the voxel model that are respectively assigned to each of the preset material types; Based on each of the quantities sorted according to the arrangement order, splitting the distance list into a plurality of distance sub - lists; For any target material among each of the preset material types, determining the distance sub - list arranged in the target order in the plurality of distance sub - lists as the distance sub - list corresponding to the target material, wherein the target order is the arrangement order of the target material among each of the preset material types.
7. The method according to any one of claims 1 to 6, characterized in that After the step of determining the material type of each of the first voxels respectively based on each of the distances and each preset material type to obtain a target model that meets the requirements of the preset indicators, the method further includes: Merging the voxel faces on the surface of the target model that are in the same plane and can be directly or indirectly connected into independent faces; Merge each of the independent faces into a surface shell model, and perform a coplanar merging process on the surface shell model to obtain a simplified model; Convert the simplified model into a mesh model for printing.
8. A material modeling device, characterized in that, The material modeling device includes: A voxelization module for voxelizing an original geometric model to obtain a voxel model; A distance field module for calculating the distance between each first voxel in the voxel model and a preset reference geometry; A material allocation module for determining the material type of each of the first voxels based on each of the distances and each preset material type to obtain a target model that meets the requirements of preset indicators.
9. A material modeling device, characterized in that, The material modeling device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the material modeling method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the steps of the material modeling method according to any one of claims 1 to 7.