Modeling method, system and equipment and storage medium
By converting the attribute values of geometric elements in multi-scale hybrid modeling, they fall into the calculation work interval, the calculation error problems caused by components of different scales are solved, and a more accurate model construction is achieved.
Patent Information
- Application Number
- CN202311735375.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2025-06-17
AI Technical Summary
In multi-scale hybrid modeling, due to the large scale difference between different components, the calculation error of the calculation engine is large, and the resulting model is not accurate enough.
By obtaining the geometric elements of the modeling engine to be input, performing attribute value conversion operations, converting the attribute values of the geometric element to the calculation work interval, and inputting the geometric elements after the attribute value conversion into the modeling engine for modeling.
By controlling the range of attribute values, the calculation error is reduced, and the model built is more accurate.
Smart Images

Figure CN120162850A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer-aided design technology, and particularly relates to a modeling method, system, device, and storage medium. Background Art
[0002] Multi-scale hybrid modeling refers to the process of using the same geometric calculation engine to perform modeling calculations on components of multiple scales to obtain a model. For example, assume that the model to be constructed is a pier model. The pier model may include the main body component of the pier and bolt components, and the scale of the main body component is in meters, and the scale of the bolt component is in millimeters. The process of using the same geometric calculation engine to perform modeling calculations on the main body component and the bolt component and obtaining the pier model is multi-scale hybrid modeling.
[0003] Currently, in some technologies, the scales of different components vary greatly, resulting in large calculation errors in the calculation engine and inaccurate models created.
[0004] Therefore, there is an urgent need for a modeling method that can reduce calculation errors. Summary of the Invention
[0005] In view of this, embodiments of the present disclosure provide a modeling method, modeling system, electronic device, and computer-readable storage medium, which can reduce calculation errors during modeling and make the constructed model more accurate.
[0006] On the one hand, the present disclosure provides a modeling method, the method includes:
[0007] Obtain geometric elements for constructing a model to be input into a modeling engine, where the geometric elements have attribute values;
[0008] Execute an attribute value conversion operation to convert the attribute values of the geometric elements into a calculation working range, where the calculation working range represents the range of attribute values of geometric elements input into the modeling engine;
[0009] Input the geometric elements after the attribute value conversion into the modeling engine, and the modeling engine constructs an initial model based on the geometric elements;
[0010] Execute the inverse operation of the attribute value conversion operation to perform inverse conversion on the attribute values of the initial model, and use the initial model after the attribute value inverse conversion as the target model created.
[0011] In the technical solutions of some embodiments of the present application, after obtaining the geometric elements for constructing the model, by performing an attribute value conversion operation, the attribute values of the geometric elements are converted to the calculation working range, and then the geometric elements after the attribute value conversion are input into the modeling engine for model construction. In this way, through the calculation working range, the range of attribute values input into the modeling engine can be controlled, preventing the problem of large calculation errors caused by the attribute values of geometric elements deviating too far from the standard working range of the modeling engine, achieving the purpose of reducing calculation errors and making the constructed model more accurate.
[0012] In some embodiments, before performing the attribute value conversion operation, the calculation working range is determined by the following method:
[0013] Among all the geometric elements to be input into the modeling engine, the calculation working range is determined based on the side lengths of each geometric element.
[0014] In this way, the calculation working range can be dynamically generated based on the side lengths of geometric elements. While reducing the calculation errors of the modeling engine, the probability of attribute value conversion failure can be further reduced.
[0015] In some embodiments, the geometric elements are represented by bounding boxes;
[0016] The determining the calculation working range based on the side lengths of each geometric element includes:
[0017] Generating the bounding boxes of each geometric element respectively;
[0018] Finding the smallest bounding box among the generated bounding boxes, and taking the side length of the smallest bounding box as the interval minimum value;
[0019] Merging the bounding boxes of each geometric element in different merging ways to obtain multiple different merged bounding boxes, and taking the smallest merged bounding box as the geometric calculation bounding box;
[0020] Based on the interval minimum value and the side length of the geometric calculation bounding box, determining the calculation working range.
[0021] In this way, on the one hand, the bounding box structure is relatively simple, and by determining the calculation working range through the side lengths of the bounding boxes, the calculation amount can be reduced; on the other hand, the attribute values of all geometric elements can be converted into one of the values in the calculation working range, avoiding the problem that the attribute values of geometric elements cannot fall into the calculation working range after conversion, and reducing the probability of attribute value conversion failure.
[0022] In some embodiments, the modeling engine has a calculation standard interval, which represents the range of attribute values supported by the modeling engine when the accuracy of the calculation result of the modeling engine is not lower than the accuracy threshold.
[0023] Determining the calculation working interval based on the minimum value of the interval and the side length of the geometric calculation bounding box includes:
[0024] If the minimum value of the interval is greater than or equal to the minimum attribute value of the calculation standard interval, and the side length of the geometric calculation bounding box is less than or equal to the maximum attribute value of the calculation standard interval, then use the calculation standard interval as the calculation working interval.
[0025] In this way, on the one hand, the calculation working interval does not exceed the calculation standard interval, and the modeling accuracy of the modeling engine will not be affected; on the other hand, the range of attribute values represented by the calculation working interval can be expanded, and the problem of attribute value conversion failure can be reduced.
[0026] In some embodiments, the modeling engine has a calculation standard interval, which represents the range of attribute values supported by the modeling engine when the accuracy of the calculation result of the modeling engine is not lower than the accuracy threshold.
[0027] Determining the calculation working interval based on the minimum value of the interval and the side length of the geometric calculation bounding box includes:
[0028] If the minimum value of the interval is less than the minimum attribute value of the calculation standard interval, then expand the geometric calculation bounding box so that the minimum value of the interval is greater than or equal to the minimum attribute value of the calculation standard interval.
[0029] Determine the calculation working interval based on the side length of the expanded geometric calculation bounding box.
[0030] In this way, it can be ensured that the minimum value of the interval is within the calculation standard interval, reducing the calculation error of the modeling engine and improving the modeling accuracy.
[0031] In some embodiments, determining the calculation working interval based on the side length of the expanded geometric calculation bounding box includes:
[0032] If the side length of the expanded geometric calculation bounding box is less than or equal to the maximum attribute value of the calculation standard interval, then use the calculation standard interval as the calculation working interval. In this way, the range of attribute values represented by the calculation working interval can be expanded, and the problem of attribute value conversion failure can be reduced.
[0033] If the side length of the expanded geometric calculation bounding box is greater than the maximum attribute value of the calculation standard interval, the side length of the expanded geometric calculation bounding box is used as the maximum attribute value of the calculation working interval, and the minimum attribute value of the calculation standard interval is used as the minimum attribute value of the calculation working interval. In this way, it can be ensured that each attribute value of each geometric element can be successfully converted into the calculation working interval, reducing the problem of attribute value conversion failure.
[0034] In some embodiments, each of the geometric elements has a transformation matrix for transforming an attribute value into the calculation working interval;
[0035] For a first geometric element and a second geometric element having a relative position relationship, performing the attribute value conversion operation to convert the attribute value of the geometric element into the calculation working interval includes:
[0036] Converting the attribute value of the first geometric element into the calculation working interval according to the first transformation matrix possessed by the first geometric element;
[0037] Determining a third transformation matrix according to the first transformation matrix and the second transformation matrix possessed by the second geometric element;
[0038] Converting the attribute value of the second geometric element into the calculation working interval according to the third transformation matrix.
[0039] In this way, while converting the attribute values of the first geometric element and the second geometric element into the calculation working interval, the relative position relationship between the first geometric element and the second geometric element can be kept unchanged.
[0040] On the other hand, the present disclosure also provides a modeling system, the system includes:
[0041] A geometric element acquisition module, configured to acquire geometric elements for model construction to be input into a modeling engine, where the geometric elements have attribute values;
[0042] An attribute value conversion module, configured to perform an attribute value conversion operation to convert the attribute value of the geometric element into a calculation working interval, where the calculation working interval represents the range of attribute values of the geometric elements input into the modeling engine;
[0043] A model construction module, configured to input the geometric elements after the attribute value conversion into the modeling engine, and the modeling engine constructs an initial model based on the geometric elements;
[0044] An attribute value inverse conversion module, configured to perform an inverse operation of the attribute value conversion operation, perform an inverse conversion on the attribute value of the initial model, and use the initial model after the attribute value inverse conversion as the created target model.
[0045] On the other hand, the present disclosure also provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the method described above.
[0046] On the other hand, the present disclosure also provides an electronic device, which includes a processor and a memory. The memory is used to store a computer program, which, when executed by the processor, implements the method described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings. The drawings are schematic and should not be construed as imposing any limitation on the present disclosure. In the drawings:
[0048] Figure 1 An interaction schematic diagram of building a model in some technologies is shown;
[0049] Figure 2 A flowchart of a modeling method provided by an embodiment of the present application is shown;
[0050] Figure 3 For Figure 2 An interaction schematic diagram when building a model based on the modeling method in
[0051] Figure 4 A module schematic diagram of a modeling system provided by an embodiment of the present application is shown;
[0052] Figure 5 A schematic diagram of an electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0054] Before elaborating on the solution of the present application, the related concepts and principles of multi-scale hybrid modeling will be described first.
[0055] Geometric elements refer to the smallest building units used to construct a model. For example, for a pier model, it can be composed of a pier body component representing the pier body and a bolt component representing the bolt. Then, the pier body component can be regarded as one of the geometric elements for constructing the pier model, and the bolt component can be regarded as another geometric element for constructing the pier model. Geometric elements can have attribute values. Attribute values include, but are not limited to, the length, width, height, coordinates, etc. of the geometric elements.
[0056] Multi-scale geometric elements refer to geometric elements of multiple different scale units used to construct a model. For example, continuing with the pier model as an example. The pier body component can use meters as the scale unit, and the bolt component can use millimeters as the scale unit. The different scale units of these two geometric elements constitute multi-scale geometric elements.
[0057] The modeling engine is mainly used to perform modeling calculations based on the attribute values of geometric elements and generate a target model. Specifically, the modeling engine can include multiple modeling formulas. After receiving geometric elements, based on the attribute values of the geometric elements, the modeling engine can run different modeling formulas for modeling calculations to construct different target models. For example, based on the coordinates, length, width, and height of geometric elements A and B, performing a Boolean operation on geometric elements A and B can obtain the overlapping part of geometric elements A and B. This overlapping part can be the constructed target model.
[0058] The modeling engine usually has a calculation standard interval. The calculation standard interval represents the range of attribute values supported by the modeling engine when the accuracy of the calculation result of the modeling engine is not lower than the accuracy threshold, such as 0.001 to 1000. The calculation standard interval can only represent a numerical range interval, and its scale unit can be determined based on the actual modeling calculation process. Moreover, in a specific modeling calculation process, the scale unit of the calculation standard interval should be fixed. For example, when constructing the first target model based on geometric elements A and B, its calculation standard interval can represent the range of attribute values from 0.001 meters to 1000 meters, while when constructing the second target model based on geometric elements A, B, and C, its calculation standard interval represents the range of attribute values from 0.001 centimeters to 1000 centimeters.
[0059] When performing modeling calculations, when the numerical values in the calculation process are within the calculation standard interval, the modeling engine can have a relatively small calculation error, and thus the constructed model can have a relatively high accuracy. On the contrary, if part or all of the numerical values in the modeling calculation process are outside the calculation standard interval, the calculation error of the modeling engine will increase accordingly, and the accuracy of the constructed model will also be relatively low.
[0060] Refer to Figure 1 for the interactive schematic diagram of model construction in some technologies. Figure 1In this case, the multi-scale geometric elements used to build the model are directly input into the modeling engine, and the modeling engine builds the model based on the received multi-scale geometric elements. The problem with this is that if the scales of different geometric elements vary too much, it may cause the numerical values in the modeling calculation process to exceed the calculation standard range of the modeling engine, resulting in a low calculation accuracy of the modeling engine and a low accuracy of the built model. For example, assume that the calculation standard range of the modeling engine is 0.001 to 1000. The scale unit of a geometric element A is kilometers, and the scale unit of another geometric element B is millimeters. When performing the modeling calculation, after unifying the units of these two geometric elements, the length of geometric element A may be expressed as 50 kilometers, while the length of geometric element B is expressed as 0.000005 kilometers. Obviously, the length of geometric element B is not within the calculation standard range of the modeling engine. In this way, it will cause a large calculation error when the modeling engine performs the modeling calculation, and the built model is not accurate enough. Another example is that assume the coordinates of geometric element A are (1500, 3000), and this coordinate value is not within the calculation standard range of the modeling engine, which will also cause a large calculation error when the modeling engine performs the modeling calculation, and the built model is not accurate enough.
[0061] In view of this, the present application provides a modeling method that can reduce the calculation error during modeling and make the built model more accurate. The modeling method can be applied to electronic devices. Electronic devices include but are not limited to tablet computers, laptop computers, desktop computers, etc. Referring in combination Figure 2 and Figure 3 . Figure 2 It is a schematic flowchart of the modeling method provided by an embodiment of the present application. Figure 3 Based on Figure 2 It is an interaction schematic diagram when building a model according to the modeling method in Figure 2 In
[0062] Step S21, obtain the geometric elements used to build the model to be input into the modeling engine, and the geometric elements have attribute values.
[0063] In this embodiment, when building the model, the electronic device that executes the model building can display a model building page. The model building page can include multiple geometric elements. In response to the selection operation of the modeling personnel for the geometric elements, the selected geometric elements in the model page can be used as the geometric elements used to build the model to be input into the modeling engine.
[0064] The selected geometric elements can have default attribute values such as length, width, and height, and each geometric element can have its corresponding default scale unit. For example, the scale unit of geometric element A can be kilometers, and its length can be 3, that is, the length of geometric element A is 3 kilometers; while the scale unit of geometric element B can be millimeters, and its diameter can be 2, that is, the diameter of geometric element B is 2 millimeters.
[0065] In addition to the default attribute values and default scale units of the geometric element model, the electronic device performing the model construction can also display an attribute setting page. In the attribute setting page, the default attribute values, default scale units, etc. of the selected geometric elements can be modified. For example, the default scale unit of geometric element A is kilometers, and its default length is 3. In the attribute setting page, the default scale unit of geometric element A can be modified to meters, and its default length can be modified to 2000.
[0066] In addition, in the attribute setting page, new non-default attribute values can also be set for the selected geometric elements. For example, among the default attribute values of geometric element A, there is no attribute value for coordinates. Through the attribute setting page, coordinates can be set for geometric element A to specify its position in the model.
[0067] Step S22, perform an attribute value conversion operation to convert the attribute values of the geometric elements to the calculation working range, where the calculation working range represents the range of attribute values of the geometric elements input into the modeling engine.
[0068] Similar to the calculation standard range, the range of attribute values represented by the calculation working range can also only represent a numerical range interval, and, in a specific modeling calculation process, the scale unit of the calculation working range should be fixed.
[0069] Specifically, the calculation working range can be greater than or equal to the calculation standard range of the modeling engine, but less than the current actual range of attribute values of the geometric elements. Among them, the current actual range of attribute values of the geometric elements refers to the span of the default attribute values of all geometric elements participating in the model construction and the attribute values set in the attribute setting page. For example, assume that the geometric elements participating in the model construction are geometric element A and geometric element B. The length of geometric element A is the default length of 0.0001 meters, and the length of geometric element B is the length of 30000 meters set in the attribute setting page. Then the current actual range of attribute values of the geometric elements is 0.001 - 30000 meters. Here, assume again that the calculation standard range of the modeling engine is 1 - 1000. Then, the calculation working range can be 1 - 1000 meters, that is, equal to the calculation standard range; or it can also be 0.1 - 2000 meters, that is, greater than the calculation standard range, but less than the current actual range of attribute values of the geometric elements.
[0070] Attribute value conversion refers to converting the current actual attribute value of a geometric element to the range of attribute values represented in the computational working space. The attribute value conversion operation can specifically include translation and scaling. For example, assume that the computational working space is from 0 to 10, and the current actual length of the geometric element in the X-axis direction is 1000 meters. That is, the 1000 meters need to be compressed by at least 100 times, and the compressed geometric element is translated to the range of 0 to 10 in the X-axis direction.
[0071] Furthermore, when determining the computational working space, it is necessary to ensure that the current actual attribute values of the geometric elements can all be converted into the computational working space under the condition that the relative positional relationship, relative size, etc. between the geometric elements remain unchanged. For example, assume that the geometric elements participating in the model construction are geometric element A and geometric element B. In the X-axis direction, the actual distance between geometric element A and geometric element B is 10 meters, the actual width of geometric element A in the X-axis direction is 200 meters, and the actual width of geometric element B in the X-axis direction is 1000 meters. When the actual widths and the actual distance between geometric element A and B in the X-axis direction are compressed by 100 times, the actual width of geometric element A in the X-axis direction is compressed to 2 meters, the actual width of geometric element B in the X-axis direction is compressed to 10 meters, and the actual distance between geometric element A and B in the X-axis direction is compressed to 0.1 meters. Then the computational working space can be from 0 to 10, so as to ensure that the current actual attribute values of the geometric elements can all be converted into the computational working space under the condition that the relative positional relationship, relative size, etc. between the geometric elements remain unchanged. In the subsequent embodiments of this application, some better methods for determining the computational working space are provided, which will not be elaborated here.
[0072] Step S23: Input the geometric element after completing the attribute value conversion into the modeling engine, and the modeling engine constructs an initial model based on the geometric element.
[0073] Regarding the principle of the modeling engine creating the initial model, reference can be made to the relevant description of the modeling engine above, which will not be elaborated here. Similar to the geometric element, the constructed initial model can also have attribute values such as coordinates, length, width, and height. It can be understood that since the initial model is constructed by the modeling engine based on the geometric element after completing the attribute value conversion, the attribute value of the initial model should not be the actual attribute value either. For example, assume that in step S22, geometric elements A and B are compressed by 100 times. The initial model constructed based on the compressed geometric elements A and B is also compressed by 100 times relative to the target model that should be constructed actually. In view of this, step S24 can be continued to convert the attribute value of the initial model into the actual attribute value that should be.
[0074] Step S24: Perform the inverse operation of the attribute value conversion operation to inversely convert the attribute values of the initial model, and use the initial model after the inverse conversion of the attribute values as the target model created.
[0075] The so-called inverse operation is an operation opposite to the attribute value conversion operation. For example, if the geometric elements were compressed by 100 times in step S22, then in step S24, the attribute values of the initial model can be enlarged by 100 times. Another example, if the geometric elements were translated 100 units to the right in step S22, then in step S24, the initial model can be translated 100 units to the left. In this way, the initial model can be converted into the target model that should actually be constructed.
[0076] Through Figure 1 and Figure 3 comparison, it can be seen that compared with the modeling methods in some technologies, the modeling method of this application introduces a calculation working range. After obtaining the geometric elements, instead of directly inputting the geometric elements into the modeling engine, the attribute values of the geometric elements are first converted to the calculation working range, and then the geometric elements after the attribute value conversion are input into the modeling engine for model construction by the modeling engine. The advantage of this implementation is that through the attribute value conversion, the range of the attribute values input into the modeling engine can be controlled, preventing the problem of large calculation errors caused by the attribute values of the geometric elements deviating too far from the standard working range of the modeling engine. Of course, when the calculation working range is larger than the standard working range of the modeling engine, the attribute values of the geometric elements input into the modeling engine may also deviate from the standard working range of the modeling engine. However, compared with directly inputting the geometric elements without attribute value conversion into the modeling engine, this application can reduce the deviation distance between the attribute values and the standard working range, thereby correspondingly reducing the calculation error of the modeling engine and making the constructed model more accurate.
[0077] In summary, in the technical solutions of some embodiments of this application, after obtaining the geometric elements for model construction, by performing the attribute value conversion operation, the attribute values of the geometric elements are converted to the calculation working range, and then the geometric elements after the attribute value conversion are input into the modeling engine for model construction. In this way, through the calculation working range, the range of the attribute values input into the modeling engine can be controlled, preventing the problem of large calculation errors caused by the attribute values of the geometric elements deviating too far from the standard working range of the modeling engine, achieving the purpose of reducing the calculation error and making the constructed model more accurate.
[0078] The following describes the method for determining the calculation working range in some embodiments.
[0079] In some embodiments, a configuration interface for calculating a working range may be provided. A modeler may pre-configure the range of the calculation working range in the configuration interface. When performing the attribute value conversion operation in step S22, the attribute values of geometric elements may be converted based on the calculation working range configured in the configuration interface. This way of pre-configuring the calculation working range is relatively simple to implement. However, since the attribute values of geometric elements change dynamically, the pre-defined calculation working range cannot match model construction in all scenarios. For example, when constructing model A, the attribute values of geometric elements are between 1 and 10 meters, while when constructing model B, the attribute values of geometric elements are between 1 and 1000 meters. If the calculation working range is set to 1 to 10, then when constructing model B, some attribute values of geometric elements may fall outside the calculation working range, resulting in the problem of failed attribute value conversion.
[0080] In view of this, some embodiments of the present application also provide another method for determining the calculation working range. Specifically, in these embodiments, before performing the attribute value conversion operation in step S22, the calculation working range may be determined by the following method:
[0081] Among all geometric elements to be input into the modeling engine, determine the calculation working range based on the side lengths of each geometric element.
[0082] Briefly speaking, that is, when constructing a model each time, a calculation working range is dynamically generated based on the side lengths of the geometric elements to be input into the modeling engine. In this way, while reducing the calculation error of the modeling engine, the probability of failed attribute value conversion can be further reduced. For example, when the side length of a geometric element is large, the range of attribute values represented by the calculation working range can be correspondingly large, so as to ensure that all attribute values can be successfully converted into the calculation working range; while when the side length of a geometric element is small, the range of attribute values represented by the calculation working range can be correspondingly small, so as to ensure that the attribute values can fall into the standard working range of the modeling engine as much as possible, reduce the calculation error, and make the constructed model more accurate.
[0083] Further, in some embodiments, geometric elements may be represented by bounding boxes. A bounding box can be the smallest cube that encloses a geometric element. The edges of the bounding box can be parallel to the coordinate axes in model construction. Based on this, the above determination of the calculation working range based on the side lengths of each geometric element may include:
[0084] Generate bounding boxes for each geometric element respectively;
[0085] Find the smallest bounding box among the generated bounding boxes, and use the side length of the smallest bounding box as the minimum value of the range;
[0086] Merge the bounding boxes of each geometric element according to different merging methods to obtain multiple different merged bounding boxes, and use the smallest merged bounding box as the geometric calculation bounding box;
[0087] Based on the minimum value of the interval and the side length of the geometric calculation bounding box, determine the calculation working interval.
[0088] Specifically, merging the bounding boxes of each geometric element according to different merging methods means obtaining a combined bounding box by stacking these bounding boxes. This combined bounding box can be regarded as the minimum bounding box of all geometric elements participating in the model construction. All geometric elements participating in the model construction can be accommodated within this minimum bounding box.
[0089] In summary, when determining the calculation working interval based on the minimum value of the interval and the side length of the geometric calculation bounding box, the minimum value of the interval can be used as the minimum value of the calculation working interval, and the side length of the geometric calculation bounding box can be used as the maximum value of the calculation working interval. That is, the range of attribute values represented by the calculation working interval is: minimum value of the interval ~ side length of the geometric calculation bounding box.
[0090] In this way, on the one hand, the bounding box structure is relatively simple, and determining the calculation working interval by the side length of the bounding box can reduce the amount of calculation; on the other hand, the attribute values of all geometric elements can be converted into one of the values in the calculation working interval, avoiding the problem that the attribute values of geometric elements cannot fall into the calculation working interval after conversion and reducing the probability of attribute value conversion failure.
[0091] Furthermore, the above determination of the calculation working interval based on the minimum value of the interval and the side length of the geometric calculation bounding box may include:
[0092] If the minimum value of the interval is greater than or equal to the minimum attribute value of the calculation standard interval, and the side length of the geometric calculation bounding box is less than or equal to the maximum attribute value of the calculation standard interval, use the calculation standard interval as the calculation working interval.
[0093] Specifically, in this embodiment, it is equivalent to that the calculation working interval determined based on the minimum value of the interval and the side length of the geometric calculation bounding box is within the calculation standard interval of the modeling engine. In this case, using the calculation standard interval as the calculation working interval, on the one hand, the calculation working interval does not exceed the calculation standard interval, and the modeling accuracy of the modeling engine will not be affected; on the other hand, the range of attribute values represented by the calculation working interval can be expanded, reducing the problem of attribute value conversion failure.
[0094] Furthermore, in some embodiments, the determination of the calculation working interval based on the minimum value of the interval and the side length of the geometric calculation bounding box may further include:
[0095] If the minimum value of the interval is less than the minimum attribute value of the calculation standard interval, expand the geometric calculation bounding box so that the minimum value of the interval is greater than or equal to the minimum attribute value of the calculation standard interval;
[0096] Determine the calculation working interval based on the side length of the expanded geometric calculation bounding box.
[0097] Specifically, in this embodiment, since the minimum value of the interval is less than the minimum attribute value of the calculation standard interval, therefore, the calculation working interval determined based on the minimum value of the interval and the side length of the geometric calculation bounding box is partially outside the calculation standard interval of the modeling engine. In this case, if the attribute values of the geometric elements are converted to the calculation working interval, some attribute values may be outside the calculation standard interval, which may lead to calculation errors in the modeling engine. In view of this, the geometric calculation bounding box can be expanded so that the minimum value of the interval is greater than or equal to the minimum attribute value of the calculation standard interval. In this way, it can be ensured that the minimum value of the interval is within the calculation standard interval, reducing the calculation errors of the modeling engine and improving the modeling accuracy.
[0098] Specifically, in some embodiments, the above determining the calculation working interval based on the side length of the expanded geometric calculation bounding box includes:
[0099] If the side length of the expanded geometric calculation bounding box is less than or equal to the maximum attribute value of the calculation standard interval, take the calculation standard interval as the calculation working interval. In this way, the range of attribute values represented by the calculation working interval can be expanded, reducing the problem of failed conversion of attribute values.
[0100] If the side length of the expanded geometric calculation bounding box is greater than the maximum attribute value of the calculation standard interval, take the side length of the expanded geometric calculation bounding box as the maximum attribute value of the calculation working interval, and take the minimum attribute value of the calculation standard interval as the minimum attribute value of the calculation working interval. In this way, it can be ensured that each attribute value of each geometric element can be successfully converted to the calculation working interval, reducing the problem of failed conversion of attribute values.
[0101] Furthermore, in some embodiments, each geometric element has a transformation matrix for converting the attribute value to the calculation working interval. The transformation matrix is used to represent the translation amount and scaling amount required when the attribute value of the geometric element is converted to the calculation working interval. Here, since the element matrix of each geometric element can only ensure that the attribute value of the corresponding geometric element is converted to the calculation working interval, it cannot ensure the relative position relationship, relative size, etc. between geometric elements. In view of this, this embodiment proposes a transformation method that can maintain the relative position relationship between geometric elements while converting the attribute values of geometric elements to the calculation working interval.
[0102] Specifically, for a first geometric element and a second geometric element having a relative positional relationship, the above-mentioned execution of the attribute value conversion operation to convert the attribute value of the geometric element to the calculation working range may include:
[0103] Converting the attribute value of the first geometric element to the calculation working range according to the first conversion matrix possessed by the first geometric element;
[0104] Determining a third conversion matrix according to the first conversion matrix and the second conversion matrix possessed by the second geometric element;
[0105] Converting the attribute value of the second geometric element to the calculation working range according to the third conversion matrix.
[0106] Specifically, the third conversion matrix may be the product of the second conversion matrix, the inverse matrix of the first conversion matrix, and the first conversion matrix. The process of converting the attribute value of the second geometric element to the calculation working range according to the third conversion matrix can be understood as follows: first, converting the attribute value of the second geometric element to the calculation working range according to the second conversion matrix, and then converting the attribute value of the second geometric element that has been converted to the calculation working range out of the calculation working range according to the inverse matrix of the first conversion matrix, so that the attribute value of the second geometric element and the attribute value of the first geometric element are in the same coordinate system. Furthermore, converting the attribute value of the second geometric element to the calculation working range according to the first conversion matrix can, while converting the attribute values of both the first geometric element and the second geometric element to the calculation working range, keep the relative positional relationship between the first geometric element and the second geometric element unchanged.
[0107] So far, the related description of the modeling method of this application has been completed.
[0108] Corresponding to the modeling method, this application also provides a modeling system. Please refer to Figure 4 , which is a schematic diagram of the modules of the modeling system provided by an embodiment of this application. Figure 4 In, the modeling system includes:
[0109] A geometric element acquisition module, configured to acquire geometric elements for model construction to be input into the modeling engine, and the geometric elements have attribute values;
[0110] An attribute value conversion module, configured to execute an attribute value conversion operation to convert the attribute value of the geometric element to the calculation working range, where the calculation working range represents the range of the attribute value of the geometric element input into the modeling engine;
[0111] A model construction module, configured to input the geometric element after the attribute value conversion into the modeling engine, and the modeling engine constructs an initial model based on the geometric element;
[0112] The attribute value inverse conversion module is used to perform the inverse operation of the attribute value conversion operation, perform inverse conversion on the attribute values of the initial model, and use the initial model after the inverse conversion of the attribute values as the target model created.
[0113] Please refer to Figure 5 , which is a schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device includes a processor and a memory. The memory is used to store a computer program. When the computer program is executed by the processor, the above method is implemented.
[0114] Among them, the processor can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or a combination of the above types of chips.
[0115] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the method in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions, and modules stored in the memory, that is, the method in the above method embodiment is implemented.
[0116] The memory can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created by the processor, etc. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0117] An embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium is used to store a computer program. When the computer program is executed by a processor, the above method is implemented.
[0118] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A modeling method, characterized in that, The method includes: Obtaining geometric elements for building a model to be input into a modeling engine, where the geometric elements have attribute values; Performing an attribute value conversion operation to convert the attribute values of the geometric elements into a calculation working range, where the calculation working range represents the range of attribute values of the geometric elements input into the modeling engine; Inputting the geometric elements after the attribute value conversion into the modeling engine, and the modeling engine constructs an initial model based on the geometric elements; Performing the inverse operation of the attribute value conversion operation to inversely convert the attribute values of the initial model, and using the initial model after the inverse conversion of the attribute values as the target model created.
2. The method according to claim 1, characterized in that, Before performing the attribute value conversion operation, the calculation working range is determined by the following method: Among all the geometric elements to be input into the modeling engine, the calculation working range is determined based on the side lengths of each geometric element.
3. The method according to claim 2, characterized in that, The geometric elements are represented by bounding boxes; The determining the calculation working range based on the side lengths of each geometric element includes: Generating bounding boxes for each of the geometric elements respectively; Searching for the smallest bounding box among the generated bounding boxes, and using the side length of the smallest bounding box as the minimum value of the range; Merging the bounding boxes of each geometric element in different merging ways to obtain multiple different merged bounding boxes, and using the smallest merged bounding box as the geometric calculation bounding box; Determining the calculation working range based on the minimum value of the range and the side length of the geometric calculation bounding box.
4. The method according to claim 3, characterized in that, The modeling engine has a calculation standard range, and the calculation standard range represents the range of attribute values supported by the modeling engine when the accuracy of the calculation result of the modeling engine is not lower than an accuracy threshold; The determining the calculation working range based on the minimum value of the range and the side length of the geometric calculation bounding box includes: If the minimum value of the range is greater than or equal to the minimum attribute value of the calculation standard range, and the side length of the geometric calculation bounding box is less than or equal to the maximum attribute value of the calculation standard range, using the calculation standard range as the calculation working range.
5. The method according to claim 3, characterized in that, The modeling engine has a calculation standard range, and the calculation standard range represents the range of attribute values supported by the modeling engine when the accuracy of the calculation result of the modeling engine is not lower than an accuracy threshold; The determining the calculation working range based on the minimum value of the range and the side length of the geometric calculation bounding box includes: If the minimum value of the range is less than the minimum attribute value of the calculation standard range, expanding the geometric calculation bounding box so that the minimum value of the range is greater than or equal to the minimum attribute value of the calculation standard range; Determining the calculation working range based on the side length of the expanded geometric calculation bounding box.
6. The method according to claim 5, characterized in that, The determining the calculation working range based on the side length of the expanded geometric calculation bounding box includes: If the side length of the expanded geometric calculation bounding box is less than or equal to the maximum attribute value of the calculation standard range, using the calculation standard range as the calculation working range; If the side length of the expanded geometric calculation bounding box is greater than the maximum attribute value of the calculation standard interval, the side length of the expanded geometric calculation bounding box is used as the maximum attribute value of the calculation working interval, and the minimum attribute value of the calculation standard interval is used as the minimum attribute value of the calculation working interval.
7. The method according to claim 1, characterized in that, Each of the geometric elements has a transformation matrix for transforming the attribute value to the calculation working interval; For the first geometric element and the second geometric element with a relative position relationship, performing the attribute value transformation operation to transform the attribute value of the geometric element to the calculation working interval includes: Transforming the attribute value of the first geometric element to the calculation working interval according to the first transformation matrix possessed by the first geometric element; Determining a third transformation matrix according to the first transformation matrix and the second transformation matrix possessed by the second geometric element; Transforming the attribute value of the second geometric element to the calculation working interval according to the third transformation matrix.
8. A modeling system, characterized in that, The system includes: A geometric element acquisition module, configured to acquire geometric elements for model construction to be input into the modeling engine, where the geometric elements have attribute values; An attribute value transformation module, configured to perform an attribute value transformation operation to transform the attribute value of the geometric element to the calculation working interval, where the calculation working interval represents the range of attribute values of the geometric elements input into the modeling engine; A model construction module, configured to input the geometric elements after the attribute value transformation into the modeling engine, and the modeling engine constructs an initial model based on the geometric elements; An attribute value inverse transformation module, configured to perform an inverse operation of the attribute value transformation operation, perform an inverse transformation on the attribute value of the initial model, and use the initial model after the attribute value inverse transformation as the created target model.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that The electronic device includes a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, the method described in any one of claims 1 to 7 is implemented.