Thickening parameter conversion method and device for stretch features in three-dimensional model
By determining the reference vector and verifying the thickening direction parameters in CAD software, the problem of inconsistent thickening directions between different software was solved, and the accuracy of parameter conversion of stretching features and model construction was improved.
Patent Information
- Application Number
- CN202411940479.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-12-26
AI Technical Summary
Different CAD software programs have inconsistent logic in defining the thickening direction of the stretching and thickening feature, which leads to errors in the thickening direction during parametric conversion, reducing the success rate of thickening parameter conversion in the stretching feature and the accuracy of model construction.
By obtaining the original parameters of the stretched model, determining the first and second reference vectors, verifying the thickening direction parameters, ensuring the accuracy of the thickening process, and using the thickness parameters and thickening direction parameters as transformed parameters, cross-platform compatibility can be achieved.
It significantly improves the success rate of thickening parameter conversion in stretching features, ensures the accuracy of model construction, and solves the problem of inconsistent thickening direction processing between different CAD software.
Smart Images

Figure CN119670300B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer-aided design, and in particular to a method and device for converting thickening parameters of a stretch feature in a three-dimensional model. BACKGROUND
[0002] In the field of CAD (Computer-Aided Design), parameterized conversion refers to extracting and storing the modeling history and data of a model in a CAD software into an intermediate format file, and then importing the intermediate format file into another CAD software, so that the software can regenerate the model according to the history parameters. In this process, the stretch thickening of a non-closed sketch is a common geometric feature.
[0003] However, different CAD software does not have consistent definition logic for the thickening direction, resulting in differences in the shapes of the stretch thickening feature generated in different software under the same parameters. For example, a shape with a true thickening direction in one design software (such as SolidWorks) may be false in another design software (such as NX). Because different CAD software processes the thickening direction differently, there is no uniform standard for the thickening direction in the parameterized conversion process, and the parameterized conversion usually follows the default setting. The converted model cannot be corrected even if the thickening direction is incorrect, which reduces the success rate of the thickening parameter conversion in the stretch feature. At the same time, as a basic feature, the error of the thickening parameter in the stretch feature will affect the correct generation of subsequent features, thereby reducing the accuracy of model construction. SUMMARY
[0004] Therefore, it is necessary to provide a method and device for converting thickening parameters of a stretch feature in a three-dimensional model, a computer device, a computer readable storage medium, and a computer program product, which can improve the success rate of the thickening parameter conversion in the stretch feature and the accuracy of model construction.
[0005] In a first aspect, an embodiment of the present application provides a method for converting thickening parameters of a stretch feature in a three-dimensional model. The method comprises:
[0006] obtaining original parameters corresponding to the stretched model; the original parameters are parameters read by the stretched model in any type of three-dimensional model design software, representing the thickening process in the stretch feature, and the original parameters include a thickness parameter;
[0007] determine a first reference vector and a second reference vector based on the geometric parameters of the stretched model; the first reference vector is a vector of a supposed thickening direction in the thickening process, and the second reference vector is a vector associated with an actual thickening direction of the model in the thickening process, and the geometric parameters include a sketch corresponding to the stretching feature and a stretching direction vector;
[0008] verify the first reference vector according to the second reference vector to determine a thickening direction parameter of the thickening process corresponding to the stretched model; the thickening direction parameter is used to represent a directional relationship between the first reference vector and the vector of the actual thickening direction;
[0009] use the thickness parameter and the thickening direction parameter associated with the thickness parameter as converted parameters corresponding to the original parameters, and the converted parameters are used for the any type of three-dimensional model design software.
[0010] In one of the embodiments, the determination of the first reference vector and the second reference vector based on the geometric parameters of the stretched model includes:
[0011] identifying a line type of the sketch in the stretched model and a number of thickening directions corresponding to the thickening process;
[0012] determining the first reference vector and the second reference vector based on the line type of the sketch and the number of thickening directions;
[0013] wherein the line type of the sketch is a line segment type or a curve type, and the number of thickening directions corresponding to the thickening process is 1 or 2.
[0014] In one of the embodiments, the determination of the first reference vector and the second reference vector based on the line type of the sketch and the number of thickening directions includes:
[0015] in a case where the line type of the sketch is the line segment type and the number of thickening directions is 1, determining a first edge of the sketch as a target entity edge, and determining a reference adjacent surface as an adjacent surface parallel to the stretching direction vector in an adjacent surface bounded by the target entity edge;
[0016] taking a vector obtained by cross product of a sketch direction vector corresponding to the target entity edge and the stretching direction vector as the first reference vector;
[0017] taking a normal vector of the reference adjacent surface as the second reference vector.
[0018] In one of the embodiments, the first reference vector and the second reference vector are determined based on the line composition type of the sketch and the number of thickening directions, including:
[0019] In the case that the line composition type of the sketch is the line segment type and the number of thickening directions is 2, each of the first edges of the sketch is offset based on each of the thickness values in the thickness parameter to match the target entity edge corresponding to the thickness value; the thickness values include a first thickness value and a second thickness value.
[0020] A reference adjacent face corresponding to each of the target entity edges is determined; the reference adjacent face is an adjacent face parallel to the stretching direction vector among the adjacent faces with the target entity edge as a boundary;
[0021] A vector obtained by cross product of the sketch direction vector corresponding to the target entity edge and the stretching direction vector is taken as the first reference vector;
[0022] A normal vector of the reference adjacent face corresponding to each of the target entity edges is taken as the second reference vector associated with each of the thickness values in the thickness parameter.
[0023] In one of the embodiments, the first reference vector and the second reference vector are determined based on the line composition type of the sketch and the number of thickening directions, including:
[0024] In the case that the line composition type of the sketch is the curve type and the number of thickening directions is 1, a curve of the sketch is determined as a target entity edge, and an adjacent face parallel to the stretching direction vector among the adjacent faces with the target entity edge as a boundary is determined as a reference adjacent face;
[0025] A tangent vector of the sketch at a starting point is determined as a sketch direction vector, and a vector obtained by cross product of the sketch direction vector and the stretching direction vector is taken as the first reference vector;
[0026] A normal vector of the reference adjacent face at the starting point is taken as the second reference vector.
[0027] In one of the embodiments, the first reference vector and the second reference vector are determined based on the line composition type of the sketch and the number of thickening directions, including:
[0028] In the case that the line composition type of the sketch is the curve type and the number of thickening directions is 2, each of the curves of the sketch is offset based on each of the thickness values in the thickness parameter to match the target entity edge corresponding to the thickness value; the thickness values include a first thickness value and a second thickness value.
[0029] determining a reference face corresponding to each of the target entity edges; the reference face is a face parallel to the stretching direction vector among faces with the target entity edge as a boundary;
[0030] determining a tangent vector of the sketch at the starting point as a sketch direction vector, and taking a vector obtained by performing a cross product operation on the sketch direction vector and the stretching direction vector as the first reference vector;
[0031] taking a normal vector corresponding to the starting point of each of the reference faces corresponding to the target entity edges as the second reference vector associated with each of the thickness values in the thickness parameter.
[0032] In a second aspect, the present application further provides a device for converting a thickening parameter of a stretched feature in a three-dimensional model. The device comprises:
[0033] an original parameter acquisition module configured to acquire an original parameter corresponding to the stretched model; the original parameter is a parameter read by the stretched model in any type of three-dimensional model design software, and represents a thickening process in the stretched feature, and the original parameter comprises a thickness parameter;
[0034] a reference vector determination module configured to determine a first reference vector and a second reference vector based on a geometric parameter of the stretched model; the first reference vector is a vector of a hypothetical thickening direction in the thickening process, the second reference vector is a vector associated with an actual thickening direction of the model in the thickening process, and the geometric parameter comprises a sketch and a stretching direction vector corresponding to the stretched feature;
[0035] a thickening direction parameter determination module configured to verify the first reference vector according to the second reference vector, so as to determine a thickening direction parameter of the thickening process corresponding to the stretched model; the thickening direction parameter is used to represent a directional relationship between the first reference vector and the vector of the actual thickening direction;
[0036] a converted parameter determination module configured to take the thickness parameter and the thickening direction parameter associated with the thickness parameter as a converted parameter corresponding to the original parameter, and the converted parameter is used for the any type of three-dimensional model design software.
[0037] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0038] obtaining original parameters corresponding to the stretched model; the original parameters are parameters read by the stretched model in any type of three-dimensional model design software, and the original parameters represent a thickening process in a stretching feature, and the original parameters include a thickness parameter;
[0039] determining a first reference vector and a second reference vector based on geometric parameters of the stretched model; the first reference vector is a vector of a thickening direction in the thickening process, and the second reference vector is a vector associated with an actual thickening direction of the model in the thickening process, and the geometric parameters include a sketch corresponding to the stretching feature and a stretching direction vector;
[0040] verifying the first reference vector according to the second reference vector to determine a thickening direction parameter of the thickening process corresponding to the stretched model; the thickening direction parameter is used to represent a directional relationship between the first reference vector and the vector of the actual thickening direction;
[0041] taking the thickness parameter and the thickening direction parameter associated with the thickness parameter as converted parameters corresponding to the original parameters, and the converted parameters are used for the any type of three-dimensional model design software.
[0042] In a fourth aspect, the present application also provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to implement the following steps:
[0043] obtaining original parameters corresponding to the stretched model; the original parameters are parameters read by the stretched model in any type of three-dimensional model design software, and the original parameters represent a thickening process in a stretching feature, and the original parameters include a thickness parameter;
[0044] determining a first reference vector and a second reference vector based on geometric parameters of the stretched model; the first reference vector is a vector of a thickening direction in the thickening process, and the second reference vector is a vector associated with an actual thickening direction of the model in the thickening process, and the geometric parameters include a sketch corresponding to the stretching feature and a stretching direction vector;
[0045] verifying the first reference vector according to the second reference vector to determine a thickening direction parameter of the thickening process corresponding to the stretched model; the thickening direction parameter is used to represent a directional relationship between the first reference vector and the vector of the actual thickening direction;
[0046] taking the thickness parameter and the thickening direction parameter associated with the thickness parameter as converted parameters corresponding to the original parameters, and the converted parameters are used for the any type of three-dimensional model design software.
[0047] In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:
[0048] obtaining original parameters corresponding to the stretched model; the original parameters are parameters read by the stretched model in any type of three-dimensional model design software, representing the thickening process in the stretch feature, and the original parameters include a thickness parameter;
[0049] determining a first reference vector and a second reference vector based on geometric parameters of the stretched model; the first reference vector is a vector of the thickening direction in the assumed thickening process, and the second reference vector is a vector associated with the actual thickening direction of the model in the thickening process, and the geometric parameters include a sketch corresponding to the stretch feature and a stretch direction vector;
[0050] verifying the first reference vector according to the second reference vector to determine a thickening direction parameter of the thickening process corresponding to the stretched model; the thickening direction parameter is used to represent the directional relationship between the first reference vector and the actual thickening direction vector;
[0051] taking the thickness parameter and the thickening direction parameter associated with the thickness parameter as converted parameters corresponding to the original parameters, and the converted parameters are used for the any type of three-dimensional model design software.
[0052] The above-mentioned thickening parameter conversion method, device, computer equipment, storage medium and computer program product of the stretch feature in the three-dimensional model first obtain original parameters corresponding to the stretched model, including a thickness parameter and a reverse parameter representing the thickening process, then determine a first reference vector and a second reference vector based on geometric parameters of the stretched model, and then verify the first reference vector according to the second reference vector to determine a thickening direction parameter, so as to ensure the accuracy of the thickening process; finally, taking the thickness parameter and the thickening direction parameter as converted parameters of the original parameters, to realize the compatible use of the parameters in different three-dimensional model design software; this embodiment accurately judges whether the thickening direction needs to be reversed through the calculation of model data such as sketches and stretch direction vectors, replaces the default logic of the direct reading and use of parameters in the prior art, significantly improves the success rate of the thickening parameter conversion in the stretch feature, thereby improving the conversion success rate of other features relying on the stretch, solves the problem of parameter conversion error caused by inconsistent thickening direction processing between different CAD software, ensures the correctness of the model shape generated after parameterization conversion, and further improves the accuracy of model construction. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the embodiments or the related art description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.
[0054] Figure 1 The flowchart of the thickening parameter conversion method of the stretch feature in the three-dimensional model in one embodiment;
[0055] Figure 2 The flowchart of the thickening parameter conversion method of the stretch feature in the three-dimensional model in another embodiment;
[0056] Figure 3 The first principle diagram of the parameter conversion process in one embodiment;
[0057] Figure 4 The second principle diagram of the parameter conversion process in one embodiment;
[0058] Figure 5 The third principle diagram of the parameter conversion process in one embodiment;
[0059] Figure 6 The fourth principle diagram of the parameter conversion process in one embodiment;
[0060] Figure 7 The fifth principle diagram of the parameter conversion process in one embodiment;
[0061] Figure 8 The sixth principle diagram of the parameter conversion process in one embodiment;
[0062] Figure 9 The seventh principle diagram of the parameter conversion process in one embodiment;
[0063] Figure 10 The structural block diagram of the thickening parameter conversion device of the stretch feature in the three-dimensional model in one embodiment;
[0064] Figure 11 The internal structure diagram of the computer device in one embodiment. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of the present application more clear, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0066] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of countries and regions.
[0067] In one embodiment, as shown in Figure 1 A method for converting thickening parameters of a stretched feature in a three-dimensional model is provided. The method can be applied to a terminal, a server, or a system including a terminal and a server, and can be implemented through the interaction of the terminal and the server. The method includes the following steps:
[0068] S101, obtaining original parameters corresponding to the stretched model.
[0069] The stretched model is a three-dimensional model obtained after performing a stretching feature operation. The original parameters are parameters read by the stretched model in any type of three-dimensional model design software, representing the thickening process in the stretched feature. The original parameters include a thickness parameter, which is a parameter representing the stretched thickness. In addition, the original parameters also include an original reverse parameter flip.
[0070] For example, in a CAD software, the parameters related to thickening in the stretched feature can be d=10cm, flip=false, indicating that the thickening thickness during stretching is 10 cm, and the thickening thickness needs to be reversed. According to the above-mentioned form of the original parameters, without the reference rule of the original parameters, the user cannot accurately describe the thickening process based on the parameter value.
[0071] S102, determining a first reference vector and a second reference vector based on the geometric parameters of the stretched model.
[0072] The geometric parameters include a sketch corresponding to the stretched feature and a stretching direction vector. More specifically, the geometric parameters include related parameters of the sketch corresponding to the stretched feature. In different sketches and different thickening processes, the required related parameters of the sketch will be different.
[0073] The first reference vector is a vector of a thickening direction in a hypothetical thickening process, and is a vector assumed based on geometric parameters. The second reference vector is a vector associated with an actual thickening direction of the model in the thickening process, and is a vector calculated based on the implementation principle of the geometric parameters. Generally, the second reference vector is opposite to the vector direction of the actual thickening direction of the model in the thickening process. In this way, the first reference vector can be verified by using the second reference vector, so as to facilitate the determination of the parameter representing the thickening direction.
[0074] For example, in the case where the line type of the sketch is a line segment type and the number of thickening directions is 1, the first reference vector is a vector obtained by performing a cross product between the sketch direction vector corresponding to the first edge of the sketch and the stretching direction vector. The second reference vector is a normal vector of a reference adjacent surface parallel to the stretching direction vector in the adjacent surface with the first edge of the sketch as a boundary.
[0075] S103, verifying the first reference vector according to the second reference vector to determine the thickening direction parameter of the thickening process corresponding to the stretched model.
[0076] The thickening direction parameter is designed by the embodiments of the present application, and is used to represent the parameter between the first reference vector and the actual thickening direction vector, that is, part of the parameter obtained after parameter conversion. The direction relationship can be the same or opposite. For example, the thickening direction parameter can be represented by flip, and its value can be true or false. True represents the same direction, and naturally, true represents the opposite direction. In addition, other parameters with at least two different values can also be used to achieve this, and the embodiments of the present application do not limit the specific form of the parameter, as long as the relationship between the two different directions can be distinguished.
[0077] Based on the definitions of the first reference vector and the second reference vector in step S102, it can be known that the sketch direction vector is perpendicular to the stretching direction vector, and the cross product vector is perpendicular to the sketch direction vector and the stretching direction vector, respectively. Therefore, the relationship between the direction of the cross product vector and the thickening direction includes two cases of same and opposite. The normal vector of the reference adjacent surface is opposite to the vector direction of the actual thickening direction of the model. In this way, the first reference vector can be verified according to the second reference vector, and the direction relationship between the two directions obtained by the verification is used as the parameter representing the thickening direction. This not only makes the parameter closely related to the actual thickening process, but also avoids the problem of large data amount caused by directly storing the vector. The first reference vector and the second reference vector can be obtained based on the geometric parameters of the stretched model, so that the first reference vector or the second reference vector itself does not need to be recorded. The storage cost of the parameter is reduced while ensuring the effectiveness of the parameter use process, and the convenience of the parameter use process is taken into account.
[0078] S104, taking the thickness parameter and the thickening direction parameter associated with the thickness parameter as converted parameters corresponding to the original parameters.
[0079] The converted parameters can be in the form of d=10cm, flip=true, where the thickness parameter and its value are d=10cm, and the thickening direction parameter and its value are flip=false. It should be noted that the converted parameters can have a similar form to the original parameters, but the thickening direction parameter (flip) is obtained based on the new definition and calculation method in the embodiments of the present application.
[0080] The converted parameters can be used by any type of three-dimensional model design software, that is, the converted parameters provided by the embodiments of the present application can be used for cross-platform parameter reading and use, and can be used to realize the functions of copying, modifying, editing, etc. of three-dimensional models in different software platforms without obstacles.
[0081] In the above method for converting the thickening parameters of the stretch feature in the three-dimensional model, the original parameters corresponding to the stretched model are first obtained, including the thickness parameter and the reverse parameter representing the thickening process, then the first reference vector and the second reference vector are determined based on the geometric parameters of the stretched model, and then the first reference vector is verified according to the second reference vector to determine the thickening direction parameter, so as to ensure the accuracy of the thickening process. Finally, the thickness parameter and the thickening direction parameter are taken as converted parameters of the original parameters, so as to realize the compatible use of the parameters in different three-dimensional model design software. In this embodiment, the calculation of the sketch and the stretch direction vector and other model data accurately determines whether the thickening direction needs to be reversed, replaces the default logic of the direct reading and use of the parameters in the prior art, significantly improves the success rate of the conversion of the thickening parameters in the stretch feature, and thus improves the conversion success rate of other features that rely on stretching, thereby solving the problem of parameter conversion error caused by inconsistent processing of the thickening direction between different CAD software, ensuring the correctness of the model shape generated after parameterization conversion, and thus improving the accuracy of model construction.
[0082] In another embodiment, as shown in FIG. 1, Figure 2 a method for converting thickening parameters of a stretch feature in a three-dimensional model is provided, including the following steps:
[0083] S201, obtaining original parameters corresponding to a stretched model;
[0084] S202, identifying the line type of the sketch in the stretched model and the number of thickening directions corresponding to the thickening process;
[0085] S203, in the case that the line type of the sketch is a line segment type and the number of thickening directions is 1, performing a cross product operation on the sketch direction vector and the stretch direction vector of the first edge of the sketch to obtain a first reference vector, and taking the normal vector of the reference adjacent surface as a second reference vector.
[0086] S204, in the case that the line type of the sketch is a line segment type and the number of thickening directions is 2, respectively offsetting the first edge of the sketch to determine each reference adjacent surface, performing a cross product operation on the sketch direction vector and the stretch direction vector to obtain a first reference vector, and taking the normal vector of each reference adjacent surface as a second reference vector associated with each thickness value;
[0087] S205, in the case that the line type of the sketch is a curve type and the number of thickening directions is 1, performing a cross product operation on the tangent vector at the starting point of the sketch and the stretch direction vector to obtain a first reference vector, and taking the normal vector of the reference adjacent surface at the starting point as a second reference vector;
[0088] S206, in the case that the line type of the sketch is a curve type and the number of thickening directions is 2, respectively offsetting the curve of the sketch to determine each reference adjacent surface, performing a cross product operation on the tangent vector at the starting point of the sketch and the stretch direction vector to obtain a first reference vector, and taking the normal vector of each reference adjacent surface at the corresponding starting point as a second reference vector associated with each thickness value;
[0089] S207, verifying the first reference vector according to the second reference vector to determine the thickening direction parameter of the thickening process corresponding to the stretched model;
[0090] S208, taking the thickness parameter and the thickening direction parameter associated with the thickness parameter as the converted parameter corresponding to the original parameter.
[0091] It should be noted that the specific limitations of the above steps can refer to the specific limitations of the above-mentioned method for converting the thickening parameter of the stretched feature in a three-dimensional model, which will not be described here.
[0092] In one embodiment, based on the geometric parameters of the stretched model, the first reference vector and the second reference vector are determined, including: identifying the line type of the sketch in the stretched model and the number of thickening directions corresponding to the thickening process; determining the first reference vector and the second reference vector based on the line type of the sketch and the number of thickening directions.
[0093] Wherein, the line type of the sketch is a line segment type or a curve type, which means that the line of the sketch can be a multi-segment line composed of line segments or a curve, and the number of thickening directions corresponding to the thickening process is 1 or 2, which means that the thickening direction can be one or two.
[0094] Specifically, by combining two different line composition types and two different thickening direction quantities, four application scenarios applicable to the embodiments of the present application can be determined, each application scenario corresponding to a different determination manner of the first reference vector and the second reference vector, and naturally, each application scenario has a different expression form of the converted parameter.
[0095] Exemplarily, the four application scenarios include: (1) the non-closed sketch is composed of a plurality of line segments, and there is one direction thickening; (2) the non-closed sketch is composed of a plurality of line segments, and there are two direction thickenings; (3) the non-closed sketch is composed of a plurality of curves, and there is one direction thickening; (4) the non-closed sketch is composed of a plurality of curves, and there are two direction thickenings.
[0096] In the embodiments, first, the line composition type of the sketch in the stretched model and the number of thickening directions corresponding to the thickening process are identified, then the first reference vector and the second reference vector are determined based on the identification result, and then through the combination of the two line composition types and the two thickening direction quantities, four application scenarios applicable are formed, and different determination manners of the reference vectors are matched, so as to generate converted parameters in different expression forms according to different application scenarios; the embodiments improve the flexibility and accuracy of the thickening process parameter definition through the systematic reference vector determination method, ensure effective application in different scenarios, and improve the success rate of the thickening parameter conversion in the stretching feature.
[0097] In one embodiment, based on the line composition type of the sketch and the number of thickening directions, the first reference vector and the second reference vector are determined, including: in the case that the line composition type of the sketch is a line segment type and the number of thickening directions is 1, determining a first edge of the sketch as a target entity edge, and determining a reference adjacent face in the adjacent face bounded by the target entity edge and parallel to the stretching direction vector as a reference adjacent face; taking the vector obtained by the cross product of the sketch direction vector corresponding to the target entity edge and the stretching direction vector as the first reference vector; and taking the normal vector of the reference adjacent face as the second reference vector.
[0098] In the application scenario corresponding to the line composition type of the sketch being a line segment type and the number of thickening directions being 1, the non-closed sketch in the stretching feature is composed of a plurality of line segments, and there is one direction thickening.
[0099] In the application scenario corresponding to the line composition type of the sketch being a line segment type and the number of thickening directions being 1, the non-closed sketch in the stretching feature is composed of a plurality of line segments, and there is one direction thickening.
[0100] Exemplarily, the reference vector determination process in the embodiments and the determination process of the converted parameter include the following steps:
[0101] (1) Extract the direction vector of the sketch, the stretching direction vector, and the adjacent face normal vector.
[0102] First, extract the first edge from the non-closed sketch, get its start point startPoint and end point endpoint, and generate the direction vector edgeDirection. At the same time, extract the extrusion direction vector extrudeDirection of the extrusion feature. These two vectors will be the basis for judging the thickening direction. Then get the entity edge corresponding to the first line of the sketch, and extract its two adjacent faces. Select the adjacent face parallel to extrudeDirection, and extract its normal vector faceNormal, which is always opposite to the real thickening direction.
[0103] (2) Assume the thickening direction of the parameterization conversion.
[0104] The embodiments of the present application assume a thickening direction as the initial direction of the parameterization conversion, which is perpendicular to edgeDirection and extrudeDirection. By performing cross product operation on the direction vector of the line segment in the sketch and the extrusion direction vector, a result vector result is generated, which is the assumed thickening direction.
[0105] (3) Determine whether to reverse by judging the direction relationship between the result vector and the normal vector.
[0106] Set a parameterization conversion thickening direction reversal parameter flip. Next, calculate the dot product of result vector and faceNormal.
[0107] If the dot product result is positive, it means that the directions of the two vectors are the same, which means that the assumed thickening direction is incorrect and needs to be reversed. The program language can be expressed as: flip = true, where true represents that the assumed thickening direction needs to be reversed.
[0108] If the dot product result is negative, it means that the directions of the two vectors are opposite, and the assumed thickening direction is correct and does not need to be reversed. The program language can be expressed as: flip = false, where false represents that the assumed thickening direction does not need to be reversed.
[0109] (4) Store and read the thickening parameters and reconstruct the extrusion thickening shape.
[0110] Store the result vector result and the thickening direction reversal parameter flip in the intermediate format file, and read these parameters in the target CAD, which can accurately reconstruct the extrusion thickening shape.
[0111] More specifically, in one example, as Figure 3As shown, the direction vector of the first edge in the sketch edgeDirection is (1, 0, 0), the extrusion direction vector extrudeDirection is (0, 0, 1), and the normal vector of the selected parallel adjacent face faceNormal is (0, -1, 0). The normal vector of this adjacent face faceNormal is always opposite to the thickening direction.
[0112] A parameterized conversion thickening direction flip parameter is set. The result vector is calculated:
[0113] result=edgeDirection extrudeDirection = (0, -1, 0);
[0114] result faceNormal = 1 > 0, so result and faceNormal are in the same direction, which indicates that the two vectors are in the same direction, the assumed thickening direction is wrong, and needs to be reversed. The program language can be represented as: flip = true, where true represents that the assumed thickening direction needs to be reversed.
[0115] It should be noted that, according to the cross product result, and after judging whether the normal vector is the same, the thickening direction can be corrected according to the judgment result, and the implementation principle is as follows:
[0116] According to the definition of stretching, edgeDirection and extrudeDirection are certainly perpendicular. The cross product of edgeDirection and extrudeDirection can obtain a vector perpendicular to edgeDirection and extrudeDirection, that is, the result vector, that is, the assumed thickening direction. The normal vector faceNormal is always opposite to the thickening direction, and faceNormal is also perpendicular to edgeDirection and extrudeDirection, so result and faceNormal are certainly parallel. By performing a dot product operation on the two parallel vectors result and faceNormal, if the dot product result > 0, it indicates that the two vectors are in the same direction. If the dot product result < 0, it indicates that the two vectors are in opposite directions.
[0117] More specifically, in one example, as Figure 4As shown, for another condition, edgeDirection is (1, 0, 0), extrudeDirection is (0, 0, 1), and faceNormal is (0, 1, 0);
[0118] result=edgeDirection extrudeDirection = (0, -1, 0);
[0119] result faceNormal = -1 < 0, so result and faceNormal are reversed, and flip is set to false.
[0120] In the application scenario where the line type of the sketch is a line segment type and the number of thickening directions is 1, an effective reference vector determination method is provided in this embodiment, which facilitates the generation of converted parameters and improves the diversity of application scenarios in the thickening parameter conversion process of the stretching feature.
[0121] In one embodiment, based on the line type of the sketch and the number of thickening directions, the first reference vector and the second reference vector are determined, including: in the case where the line type of the sketch is a line segment type and the number of thickening directions is 2, based on each thickness value in the thickness parameter, offsetting each of the first edges of the sketch to match the target entity edges corresponding to each thickness value; determining the reference adjacent faces corresponding to each target entity edge; taking the vector obtained by the cross product of the sketch direction vector corresponding to the target entity edge and the stretching direction vector as the first reference vector; and taking the normal vector of the reference adjacent face corresponding to each target entity edge as the second reference vector associated with each thickness value in the thickness parameter.
[0122] In the application scenario corresponding to the line type of the sketch being a line segment type and the number of thickening directions being 1, the non-closed sketch in the stretching feature is composed of a plurality of line segments, and there are two directions of thickening.
[0123] In the application scenario corresponding to the line type of the sketch being a line segment type and the number of thickening directions being 1, the non-closed sketch in the stretching feature is composed of a plurality of line segments, and there are two directions of thickening.
[0124] In the application scenario corresponding to the line type of the sketch being a line segment type and the number of thickening directions being 1, the non-closed sketch in the stretching feature is composed of a plurality of line segments, and there are two directions of thickening.
[0125] It should be noted that the thickness values, target entity edges, reference adjacent faces and second reference vectors in the embodiment all have two, and their matching relationship is clear, which are respectively used to determine the thickening direction parameters corresponding to the two thickening directions.
[0126] Exemplarily, the reference vector determination process and the determination process of the converted parameters in the embodiment include the following steps:
[0127] (1) Extract the direction vector of the sketch, the stretch direction vector and the adjacent face normal vector.
[0128] Extract the first edge of the sketch, and extract the stretch direction vector extrudeDirection of the stretch feature.
[0129] (2) Match the offset entity edge.
[0130] Since the thickening direction is two directions, the straight line on the sketch cannot be directly matched with the entity edge with the same geometry. The case where the thickening direction is two directions is actually the result of adding two entities with one thickening direction. In this case, the specific method is:
[0131] First, extract the thickening size of the two directions, denoted as d1 and d2. Offset the first edge of the sketch by ±d1 to generate two new straight lines. For the two new straight lines, try to obtain the entity edge with the same geometric feature. Only one of the straight lines can match the entity edge, which is called d1 edge, and the vector v1 of the d1 edge is obtained. Then, offset the first edge of the sketch by ±d2, repeat the above steps, generate two new straight lines and match them, so as to determine the entity edge corresponding to d2, called d2 edge, and obtain the vector v2 of the d2 edge.
[0132] (3) Obtain the normal vector.
[0133] Extract the two adjacent faces of d1 edge and d2 edge respectively. Select the adjacent face parallel to extrudeDirection, and obtain two normal vectors n1 and n2 respectively.
[0134] (4) Assume the thickening direction of parameterization conversion.
[0135] d1 and d2 are the assumed initial thickening directions. These direction vectors are perpendicular to v1, v2 and extrudeDirection at the same time. Specifically, by performing a cross product operation on v1 and extrudeDirection, a resultant vector result1 is generated, which is the assumed thickening direction of d1. Similarly, by performing a cross product operation on v2 and extrudeDirection, another resultant vector result2 is generated, which is the assumed thickening direction of d2.
[0136] Since a figure with two thickening directions can be regarded as the combination of two independent single-direction thickening direction figures, two thickening directions need to be assumed respectively in the conversion. And the two single-direction thickening figures are generated based on the straight lines of the sketches with v1 and v2.
[0137] Therefore, n1 is always opposite to the thickening direction of the stretch thickening figure corresponding to d1, and n2 is always opposite to the thickening direction of the stretch thickening figure corresponding to d2.
[0138] (5) Determine whether the flip is needed by judging the direction relationship between the resultant vector and the normal vector.
[0139] Set the parameterized conversion thickening direction flip parameter flip1 and flip2 for d1 and d2 respectively. Next, calculate the dot product of result1 vector and n1, and the dot product of result2 vector and n2 respectively.
[0140] If the dot product of result1 and n1 is > 0, then result1 and n1 are in the same direction, which means that the assumed d1 thickening direction is incorrect and needs to be reversed. The program language can be represented as: flip1 = true, where true represents that the assumed thickening direction needs to be reversed. If the dot product of result1 and n1 is < 0, then result1 and n1 are in opposite directions, which means that the assumed d1 thickening direction is correct and does not need to be reversed. The program language can be represented as: flip1 = false, where false represents that the assumed thickening direction does not need to be reversed.
[0141] Similarly, if the dot product of result2 and n2 > 0, then result2 is in the same direction as n2, indicating that the assumed d2 extrusion direction is incorrect and needs to be flipped. The program language can be expressed as: flip2 = true, where true represents that the assumed extrusion direction needs to be flipped. If the dot product of result2 and n2 < 0, then result2 is in the opposite direction of n2, indicating that the assumed d2 extrusion direction is correct and does not need to be flipped. The program language can be expressed as: flip2 = false, where false represents that the assumed extrusion direction does not need to be flipped.
[0142] (6) Store and read the extrusion parameters, and reconstruct the stretch extrusion shape.
[0143] The result vectors result1, result2 and the extrusion direction flip parameters flip1 and flip2 are stored in the intermediate format file, and these parameters are read by the target CAD, so that the stretch extrusion shape can be accurately reconstructed.
[0144] More specifically, in one example, the post-stretch model is as shown in Figure 5 , the original parameters include d1 = 20, d2 = 5; on this basis, as shown in Figure 6 , the first edge of the sketch is offset in the ±d1 direction to generate two new straight lines. For the two new straight lines, an attempt is made to obtain an entity edge with the same geometric characteristics as them. Only one of the straight lines can match the entity edge, which is called the d1 edge, and the vector v1 of the d1 edge is obtained.
[0145] Similarly, the first edge of the sketch is offset in the ±d2 direction, and the above steps are repeated to generate two new straight lines and match them, so as to determine the entity edge corresponding to d2, which is called the d2 edge, and the vector v2 of the d2 edge is obtained.
[0146] Two adjacent faces of the d1 edge and the d2 edge are extracted respectively. By selecting the adjacent face parallel to extrudeDirection, two normal vectors n1 and n2 can be obtained respectively.
[0147] Set the parameterized conversion extrusion direction flip parameters flip1 and flip2 for d1 and d2 respectively.
[0148] Calculate the result1 vector: result1 = v1 extrudeDirection; result1 n1 > 0, which means that the directions of the two vectors are the same, the assumed thickening direction is wrong, and needs to be reversed. The program language can be represented as: flip1 = true, where true represents that the assumed thickening direction needs to be reversed.
[0149] Similarly, the result2 vector is calculated: result2 = v2 extrudeDirection;
[0150] result2 n2 < 0, which means that the directions of the two vectors are opposite, the assumed thickening direction is correct, and does not need to be reversed. The program language can be represented as: flip2 = false, where false represents that the assumed thickening direction does not need to be reversed.
[0151] In the application scenario of the line composition type of the sketch being a curve type and the number of thickening directions being 2 in the embodiment, an effective reference vector determination manner is provided, which facilitates the generation of converted parameters in the subsequent process and improves the diversity of application scenarios in the thickening parameter conversion process of the stretching feature.
[0152] In one embodiment, based on the line composition type of the sketch and the number of thickening directions, the first reference vector and the second reference vector are determined, including: in the case that the line composition type of the sketch is a curve type and the number of thickening directions is 1, determining that the curve of the sketch is a target entity edge, and determining that the adjacent face parallel to the stretching direction vector in the adjacent face bounded by the target entity edge is a reference adjacent face; determining the tangent vector of the sketch at the starting point as a sketch direction vector, and determining the vector obtained by the cross product of the sketch direction vector and the stretching direction vector as the first reference vector; determining the normal vector of the reference adjacent face at the starting point as the second reference vector.
[0153] The application scenario corresponding to the line composition type of the sketch being a line segment type and the number of thickening directions being 1 is that the non-closed sketch in the stretching feature is composed of a curve, and there is one direction of thickening.
[0154] The target entity edge is a selected model entity edge used to determine the reference adjacent face.
[0155] Exemplarily, the reference vector determination process in the embodiment and the determination process of the converted parameters include the following steps:
[0156] (1) Extract the starting point tangent vector of the sketch, the stretching direction vector, and the adjacent face starting point normal vector.
[0157] Since the normal vector of a surface is different at every point on the surface, first extract the tangent vector of the start point of the first sketch curve, called vector. At the same time, extract the extrusion direction vector of the stretch feature, called extrudeDirection. Identify the geometrically identical entity edge to the first sketch curve and extract its adjacent face parallel to the extrusion direction. This adjacent face is a NURBS surface. Extract the normal vector of the NURBS surface at the start point, named normal.
[0158] where the geometrically identical means that all the geometric parameters of the entity edge and the sketch curve are the same.
[0159] (2) Assume the thickening direction of the parameterization conversion.
[0160] Assume a thickening direction as the initial direction of the parameterization conversion, which is perpendicular to both vector and extrudeDirection. By performing the cross product operation on the tangent vector of the first curve in the sketch and the extrusion direction vector, a result vector result is generated, which is the assumed thickening direction.
[0161] (3) Determine whether to reverse by judging the direction relationship between the result vector and the normal vector.
[0162] Set a parameterization conversion thickening direction reversal parameter flip. Next, calculate the dot product of result vector and normal.
[0163] If the dot product result is positive, it means that the directions of the two vectors are the same, which means that the assumed thickening direction is incorrect and needs to be reversed. The program language can be represented as: flip = true, where true represents that the assumed thickening direction needs to be reversed.
[0164] If the dot product result is negative, it means that the directions of the two vectors are opposite, and the assumed thickening direction is correct and does not need to be reversed. The program language can be represented as: flip = false, where false represents that the assumed thickening direction does not need to be reversed.
[0165] (4) Store and read the thickening parameters and reconstruct the stretch thickening shape.
[0166] Store the result vector result and the thickening direction reversal parameter flip in the intermediate format file, and read these parameters in the target CAD, which can accurately reconstruct the stretch thickening shape.
[0167] More specifically, in one example, as Figure 7As shown, the tangent vector Vector of the start point startPoint of the first curve of the sketch is extracted, the extrusion direction ExtrudeDirection is extracted, and the normal vector Normal of the surface at the start point is extracted. The normal vector direction is always opposite to the thickening direction.
[0168] A parameterized conversion thickening direction flip parameter is set.
[0169] The result vector is calculated: result = Vector extrudeDirection; result faceNormal < 0, so result is opposite to faceNormal, which means that the two vectors are in the same direction, and the assumed thickening direction is correct and does not need to be reversed. The program language can be represented as: flip = false, where false represents that the assumed thickening direction does not need to be reversed.
[0170] In the application scenario where the line type of the sketch is a curve type and the number of thickening directions is 1, an effective reference vector determination method is provided, which facilitates the generation of conversion parameters and improves the diversity of application scenarios in the thickening parameter conversion process of the extrusion feature.
[0171] In one embodiment, based on the line type of the sketch and the number of thickening directions, the first reference vector and the second reference vector are determined, including: in the case where the line type of the sketch is a curve type and the number of thickening directions is 2, based on each thickness value in the thickness parameter, the curves of the sketch are respectively offset to match the target entity edges corresponding to each thickness value; the reference adjacent faces corresponding to each target entity edge are determined; the tangent vector of the sketch at the start point is determined as the sketch direction vector, and the vector obtained by the cross product of the sketch direction vector and the extrusion direction vector is determined as the first reference vector; the normal vector of the reference adjacent face corresponding to each target entity edge at the start point is respectively determined as the second reference vector associated with each thickness value in the thickness parameter.
[0172] In the application scenario where the line type of the sketch is a line segment type and the number of thickening directions is 1, the non-closed sketch in the extrusion feature is composed of curves, and there are two directions of thickening.
[0173] Each thickness value includes a first thickness value and a second thickness value; for example, the first thickness value is d1 and the second thickness value is d2.
[0174] The reference adjacent surface is an adjacent surface parallel to the extrusion direction vector among the adjacent surfaces with the target entity edge as a boundary, and the normal vector at the starting point of the corresponding reference adjacent surface of each target entity edge refers to the normal vector of the target entity edge at the starting point of each target entity edge.
[0175] It should be noted that the thickness values, target entity edges, reference adjacent surfaces and second reference vectors in the embodiment each have two, and their matching relationship is clear, and they are respectively used to determine the thickening direction parameters corresponding to the two thickening directions.
[0176] Exemplarily, the reference vector determination process and the determination process of the converted parameters in the embodiment include the following steps:
[0177] (1) Extract the direction vector and the extrusion direction vector of the sketch.
[0178] Extract the first curve of the sketch, and extract the extrusion direction vector extrudeDirection of the extrusion feature.
[0179] (2) Match the offset entity edge.
[0180] Since the thickening direction is two directions, the curve on the sketch cannot be directly matched with the entity curve edge with the same geometry. The case where the thickening direction is two directions is actually the result of adding two entities with one thickening direction. In this case, the specific method is:
[0181] First, extract the thickening sizes of the two directions, denoted as d1 and d2. Offset the first edge of the sketch by ±d1 to generate two new curves. For the two new curves, try to obtain the entity edge with the same geometric feature. Only one of the curves can be matched to the entity edge, which is called the d1 edge, and the tangent vector v1 at the starting point of the d1 edge is obtained. Then, offset the first edge of the sketch by ±d2, repeat the above steps, generate two new curves and match them, to determine the entity edge corresponding to d2, called d2 edge, and obtain the tangent vector v2 at the starting point of the d2 edge.
[0182] (3) Obtain the normal vector.
[0183] Extract two adjacent surfaces of the d1 edge and the d2 edge respectively. Select the adjacent surfaces parallel to extrudeDirection, which are both NURBS surfaces. Extract the normal vectors of the two NURBS surfaces at the starting point, denoted as n1 and n2.
[0184] (4) Assume the thickening direction of the parameterization conversion.
[0185] d1 and d2 are the assumed initial thickening directions. These direction vectors are perpendicular to v1, v2 and extrudeDirection at the same time. Specifically, by performing a cross product operation on v1 and extrudeDirection, a resultant vector result1 is generated, which is the assumed thickening direction of d1. Similarly, by performing a cross product operation on v2 and extrudeDirection, another resultant vector result2 is generated, which is the assumed thickening direction of d2.
[0186] Since a figure with two thickening directions can be regarded as the combination of two independent single-direction thickening direction figures, two thickening directions need to be assumed respectively in the conversion. And the two single-direction thickening figures are generated based on the curves with the starting point tangent vectors v1 and v2 as the sketch.
[0187] Therefore, n1 is always opposite to the thickening direction of the stretch thickening figure corresponding to d1, and n2 is always opposite to the thickening direction of the stretch thickening figure corresponding to d2.
[0188] (5) Determine whether the flip is needed by judging the direction relationship between the resultant vector and the normal vector.
[0189] Set the parameterized conversion thickening direction flip parameter flip1 and flip2 for d1 and d2 respectively. Next, calculate the dot product of result1 vector and n1, and the dot product of result2 vector and n2.
[0190] If the dot product of result1 and n1 is > 0, then result1 and n1 are in the same direction, which means that the assumed d1 thickening direction is incorrect and needs to be reversed. The program language can be represented as: flip1 = true, where true represents that the assumed thickening direction needs to be reversed. If the dot product of result1 and n1 is < 0, then result1 and n1 are in opposite directions, which means that the assumed d1 thickening direction is correct and does not need to be reversed. The program language can be represented as: flip1 = false, where false represents that the assumed thickening direction does not need to be reversed.
[0191] Similarly, if the dot product of result2 and n2 > 0, then result2 is in the same direction as n2, indicating that the assumed d2 extrusion direction is incorrect and needs to be flipped. The program language can be expressed as: flip2 = true, where true represents that the assumed extrusion direction needs to be flipped. If the dot product of result2 and n2 is less than 0, then result2 is in the opposite direction of n2, indicating that the assumed d2 extrusion direction is correct and does not need to be flipped. The program language can be expressed as: flip2 = false, where false represents that the assumed extrusion direction does not need to be flipped.
[0192] (6) Store and read the extrusion parameters, and reconstruct the extruded shape.
[0193] Store the result vectors result1, result2 and the extrusion direction flip parameters flip1 and flip2 into the intermediate format file, and read these parameters in the target CAD, which can accurately reconstruct the extruded shape.
[0194] More specifically, in one example, the post-stretching model is as shown in Figure 8 , the original parameters include d1 = 20, d2 = 5; on this basis, as shown in Figure 9 , the ExtrudeDirection is obtained. The first curve of the sketch is offset in the ±d1 direction to generate two new curves. For the two new curves, try to obtain the entity edge with the same geometric characteristics as them. Only one of the curves can match the entity edge, called the d1 edge, and the tangent vector v1 at the starting point of the d1 edge is obtained.
[0195] Similarly, offset the first edge of the sketch in the ±d2 direction, repeat the above steps, generate two new curves and match them to determine the entity edge corresponding to d2, called the d2 edge, and obtain the tangent vector v2 at the starting point of the d2 edge.
[0196] Extract the two adjacent faces of the d1 edge and the d2 edge respectively. Select the adjacent faces parallel to extrudeDirection, which are both NURBS surfaces. Extract the normal vectors of the two NURBS surfaces at the starting point position, named n1 and n2 respectively.
[0197] Set the parameterized conversion extrusion direction flip parameters flip1 and flip2 for d1 and d2 respectively.
[0198] Calculate the result1 vector: result1 = v1 extrudeDirection; result1 n1 < 0, which means that the directions of the two vectors are opposite, the assumed thickening direction is correct, and no reversal is needed. The program language can be represented as: flip1 = false, where false represents that no reversal is needed for the assumed thickening direction.
[0199] Similarly, the result2 vector is calculated: result2 = v2 extrudeDirection;
[0200] result2 n2 > 0, which means that the directions of the two vectors are the same, the assumed thickening direction is incorrect, and a reversal is needed. The program language can be represented as: flip2 = true, where true represents that a reversal is needed for the assumed thickening direction.
[0201] In the application scenario of the present embodiment, when the line composition type of the sketch is a curve type and the number of thickening directions is 2, an effective reference vector determination method is provided, which facilitates the generation of converted parameters and improves the diversity of application scenarios in the thickening parameter conversion process of the stretch feature.
[0202] In the prior art, due to the inconsistent handling of non-closed sketch thickening directions by different CAD software, the same parameters often result in inconsistent graphics generated in different software.
[0203] In view of the differences in non-closed sketch thickening directions in the stretch feature between different CAD software, the present application provides a thickening parameter conversion method for the stretch feature in a three-dimensional model by introducing a vector calculation-based method, which proposes a new solution to accurately determine the thickening direction. The thickening parameter conversion method for the stretch feature in a three-dimensional model provided by the present application is also referred to as a method for determining the thickening direction of the stretch feature when performing parameter conversion between CAD software, or a method for determining the thickening direction based on vector calculation.
[0204] The thickening parameter conversion method for the stretch feature in a three-dimensional model provided by the present application specifically includes the following steps:
[0205] (1) Extract the direction vector, stretch direction vector, and adjacent face normal vector of the sketch.
[0206] First, the direction vector and stretch direction vector of the first line segment in the sketch are identified from the three-dimensional model to be converted. At the same time, a normal vector of an adjacent face is obtained, which is parallel to the stretch direction and has the first edge of the sketch as an adjacent edge. The normal vector is always opposite to the true thickening direction.
[0207] (2) Assume the thickening direction of parameterization conversion.
[0208] After the vector is extracted, a thickening direction is assumed as the initial direction of parameterization conversion. To this end, a result vector is generated by performing a cross product operation on the direction vector of the line segment in the sketch and the stretch direction vector, and the result vector is the assumed thickening direction in the embodiment of the application.
[0209] (3) Determine whether the result vector and the normal vector need to be reversed.
[0210] First, a parameterization conversion thickening direction reversal parameter flip is set, and then the dot product of the result vector and the facet normal vector is calculated to determine the direction relationship between the two:
[0211] If the result vector and the facet normal vector are in the same direction, it means that the assumed thickening direction is incorrect and needs to be reversed. The program language can be represented as: flip = true, where true represents that the assumed thickening direction needs to be reversed.
[0212] Similarly, if the result vector and the facet normal vector are in opposite directions, it means that the assumed thickening direction is correct and does not need to be reversed. The program language can be represented as: flip = false, where false represents that the assumed thickening direction does not need to be reversed.
[0213] (4) Store and read the thickening parameters and reconstruct the stretch thickening shape.
[0214] The assumed parameterization conversion thickening direction vector and the thickening direction reversal parameter flip are stored in the intermediate format file, and these parameters are read by the target CAD, so that the stretch thickening shape can be accurately reconstructed.
[0215] The method for converting the thickening parameters of the stretch feature in the three-dimensional model provided in the application, when extracting the stretch thickening feature of the non-closed sketch, does not update the flip parameter, but directly discards the flip parameter read by the CAD software, and defines a flip parameter of the parameterization conversion itself. By calculating the direction vector of the first edge of the sketch, the stretch direction vector and the facet normal vector and other model data, it is accurately determined whether the thickening direction needs to be reversed, replacing the default logic of the existing technology of directly reading and using the parameter, and significantly improving the success rate of the conversion of the thickening parameters in the stretch feature.
[0216] On this basis, the application correctly converts the parameters of the stretch, a basic feature, which can significantly improve the conversion success rate of other features that rely on stretch, thereby solving the problem of parameter conversion error caused by inconsistent handling of thickening directions between different CAD software, and ensuring the correctness of the shape of the model generated after parameterization conversion.
[0217] It should be noted that the thickening parameter conversion method of the stretch feature in the three-dimensional model provided in the present application is applicable to the stretching process of a non-closed sketch; generally, the thickening direction parameter of a closed sketch can be read, and is defined uniformly by various CAD software, and does not need to be converted by assuming and inferring through the method provided in the present application as the non-closed sketch.
[0218] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0219] Based on the same inventive concept, the present application also provides a thickening parameter conversion device for stretch features in a three-dimensional model for implementing the above-mentioned thickening parameter conversion method of stretch features in a three-dimensional model. The problem-solving implementation scheme provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more thickening parameter conversion device embodiments for stretch features in a three-dimensional model provided below can refer to the limitations of the thickening parameter conversion method of stretch features in a three-dimensional model described above, which will not be repeated here.
[0220] In one embodiment, as shown in Figure 10 A thickening parameter conversion device for stretch features in a three-dimensional model is provided, comprising: an original parameter acquisition module 1001, a reference vector determination module 1002, a thickening direction parameter determination module 1003, and a converted parameter determination module 1004, wherein:
[0221] The original parameter acquisition module 1001 is configured to acquire original parameters corresponding to the stretched model; the original parameters are parameters read by the stretched model in any type of three-dimensional model design software, representing the thickening process in the stretch feature, and the original parameters include a thickness parameter;
[0222] The reference vector determination module 1002 is configured to determine a first reference vector and a second reference vector based on geometric parameters of the stretched model, the first reference vector being a vector of a thickening direction in a hypothetical thickening process, and the second reference vector being a vector associated with an actual thickening direction of the model in the thickening process, the geometric parameters including a sketch corresponding to the stretching feature and a stretching direction vector;
[0223] The thickening direction parameter determination module 1003 is configured to verify the first reference vector according to the second reference vector, to determine a thickening direction parameter of the thickening process corresponding to the stretched model, the thickening direction parameter being used to represent a directional relationship between the first reference vector and the vector of the actual thickening direction;
[0224] The converted parameter determination module 1004 is configured to take the thickness parameter and the thickening direction parameter associated with the thickness parameter as converted parameters corresponding to the original parameters, the converted parameters being used by any type of three-dimensional model design software.
[0225] The above modules in the thickening parameter conversion device for the stretching feature in the three-dimensional model can be realized by software, hardware, or a combination thereof. The above modules can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to the above modules.
[0226] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in FIG. 8. Figure 11As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be realized through WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to realize a kind of thickening parameter conversion method of stretching feature in three-dimensional model. The display unit of the computer device is used to form visually visible picture, which can be display screen, projection device or virtual reality imaging device. The display screen can be liquid crystal display screen or electronic ink display screen, and the input device of the computer device can be touch layer covered on the display screen, or key, trackball or touchpad arranged on the shell of the computer device, or external keyboard, touchpad or mouse etc.
[0227] Those skilled in the art can understand that, Figure 11 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0228] In one embodiment, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps in each method embodiment described above.
[0229] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the steps in each method embodiment described above.
[0230] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to realize the steps in each method embodiment described above.
[0231] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0232] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0233] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for converting thickening parameters of a stretching feature in a three-dimensional model, characterized in that, The method includes: Obtain the original parameters corresponding to the stretched model; the original parameters are the parameters that characterize the thickening process in the stretching feature, which are read from the stretched model in any type of 3D model design software, and the original parameters include thickness parameters; Based on the geometric parameters of the stretched model, a first reference vector and a second reference vector are determined; the first reference vector is a vector of the assumed thickening direction during the thickening process, and the second reference vector is a vector associated with the actual thickening direction of the model during the thickening process; the geometric parameters include the sketch and the stretching direction vector corresponding to the stretching feature. The first reference vector is verified based on the second reference vector to determine the thickening direction parameter of the thickening process corresponding to the stretched model; the thickening direction parameter is used to characterize the directional relationship between the first reference vector and the vector of the actual thickening direction; The thickness parameter and the thickening direction parameter associated with the thickness parameter are used as the transformed parameters corresponding to the original parameters. The transformed parameters are used by any type of 3D model design software. Determining the first reference vector and the second reference vector based on the geometric parameters of the stretched model includes: Identify the line composition type of the sketch in the stretched model, and the number of thickening directions corresponding to the thickening process; Based on the line composition type of the sketch and the number of thickening directions, the first reference vector and the second reference vector are determined; The sketch is composed of line segments or curves, and the number of thickening directions corresponding to the thickening process is 1 or 2. The determination of the first reference vector and the second reference vector based on the line composition type and the number of thickening directions in the sketch includes: When the line composition type of the sketch is the line segment type and the number of the thickening directions is 1, the first edge of the sketch is determined to be the target entity edge, and the adjacent face that is parallel to the stretching direction vector among the adjacent faces with the target entity edge as the boundary is determined to be the reference adjacent face. The vector obtained by cross-product of the sketch direction vector corresponding to the edge of the target entity and the stretching direction vector is used as the first reference vector. The normal vector of the reference adjacent surface is used as the second reference vector.
2. The method according to claim 1, characterized in that, The determination of the first reference vector and the second reference vector based on the line composition type and the number of thickening directions in the sketch includes: When the line composition type of the sketch is the line segment type and the number of the thickening directions is 2, the first edge of the sketch is offset according to each thickness value in the thickness parameters to match the target entity edge corresponding to each thickness value; the thickness values include a first thickness value and a second thickness value. Determine the reference adjacent face corresponding to each of the target entity edges; the reference adjacent face is the adjacent face that is parallel to the stretching direction vector among the adjacent faces with the target entity edge as the boundary; The vector obtained by cross-product of the sketch direction vector corresponding to the edge of the target entity and the stretching direction vector is used as the first reference vector. The normal vectors of the reference adjacent faces corresponding to the edges of each target entity are respectively used as the second reference vectors associated with each thickness value in the thickness parameters.
3. The method according to claim 1, characterized in that, The determination of the first reference vector and the second reference vector based on the line composition type and the number of thickening directions in the sketch includes: When the line composition type of the sketch is the curve type and the number of the thickening directions is 1, the curve of the sketch is determined as the target entity edge, and the adjacent face that is parallel to the stretching direction vector among the adjacent faces with the target entity edge as the boundary is determined as the reference adjacent face. The tangent vector at the starting point of the sketch is determined as the sketch direction vector, and the vector obtained by cross-product of the sketch direction vector and the stretch direction vector is used as the first reference vector. The normal vector of the reference adjacent surface at the starting point is used as the second reference vector.
4. The method according to claim 1, characterized in that, The determination of the first reference vector and the second reference vector based on the line composition type and the number of thickening directions in the sketch includes: When the line composition type of the sketch is the curve type and the number of the thickening directions is 2, the curves of the sketch are offset according to each thickness value in the thickness parameters to match the target entity edge corresponding to each thickness value; each thickness value includes a first thickness value and a second thickness value. Determine the reference adjacent face corresponding to each of the target entity edges; the reference adjacent face is the adjacent face that is parallel to the stretching direction vector among the adjacent faces with the target entity edge as the boundary; The tangent vector at the starting point of the sketch is determined as the sketch direction vector, and the vector obtained by cross-product of the sketch direction vector and the stretch direction vector is used as the first reference vector. The normal vector of the reference adjacent face corresponding to each edge of the target entity at the starting point is respectively used as the second reference vector associated with each thickness value in the thickness parameter.
5. A device for converting thickening parameters of stretching features in a three-dimensional model, characterized in that, The device includes: The original parameter acquisition module is used to acquire the original parameters corresponding to the stretched model; the original parameters are the parameters that characterize the thickening process in the stretching feature, which are read from the stretched model in any type of 3D model design software, and the original parameters include thickness parameters. A reference vector determination module is used to determine a first reference vector and a second reference vector based on the geometric parameters of the stretched model; the first reference vector is a vector of the assumed thickening direction during the thickening process, and the second reference vector is a vector associated with the actual thickening direction of the model during the thickening process; the geometric parameters include the sketch and the stretching direction vector corresponding to the stretching feature. The thickening direction parameter determination module is used to verify the first reference vector based on the second reference vector to determine the thickening direction parameter of the thickening process corresponding to the stretched model; the thickening direction parameter is used to characterize the directional relationship between the first reference vector and the vector of the actual thickening direction; The conversion parameter determination module is used to take the thickness parameter and the thickening direction parameter associated with the thickness parameter as the conversion parameter corresponding to the original parameter. The conversion parameter is used by any type of 3D model design software. Determining the first reference vector and the second reference vector based on the geometric parameters of the stretched model includes: Identify the line composition type of the sketch in the stretched model, and the number of thickening directions corresponding to the thickening process; Based on the line composition type of the sketch and the number of thickening directions, the first reference vector and the second reference vector are determined; The sketch is composed of line segments or curves, and the number of thickening directions corresponding to the thickening process is 1 or 2. The determination of the first reference vector and the second reference vector based on the line composition type and the number of thickening directions in the sketch includes: When the line composition type of the sketch is the line segment type and the number of the thickening directions is 1, the first edge of the sketch is determined to be the target entity edge, and the adjacent face that is parallel to the stretching direction vector among the adjacent faces with the target entity edge as the boundary is determined to be the reference adjacent face. The vector obtained by cross-product of the sketch direction vector corresponding to the edge of the target entity and the stretching direction vector is used as the first reference vector. The normal vector of the reference adjacent surface is used as the second reference vector.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Rapid design method of personalized bone plate with controllable fitting degree
CN107149494A
Building aided design method and device, storage medium and design aided equipment
CN115455554A