Twisted modeling three-dimensional entity modeling method, device, medium and electronic equipment
By acquiring the torsion reference plane, torsion axis, and torsion angle, twisted surface modeling and topological stitching are performed to generate three-dimensional solid models of various twisted shapes. This solves the limitation of existing technologies that can only achieve one side surface as a spiral surface, and realizes accurate modeling of various twisted shapes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 江西博微新技术有限公司
- Filing Date
- 2022-12-26
- Publication Date
- 2026-06-26
AI Technical Summary
Existing methods for modeling twisted solids have significant limitations, as they can only model one type of twisted shape with a spiral surface on one side, and cannot adapt to a variety of twisted shapes.
By acquiring the torsion reference plane, torsion axis, and torsion angle, the modeling of the tortuous surface is performed. The modeling of the three-dimensional solid model is generated by sampling, normal plane calculation, torsion deformation fitting, and topology stitching algorithms, which supports the modeling of various tortuous shapes.
It achieves accurate 3D numerical calculations for various twisted shapes, supports modeling of multiple side views, and avoids the limitations of existing technologies.
Smart Images

Figure CN115797566B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer modeling, and in particular to a method, apparatus, medium, and electronic device for modeling distorted three-dimensional solids. Background Technology
[0002] Twisted structural components, such as pump blades, sheet metal parts, and drill bits, are fundamental components in industrial equipment. Twisted solid components are numerous in industrial CAD / CAE design, and modeling these components is the foundation for many applications, including thermodynamic analysis, 3D CNC simulation, and VR preview.
[0003] Existing methods for modeling twisted solids primarily rely on helical surfaces. This helical surface-based approach is a special type of modeling method for twisted solids, requiring that the sides of the twisted solid can be represented by helical surfaces. The sides of the twisted solid are directly constructed using helical surface parameters, thus generating the twisted solid model. Its limitations include significant limitations; it can only model twisted solids with helical surfaces as their sides. Summary of the Invention
[0004] In view of the above situation, it is necessary to provide a method, device, medium and electronic device for modeling distorted three-dimensional solids, which addresses the problem of the great limitations of existing technology in modeling distorted solids.
[0005] This invention discloses a method for modeling distorted three-dimensional solids, comprising the following steps:
[0006] Obtain the modeling parameters of the twisted surface, including the torsion reference plane, the torsion axis, and the torsion angle;
[0007] The torsion shaft is sampled to obtain multiple sampling points of the torsion shaft within its parameter range;
[0008] Calculate the normal plane of the torsion axis curve at each of the sampling points to obtain a set of normal planes, and extract the corresponding parameter curves on the torsion reference surface based on the calculated set of normal planes;
[0009] Based on the torsion angle, the extracted parameter curves are fitted with a torsion deformation to obtain multiple fitted curves;
[0010] Based on each of the fitted curves, a twisted surface is fitted to obtain the twisted surface;
[0011] A regular surface is generated based on the contour line of the twisted surface, and the regular surface and the twisted surface are combined using a topological stitching algorithm to generate a twisted three-dimensional solid model.
[0012] Furthermore, in the above-mentioned method for modeling a torsion-shaped 3D solid, the step of sampling the torsion axis to obtain multiple sampling points of the torsion axis within its parameter range includes:
[0013] Step 1: Uniformly sample N portions of the parameter range of the torsion shaft to obtain k sampled parameters, with the corresponding sampled parameter set being {u1, u2, ..., u...}. k}, where k = N + 1, and N is a natural number greater than 0;
[0014] Step 2, obtain the torsion axis curve NC at each sampling parameter {u1, u2, ..., u k The coordinates of the sampling points at} are used to obtain the sampling point set {p1, p2, ..., p}. k};
[0015] Step 3: Calculate the p of each sampling point in the sampling point set. i Compared with the two sampling points p before and after it i-1 ,p i+1 The distance d between the lines i , i = 2, 3, ..., k-1;
[0016] Step 4, determine the distance d i Is it greater than the threshold?
[0017] Step 5, if so, then in [u i-1 u i ] and [u i u i+1 Insert one parameter into each of the two parameter intervals, denoted as u. c1 and u c2 , The inserted parameters are added to the sampling parameter set, and the number of parameters k is updated.
[0018] Step 6: Return to and repeat steps 3-5 until the number of repetitions reaches the preset maximum number of subdivisions or d. i Not greater than the threshold.
[0019] Furthermore, in the above-mentioned method for modeling 3D solid objects with twisted shapes, the formula for extracting a set of parametric curves corresponding to the torsional reference plane includes:
[0020] C = intersect(P, BF), where BF is the torsion reference plane, P is the set of normal planes, and intersect represents the surface intersection operation.
[0021] Furthermore, in the above-mentioned method for modeling 3D solid objects with twisted shapes, the step of fitting the extracted parameter curves with twisted deformation based on the twist angle includes:
[0022] Calculate the rotation angle at each sampling parameter based on the stated torsion angle;
[0023] The expressions of each parameter curve are converted into B-spline descriptions;
[0024] The rotation angle is linearly mapped to each control point of the parameter curve to perform a distortion fit on the parameter curve.
[0025] Furthermore, in the above-described method for modeling 3D solid objects with twisted shapes, the linear mapping formula for the step of linearly mapping the rotation angle to each control point of the parameter curve is:
[0026]
[0027] Where, α j Let be the rotation angle of the j-th control point of the parametric curve. Let be the rotation angle of the i-th sampled parameter, and n be the number of control points of the parameter curve minus 1.
[0028] Furthermore, in the above-mentioned method for modeling 3D solids with twisted shapes, the step of fitting the twisted surface based on each of the fitting curves includes:
[0029] The expressions of each fitted curve are converted into B-spline descriptions;
[0030] According to the B-spline curve order-up algorithm, the order of each fitted curve is unified to p. max p max The highest degree of the B-spline curve among all fitted curves;
[0031] Based on the B-spline curve node refinement algorithm, the node vector of each fitted curve is unified as U, where U is the merged set of different nodes of all fitted curves.
[0032] Global interpolation is performed on the processed fitted curve to obtain the control points of the final twisted surface. The fitted twisted surface is thus obtained as follows:
[0033]
[0034] Where, N i,p (u) is the basis function of the twisted surface u, consisting of the nodal vector U and the degree p. max Together, N j,q(u) is the v-direction basis function of the twisted surface, which is determined by the node vector V and the degree q of the twisted axis curve NC; n is the number of control points in the u direction minus 1, m is the number of control points in the v direction minus 1, and w is the control point weight factor.
[0035] The present invention also discloses a device for modeling distorted three-dimensional solids, comprising:
[0036] The acquisition module is used to acquire the modeling parameters of the twisted surface, including the torsion reference plane, the torsion axis, and the torsion angle;
[0037] A sampling module is used to sample the torsion shaft to obtain multiple sampling points of the torsion shaft within its parameter range;
[0038] The normal plane calculation module is used to calculate the normal plane of the torsion axis curve at each of the sampling points, obtain a set of normal planes, and extract the corresponding parameter curves on the torsion reference surface based on the calculated set of normal planes.
[0039] The curve fitting module is used to perform torsion deformation fitting on each of the extracted parameter curves according to the torsion angle to obtain multiple fitting curves;
[0040] The surface fitting module is used to perform twisted surface fitting based on each of the fitting curves to obtain a twisted surface.
[0041] The regular surface generation module is used to generate regular surfaces based on the contour lines of twisted surfaces.
[0042] The stitching module is used to generate a twisted three-dimensional solid model by combining the regular curved surface and the twisted curved surface using a topological stitching algorithm.
[0043] Furthermore, in the aforementioned distorted three-dimensional solid modeling device, the sampling module is specifically used to perform the following steps:
[0044] Step 1: Uniformly sample N portions of the parameter range of the torsion shaft to obtain k sampled parameters, with the corresponding sampled parameter set being {u1, u2, ..., u...}. k}, where k = N + 1, and N is a natural number greater than 0;
[0045] Step 2, obtain the torsion axis curve NC at each sampling parameter {u1, u2, ..., u k The coordinates of the sampling points at} are used to obtain the sampling point set {p1, p2, ..., p}. k};
[0046] Step 3: Calculate the p of each sampling point in the sampling point set. i Compared with the two sampling points p before and after it i-1 ,pi+1 The distance d between the lines i , i = 2, 3, ..., k-1;
[0047] Step 4, determine the distance d i Is it greater than the threshold?
[0048] Step 5, if so, then in [u i-1 u i ] and [u i u i+1 Insert one parameter into each of the two parameter intervals, denoted as u. c1 and u c2 , The inserted parameters are added to the sampling parameter set, and the number of parameters k is updated.
[0049] Step 6: Return to and repeat steps 3-5 until the number of repetitions reaches the preset maximum number of subdivisions or d. i Not greater than the threshold.
[0050] The present invention also discloses a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the distorted three-dimensional solid modeling method described in any of the preceding claims.
[0051] The present invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the twisted three-dimensional solid modeling method described above.
[0052] The proposed method for three-dimensional solid modeling of twisted shapes is a method based on twist deformation. It performs twisted surface modeling based on the input torsion reference plane, torsion axis and torsion angle, and then establishes a regular surface based on the contour line of the twisted surface model. By stitching the regular surface and the twisted surface together, a three-dimensional twisted shape topology model can be created. This method supports accurate three-dimensional numerical calculation. Attached Figure Description
[0053] Figure 1 A flowchart of a three-dimensional solid modeling method for twisted shapes provided in an embodiment of the present invention;
[0054] Figure 2 A schematic diagram for modeling a twisted entity;
[0055] Figure 3 A flowchart illustrating the steps involved in fitting the extracted parameter curves to a distorted shape.
[0056] Figure 4 A flowchart illustrating the steps involved in fitting a twisted surface;
[0057] Figure 5 A schematic diagram for modeling a regular curved surface;
[0058] Figure 6 This is a schematic diagram of the structure of the three-dimensional solid modeling device for twisted shapes provided in an embodiment of the present invention;
[0059] Figure 7 This is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. Detailed Implementation
[0060] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0061] These and other aspects of the embodiments of the invention will become clear from the following description and accompanying drawings. In these descriptions and drawings, some specific embodiments of the invention are specifically disclosed to illustrate some ways of implementing the principles of the embodiments of the invention; however, it should be understood that the scope of the embodiments of the invention is not limited thereto. Rather, the embodiments of the invention include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.
[0062] Please see Figure 1 The present invention provides a method for modeling a distorted three-dimensional solid, which includes steps S11 to S16.
[0063] Step S11: Obtain the modeling parameters of the twisted surface, including the torsion reference plane, the torsion axis, and the torsion angle.
[0064] In this embodiment, the method only requires the user to input parameters to define the modeling parameters of the twisted surface to output the twisted solid. For example... Figure 2 As shown, in this embodiment, the modeling parameters of the twisted surface mainly include three parts: twisted surface modeling, regular surface modeling, and stitching into a solid. From the perspective of the twisted shape structure, its solid model's surface set FS includes a twisted surface set NFS composed of multiple surfaces and a regular surface set CFS composed of at least one regular surface. In general, the side surfaces of the twisted shape entity can be taken as twisted surfaces, and the top and bottom surfaces of the twisted shape entity can be taken as regular surfaces.
[0065] A twisted surface can be a surface constructed using a torsion reference plane, a torsion axis, and torsion angle parameters. A regular surface is a surface directly generated from the side profile of a twisted surface. Regular surfaces do not require modeling with complex torsion parameters; they can be directly fitted using the Coons surface algorithm.
[0066] In this embodiment, the modeling parameters include the torsion reference plane, the torsion axis, and the torsion angle. Let the i-th tortuous surface NF be... i The modeling parameters are: torsional datum plane BF i Torsion shaft NC i Twist angle θ i By defining the modeling parameters for all twisted surfaces in NFS, a set of modeling parameters for twisted shapes can be obtained.
[0067] In the modeling parameter definition, the torsion reference plane and torsion axis can be customized according to the actual application. For example, the torsion reference plane of the twisted surface of the centrifugal pump blade can be a trapezoidal plane and the torsion axis can be the straight line corresponding to the height of the trapezoid; the reference plane of the twisted surface of the sheet metal connector can be a rectangular plane and the torsion axis can be the central axis of the short side of the rectangular plane.
[0068] Step S12: Sample the torsion shaft to obtain multiple sampling points of the torsion shaft in its parameter range.
[0069] Specifically, in one embodiment of the present invention, the torsion axis can be sampled using the torsion axis sampling function LocationLaw. This function operates on the torsion axis curve NC, and the result is the torsion axis curve NC within its parameter range [u...]. min u max The parameter set on ], that is:
[0070] LocationLaw(NC)={u1,u2,...,u k}, u min ≤u1<u2<...u k ≤u max u1, u2, ..., u k These are the sampling parameters.
[0071] The specific implementation steps of the torsion axis sampling function LocationLaw include:
[0072] Step 1: Uniformly sample N portions of the parameter range of the torsion shaft to obtain k sampled parameters, with the corresponding sampled parameter set being {u1, u2, ..., u...}. k}, where k = N + 1, and N is a natural number greater than 0;
[0073] Step 2, obtain the torsion axis curve NC at each sampling parameter {u1, u2, ..., u k The coordinates of the sampling points at} are used to obtain the sampling point set {p1, p2, ..., p}. k};
[0074] Step 3: Calculate the p of each sampling point in the sampling point set. i Compared with the two sampling points p before and after it i-1 ,p i+1 The distance d between the lines i , i = 2, 3, ..., k-1;
[0075] Step 4, determine the distance d i Is it greater than the threshold?
[0076] Step 5, if so, then in [u i-1 u i ] and [u i u i+1 Insert one parameter into each of the two parameter intervals, denoted as u. c1 and u c2 , The inserted parameters are added to the sampling parameter set, and the number of parameters k is updated.
[0077] Step 6: Return to and repeat steps 3-5 until the number of repetitions reaches the preset maximum number of subdivisions or d. i Not greater than the threshold.
[0078] First, define the parameter range [u] min u max N samples are uniformly sampled, where N is a natural number greater than 0. The number of sampling points is k = N + 1. Then, the torsional axis curve NC is determined to lie in {u1, u2, ..., u...}. k The coordinates of the sampling point at} are {p1, p2, ..., p}. k}, and calculate sampling point p i With the two sampling points p before and after i-1 p i+1 The distance d of the line i Let i = 1, 2, ..., k. Let T be the threshold parameter for whether the segmentation is further subdivided. If d i >T, then in [u i-1 u i ] and [u i u i+1 Insert a sampling point into each of the two parameter intervals, denoted as u. c1 and u c2 , At this point, two new sampling points have been added, and the current number of sampling points is k = k + 2.
[0079] The process of inserting all sampling points in the original sampling point set is defined as one round of sampling point subdivision calculation. After completing one round of sampling point subdivision calculation, the next round of sampling point subdivision calculation continues, and the calculation object of the next round is the sampling point set updated by the previous round of subdivision calculation.
[0080] It should be noted that if d does not exist during the current subdivision calculation... i If the number of sampling rounds exceeds T, then the calculation of sampling point parameters is terminated. Let M be the maximum number of subdivisions. If the number of sampling rounds exceeds M, then the calculation of sampling point parameters is terminated. The maximum number of subdivisions is a preset value to avoid getting stuck in a loop of repeated calculations.
[0081] Finally, if the total number of subdivisions is X, then the final number of sampling points is k = N + 1 + 2X, and thus LocationLaw(NC) = {u1, u2, ..., u...} N+1+2X}
[0082] Step S13: Calculate the normal plane of the torsion axis curve at each of the sampling points to obtain a set of normal planes, and extract the corresponding parameter curves on the torsion reference surface based on the calculated set of normal planes.
[0083] Assume a set of parametric curves on the torsional reference plane are C = {C1, C2, ..., C...} k Let the torsional axis curve NC lie in the parametric coordinates {u1, u2, ..., u}. k The set of normal planes at point} is P = {P1, P2, ..., P}. k},but,
[0084] C = intersect(P, BF);
[0085] Where intersect represents the surface intersection operation, BF is the torsional reference plane, and P is calculated by the LocationLaw(NC) algorithm. The LocationLaw(NC) algorithm is implemented as follows:
[0086] Let F(u) be the moving frame of the torsional axis curve NC at parameter u. Then, F(u) = Frenet(NC, u).
[0087] According to LocationLaw(NC) = · {u1, u2, ..., u k}, thus a frame on the torsional axis curve can be obtained as F = {F1, F2, ..., F}. k};
[0088] Then the i-th normal plane is
[0089] P i =Plane(O, N) =Plane(Fi .O,F i .T), i = 1, 2, ..., k;
[0090] Where Plane represents a plane, O is the origin of the plane, N is the normal vector of the plane, and F... i .O represents the active frame F of the i-th NC curve. i The origin, F i .T represents the active frame F of the i-th NC curve. i The tangent vector.
[0091] Step S14: Perform twist deformation fitting on each of the extracted parameter curves according to the twist angle to obtain multiple fitting curves.
[0092] Specifically, such as Figure 3 As shown, in one embodiment of the present invention, the step of fitting the extracted parameter curves to the torsion angle includes:
[0093] Step S141: Calculate the rotation angle at each sampling parameter based on the torsion angle;
[0094] Step S142: Convert the expression of each parameter curve into a B-spline description;
[0095] Step S143: The rotation angle is linearly mapped to each control point of the parameter curve to perform a distortion fitting on the parameter curve.
[0096] Specifically, the torsion deformation fitting of the parametric curves can be achieved through the torsion deformation function SectionLaw. Its object is a set of parametric curves C extracted from the torsion reference plane, and the result is a set of fitted curves on the torsion result plane, that is:
[0097] SectionLaw(C)={SC1, SC2,...,SC k}
[0098] Let C be the parametric curve extracted from the i-th reference surface. i The corresponding torsional deformation function can be defined as:
[0099]
[0100] Among them, F i The parameter curve is C i The corresponding torsional axis curve movable frame, The parameter curve is C i The rotation angle.
[0101] The implementation steps of the distortion function SectionLaw first require calculating the rotation angle of each parameter curve, and then fitting the parameter curves with the rotation angles of the parameter curves to achieve distortion deformation. Specifically, the distortion angle θ can be calculated using LocationLaw(NC) = ·{u1, u2, ..., u...}. k The linear proportions of each sampling parameter in the equation, mapped to different sampling parameter coordinates, yield the rotation angles at different sampling parameters:
[0102]
[0103] in, u i Let [u] be the i-th sampled parameter on the torsion axis curve. min u max [ ] represents the parameter range of the torsion axis curve NC.
[0104] The steps for fitting the parametric curve to a distortion curve include:
[0105] Let the parameter curve C i The B-spline representation is as follows:
[0106] The distortion of the parametric curve can be achieved by rotating the control points of the parametric curve, that is, by rotating the angle. Mapped to parameter curve C according to a linear ratio i Each control point. Let the distorted parametric curve be the control point:
[0107]
[0108] Where, N j,p (u) is the basis function of the parametric curve before distortion. For the control point set,
[0109] Where n is the number of control points minus 1, Rotation is the rotation transformation, and F i For parameter curve C i The corresponding torsion shaft movable frame, α j Control points Relative to F i The rotation angle.
[0110] According to the linear mapping method Mapped to parameter curve C i For each control point, the rotation angle of each control point is:
[0111]
[0112] Step S15: Fit a twisted surface according to each of the fitted curves to obtain a twisted surface.
[0113] Let the set of fitted curves for a certain tortuous side be {SC1, SC2, ..., SC...} k Then the twisted surface can be represented as: s = skinning(SC1, SC2, ..., SC) k ), where skinning is the skinning surface algorithm. Specifically, such as... Figure 4 As shown, in one embodiment of the present invention, the process of fitting a twisted surface based on each of the fitted curves includes steps S151 to S154.
[0114] Step S151: Convert the representation of each fitted curve into a B-spline description. For example, convert the fitted curve SC... i The expression is converted into a B-spline description, denoted as BC. j , Where n is the number of control points for the fitted curve minus 1, N i,p (u) represents the u-direction basis function of the twisted surface, p is the curve degree, w is the control point weight, and SC i Let k be the i-th fitted curve, and k be the number of fitted curves. This is the set of control points for the fitted curve;
[0115] Step S152: According to the B-spline curve order increase algorithm, unify the degree of each fitted curve to p. max p max The highest degree of the B-spline curve among all fitted curves.
[0116] Step S153: According to the B-spline curve node refinement algorithm, unify the node vector of each fitted curve as U, where U is the merged set of different nodes of all fitted curves. For example, if U1 = {0, 0, 0, 1, 2, 2, 4, 4, 4} and U2 = {0, 0, 0, 1, 2, 3, 4, 4, 4}, then the merged node vector set is U. combine ={0,0,0,1,2,2,3,4,4,4}.
[0117] Step S154: Perform global interpolation on the processed fitted curve to obtain the control points of the final twisted surface, thus obtaining the fitted twisted surface. The control points of the final twisted surface are... The fitted twisted surface is:
[0118]
[0119] Where, N i,p (u) is the basis function of the twisted surface u, consisting of the nodal vector U and the degree p. max Together, Nj,q (u) is the v-direction basis function of the twisted surface, which is determined by the node vector V and the degree q of the twisted axis curve NC; n is the number of control points in the u direction minus 1, m is the number of control points in the v direction minus 1, and w is the control point weight factor.
[0120] Step S16: Generate a regular surface based on the contour line of the twisted surface, and generate a twisted three-dimensional solid model by combining the regular surface and the twisted surface using a topological stitching algorithm.
[0121] like Figure 5 As shown, a regular surface can be defined by the contour formed by the edges of a twisted surface. Let a certain regular surface be CF. i Then there is
[0122] CF i =Coons(E),
[0123] Where E represents the contour edge for constructing the regular surface, E represents the side edge of the twisted surface, and Coons represents the algorithm for constructing the surface by edge, also known as the bilinear hybrid Coons surface algorithm.
[0124] Based on the fitted twisted side of the twisted entity, combined with the starting and ending surfaces, a three-dimensional solid model of the twisted shape can be generated through a topological stitching algorithm.
[0125] The tortuous 3D solid modeling method in this embodiment supports generating topological models of tortuous 3D solids using a reference plane, torsion axis, and torsion angle as input. Its advantages are:
[0126] 1) A custom rule sampling method for torsion axis is proposed. The parameter positions of the fitted contour are automatically extracted through an iterative subdivision algorithm, which can effectively ensure that the key features of the side of the twisted entity are not lost.
[0127] 2) A custom deformation method for fitting contours is proposed to achieve modeling of twisted surfaces;
[0128] 3) The output modeling results are topological models, which can support accurate three-dimensional numerical calculations.
[0129] Please see Figure 6 The device for modeling a distorted three-dimensional solid in an embodiment of the present invention includes:
[0130] The acquisition module 11 is used to acquire the modeling parameters of the twisted surface, including the torsion reference plane, the torsion axis and the torsion angle;
[0131] Sampling module 12 is used to sample the torsion shaft to obtain multiple sampling points of the torsion shaft in its parameter range;
[0132] The normal plane calculation module 13 is used to calculate the normal plane of the torsion axis curve at each of the sampling points, obtain a set of normal planes, and extract the corresponding parameter curves on the torsion reference surface based on the calculated set of normal planes.
[0133] The curve fitting module 14 is used to perform torsion deformation fitting on each of the extracted parameter curves according to the torsion angle to obtain multiple fitting curves.
[0134] The surface fitting module 15 is used to perform twisted surface fitting based on each of the fitting curves to obtain a twisted surface.
[0135] Regular surface generation module 16 is used to generate regular surfaces based on the contour lines of twisted surfaces;
[0136] The stitching module 17 is used to generate a twisted three-dimensional solid model by using a topological stitching algorithm to combine the regular curved surface and the twisted curved surface.
[0137] Furthermore, in the aforementioned distorted three-dimensional solid modeling device, the sampling module is specifically used to perform the following steps:
[0138] Step 1: Uniformly sample N portions of the parameter range of the torsion shaft to obtain k sampled parameters, with the corresponding sampled parameter set being {u1, u2, ..., u...}. k}, where k = N + 1, and N is a natural number greater than 0;
[0139] Step 2, obtain the torsion axis curve NC at each sampling parameter {u1, u2, ..., u k The coordinates of the sampling points at} are used to obtain the sampling point set {p1, p2, ..., p}. k};
[0140] Step 3: Calculate the p of each sampling point in the sampling point set. i Compared with the two sampling points p before and after it i-1 ,p i+1 The distance d between the lines i , i = 2, 3, ..., k-1;
[0141] Step 4, determine the distance d i Is it greater than the threshold?
[0142] Step 5, if so, then in [u i-1 u i ] and [u i u i+1 Insert one parameter into each of the two parameter intervals, denoted as u. c1 and u c2 , The inserted parameters are added to the sampling parameter set, and the number of parameters k is updated.
[0143] Step 6: Return to and repeat steps 3-5 until the number of repetitions reaches the preset maximum number of subdivisions or d. i Not greater than the threshold.
[0144] The distorted three-dimensional solid modeling device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0145] In another aspect, the present invention also proposes an electronic device, please refer to [link to relevant documentation]. Figure 7 The image shows an electronic device according to an embodiment of the present invention, including a processor 10, a memory 20, and a computer program 30 stored in the memory and executable on the processor. When the processor 10 executes the computer program 30, it implements the above-described method for modeling distorted three-dimensional solids.
[0146] The electronic device may be, but is not limited to, a personal computer, a mobile phone, or other computer equipment. In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, etc.
[0147] The memory 20 includes at least one type of readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 20 can be an internal storage unit of an electronic device, such as the hard disk of the electronic device. In other embodiments, the memory 20 can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Furthermore, the memory 20 can include both internal and external storage units of the electronic device. The memory 20 can be used not only to store application software and various types of data installed on the electronic device, but also to temporarily store data that has been output or will be output.
[0148] Optionally, the electronic device may further include a user interface, a network interface, a communication bus, etc. The user interface may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface. The network interface may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface), typically used to establish communication connections between the device and other electronic devices. The communication bus is used to enable communication between these components.
[0149] It should be pointed out that, Figure 7 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0150] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for modeling distorted three-dimensional solids.
[0151] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system or apparatus (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from or in conjunction with such an instruction execution system or apparatus). For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit programs for use by or in conjunction with an instruction execution system or apparatus.
[0152] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0153] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0154] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0155] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A method for modeling a 3D solid with a twisted shape, wherein the twisted shape is a centrifugal pump blade or a sheet metal connector, characterized in that, Including the following steps: Obtain the modeling parameters of the twisted surface, including the torsion reference plane, the torsion axis, and the torsion angle; The torsion shaft is sampled to obtain multiple sampling points of the torsion shaft within its parameter range; Calculate the normal plane of the torsion axis curve at each of the sampling points to obtain a set of normal planes, and extract the corresponding parameter curves on the torsion reference surface based on the calculated set of normal planes; Based on the torsion angle, the extracted parameter curves are fitted with a torsion deformation to obtain multiple fitted curves; Based on each of the fitted curves, a twisted surface is fitted to obtain the twisted surface; A regular surface is generated based on the contour line of the twisted surface, and the regular surface and the twisted surface are combined using a topological stitching algorithm to generate a twisted three-dimensional solid model. The step of sampling the torsion shaft to obtain multiple sampling points of the torsion shaft within its parameter range includes: Step 1: Uniformly sample N portions of the parameter range of the torsion shaft to obtain k sampled parameters, and the corresponding set of sampled parameters is as follows. , where k = N + 1, and N is a natural number greater than 0; Step 2: Obtain the torsion axis curve NC at various sampling parameters. The coordinates of the sampling points at the location are used to obtain the set of sampling points. ; Step 3: Calculate the p of each sampling point in the sampling point set. i Compared with the two sampling points p before and after it i-1 ,p i+1 The distance d between the lines i , i=2,3,…,k-1; Step 4, determine the distance d i Is it greater than the threshold? Step 5, if so, then in and Insert one parameter into each of the two parameter ranges, denoted as . and , , The inserted parameters are added to the sampling parameter set, and the number of parameters k is updated. Step 6: Return to and repeat steps 3-5 until the number of repetitions reaches the preset maximum number of subdivisions or d. i Not greater than the threshold.
2. The method for modeling a distorted three-dimensional solid as described in claim 1, characterized in that, The formula for extracting the corresponding parameter curves on the torsional reference plane includes: Where BF is the torsion reference plane, P is the set of normal planes, and intersect represents the surface intersection operation.
3. The method for modeling a distorted three-dimensional solid as described in claim 1, characterized in that, The step of fitting the extracted parameter curves to the torsion angle includes: Calculate the rotation angle at each sampling parameter based on the stated torsion angle; The expressions of each parameter curve are converted into B-spline descriptions; The rotation angle is linearly mapped to each control point of the parameter curve to perform a distortion fit on the parameter curve.
4. The method for modeling a distorted three-dimensional solid as described in claim 3, characterized in that, In the step of linearly mapping the rotation angle to each control point of the parameter curve, the linear mapping formula is: ; in, Let be the rotation angle of the j-th control point of the parametric curve. Let be the rotation angle of the i-th sampled parameter, and n be the number of control points of the parameter curve minus 1.
5. The method for modeling a distorted three-dimensional solid as described in claim 1, characterized in that, The step of fitting the twisted surface based on each of the fitted curves includes: The expressions of each fitted curve are converted into B-spline descriptions; According to the B-spline curve order-up algorithm, the order of each fitted curve is unified as follows: , The highest degree of the B-spline curve among all fitted curves; Based on the B-spline curve node refinement algorithm, the node vector of each fitted curve is unified as U, where U is the merged set of different nodes of all fitted curves. Global interpolation is performed on the processed fitted curve to obtain the control points of the final twisted surface. Thus, the fitted twisted surface is obtained as follows: ; in, Twisted surface The basis function is derived from the node vector U and the order of the basis function. jointly determined, The v-direction basis function of the twisted surface is determined by the node vector V and degree q of the twisted axis curve NC; n is the number of control points in the u direction minus 1, m is the number of control points in the v direction minus 1, and w is the control point weight factor.
6. A three-dimensional solid modeling device for twisted shapes, wherein the twisted shape is a centrifugal pump blade or a sheet metal connector, characterized in that, include: The acquisition module is used to acquire the modeling parameters of the twisted surface, including the torsion reference plane, the torsion axis, and the torsion angle; A sampling module is used to sample the torsion shaft to obtain multiple sampling points of the torsion shaft within its parameter range; The normal plane calculation module is used to calculate the normal plane of the torsion axis curve at each of the sampling points, obtain a set of normal planes, and extract the corresponding parameter curves on the torsion reference surface based on the calculated set of normal planes. The curve fitting module is used to perform torsion deformation fitting on each of the extracted parameter curves according to the torsion angle to obtain multiple fitting curves; The surface fitting module is used to perform twisted surface fitting based on each of the fitting curves to obtain a twisted surface. The regular surface generation module is used to generate regular surfaces based on the contour lines of twisted surfaces. The stitching module is used to generate a twisted three-dimensional solid model by combining the regular curved surface and the twisted curved surface using a topological stitching algorithm. The sampling module is specifically used to perform the following steps: Step 1: Uniformly sample N portions of the parameter range of the torsion shaft to obtain k sampled parameters, and the corresponding set of sampled parameters is as follows. , where k = N + 1, and N is a natural number greater than 0; Step 2: Obtain the torsion axis curve NC at various sampling parameters. The coordinates of the sampling points at the location are used to obtain the set of sampling points. ; Step 3: Calculate the p of each sampling point in the sampling point set. i Compared with the two sampling points p before and after it i-1 ,p i+1 The distance d between the lines i , i=2,3,…,k-1; Step 4, determine the distance d i Is it greater than the threshold? Step 5, if so, then in and Insert one parameter into each of the two parameter ranges, denoted as . and , , The inserted parameters are added to the sampling parameter set, and the number of parameters k is updated. Step 6: Return to and repeat steps 3-5 until the number of repetitions reaches the preset maximum number of subdivisions or d. i Not greater than the threshold.
7. A readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the distorted three-dimensional solid modeling method as described in any one of claims 1 to 5.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the twisted shape three-dimensional solid modeling method as described in any one of claims 1 to 5.