Method and device for modeling on three-dimensional surface and computer readable storage medium

By constructing a reference system and correcting the coordinate axes, the three-dimensional surface is expanded into a two-dimensional surface. The user constructs objects on the two-dimensional surface and projects them onto the three-dimensional surface. This solves the problem of difficult three-dimensional surface modeling operations and achieves simplified operations and improvements. Efficiency effect.

CN118570386AInactive Publication Date: 2024-08-30深圳寿恒建筑设计事务所有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410713840.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure CN118570386A
    Figure CN118570386A
Patent Text Reader

Abstract

The invention discloses a method and equipment for modeling on a three-dimensional surface and a computer readable storage medium. The method comprises the following steps: constructing a reference system on the three-dimensional surface; correcting the direction of the coordinate axis of the three-dimensional surface coordinate system according to the reference system; expanding the three-dimensional surface after the direction correction of the coordinate system to obtain a two-dimensional surface; taking the two-dimensional surface as a reference surface of the three-dimensional surface, and taking the three-dimensional surface as a target surface of the two-dimensional surface; and projecting an object constructed by a user on the two-dimensional surface to the three-dimensional surface to complete modeling of the object on the three-dimensional surface. The method for modeling on the three-dimensional surface has the advantage of reducing the operation difficulty of modeling on the three-dimensional surface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of modeling technology, and in particular to a method, device and computer-readable storage medium for modeling on a three-dimensional surface. Background Art

[0002] In traditional 3D modeling methods, when modeling is required on a 3D surface, operations are usually performed directly on the 3D surface. However, the shape and features of the 3D surface may be difficult to represent and understand intuitively, which makes modeling operations on the 3D surface very difficult and requires strong 3D spatial thinking ability and modeling skills. Summary of the invention

[0003] The embodiment of the present application aims to reduce the difficulty of modeling on a three-dimensional surface by providing a method for modeling on a three-dimensional surface.

[0004] To achieve the above object, an embodiment of the present application provides a method for modeling on a three-dimensional surface, comprising:

[0005] constructing a reference system on the three-dimensional surface;

[0006] Correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system;

[0007] Expanding the three-dimensional surface after the direction correction of the coordinate system to obtain a two-dimensional surface;

[0008] Using the two-dimensional surface as a reference surface for the three-dimensional surface and using the three-dimensional surface as a target surface for the two-dimensional surface;

[0009] The object constructed by the user on the two-dimensional surface is projected onto the three-dimensional surface to complete the modeling of the object on the three-dimensional surface.

[0010] In one embodiment, constructing a reference system on the three-dimensional surface includes:

[0011] Setting a reference point on the three-dimensional surface;

[0012] constructing a reference line based on the reference point and a preset reference axis;

[0013] Generating a projection of the reference line on the three-dimensional surface along the direction of the preset reference axis;

[0014] If the projection is a line projection, the reference system is constructed based on the line projection.

[0015] In one embodiment, constructing the reference system based on the line projection includes:

[0016] A first reference axis of the reference system is constructed according to a tangent line of the line projection at the reference point.

[0017] In one embodiment, constructing the reference system based on the line projection further includes:

[0018] The first reference axis is rotated clockwise by a preset angle around the normal of the tangent plane of the three-dimensional surface at the reference point to construct a second reference axis of the reference system.

[0019] In one embodiment, correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system includes:

[0020] Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis;

[0021] According to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis, the directions of the coordinate axes of the three-dimensional surface coordinate system are adjusted so that the positive direction of the u-axis faces a preset first direction and the positive direction of the v-axis faces a preset second direction.

[0022] In one embodiment, adjusting the direction of the coordinate axis of the three-dimensional surface coordinate system includes:

[0023] Setting the preset first direction as the positive direction of the first reference axis;

[0024] Selecting a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle;

[0025] Selecting a smaller one from the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis as the second angle;

[0026] If the first angle is greater than the second angle, swapping the u-axis and the v-axis;

[0027] If the angle between the u-axis and the positive direction of the first reference axis is greater than a first preset value, the direction of the u-axis is reversed;

[0028] If the angle between the v-axis and the positive direction of the first reference axis is smaller than a second preset value, the direction of the v-axis is reversed.

[0029] In one embodiment, correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system includes:

[0030] Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis;

[0031] According to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis and the second reference axis of the reference system, the directions of the coordinate axes of the three-dimensional surface coordinate system are adjusted so that the positive direction of the u-axis faces the preset first direction and the positive direction of the v-axis faces the preset second direction.

[0032] In one embodiment, adjusting the direction of the coordinate axis of the three-dimensional surface coordinate system includes:

[0033] Setting the preset first direction as the positive direction of the first reference axis, and setting the preset second direction as the positive direction of the second reference axis;

[0034] Selecting a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle;

[0035] Selecting a smaller one from the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis as the second angle;

[0036] If the first angle is greater than the second angle, swapping the u-axis and the v-axis;

[0037] If the angle between the u-axis and the positive direction of the second reference axis is greater than a third preset value, the direction of the u-axis is reversed;

[0038] If the angle between the v-axis and the positive direction of the first reference axis is greater than a fourth preset value, the direction of the v-axis is reversed.

[0039] To achieve the above-mentioned objectives, an embodiment of the present application also proposes a device for modeling on a three-dimensional surface, including a memory, a processor, and a program for modeling on a three-dimensional surface stored in the memory and executable on the processor, wherein when the processor executes the program for modeling on a three-dimensional surface, it implements a method for modeling on a three-dimensional surface as described in any one of the above items.

[0040] To achieve the above objectives, an embodiment of the present application also proposes a computer-readable storage medium, on which a program for modeling on a three-dimensional surface is stored. When the program for modeling on a three-dimensional surface is executed by a processor, a method for modeling on a three-dimensional surface as described in any of the above items is implemented.

[0041] The method of modeling on a three-dimensional surface of the technical solution of the present application unifies the coordinate axis direction of the three-dimensional surface through a reference system, and then unfolds the three-dimensional surface to obtain a two-dimensional surface, and uses the two-dimensional surface as a reference surface and the three-dimensional surface as a target surface. In this way, after the user constructs an object on the two-dimensional surface, the system can project the object onto the three-dimensional surface by projection, obtain the model of the object on the three-dimensional surface, and complete the modeling process. In this way, compared with the traditional modeling method of directly modeling on a three-dimensional curved surface, the method of modeling on a three-dimensional surface of the present application has the advantages of simplified operation, convenient modification, and improved efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0043] Figure 1 A module structure diagram of an embodiment of a device for modeling on a three-dimensional surface according to the present invention;

[0044] Figure 2 It is a schematic flow chart of an embodiment of a method for modeling on a three-dimensional surface according to the present invention.

[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0047] In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0048] It should be noted that in the claims, any reference symbols placed between brackets shall not be constructed as limitations to the claims. The presence of "comprising" in the text does not exclude the presence of components or steps not listed in the claims. The quantifier "one" or "an" preceding a component does not exclude the presence of a plurality of such components. The present invention can be implemented by means of hardware comprising several different components and by means of appropriately programmed computers. In a unit claim that lists several means, several of these means may be embodied by the same hardware item. The use of "first", "second", and "third" etc. does not indicate any order, and these words may be interpreted as names.

[0049] like Figure 1 As shown, Figure 1 It is a schematic diagram of the structure of a server 1 (also called a device modeled on a three-dimensional surface) in the hardware operating environment involved in the embodiment of the present invention.

[0050] The server of the embodiment of the present invention is a device with display function, such as "Internet of Things devices", smart air conditioners, smart lights, smart power supplies with networking functions, AR / VR devices with networking functions, smart speakers, self-driving cars, PCs, smart phones, tablet computers, e-book readers, portable computers, etc.

[0051] like Figure 1 As shown, the server 1 includes: a memory 11, a processor 12 and a network interface 13.

[0052] The memory 11 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the server 1, such as a hard disk of the server 1. In other embodiments, the memory 11 may also be an external storage device of the server 1, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc., equipped on the server 1.

[0053] Furthermore, the memory 11 may also include an internal storage unit of the server 1 and an external storage device. The memory 11 may be used not only to store application software and various data installed on the server 1, such as the code of the program 10 modeled on a three-dimensional surface, but also to temporarily store data that has been output or is to be output.

[0054] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 11, such as executing a program 10 for modeling on a three-dimensional surface.

[0055] The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the server 1 and other electronic devices.

[0056] The network may be the Internet, a cloud network, a wireless fidelity (Wi-Fi) network, a personal area network (PAN), a local area network (LAN), and / or a metropolitan area network (MAN). Various devices in the network environment may be configured to connect to the communication network according to various wired and wireless communication protocols. Examples of such wired and wireless communication protocols may include, but are not limited to, at least one of the following: Transmission Control Protocol and Internet Protocol (TCP / IP), User Datagram Protocol (UDP), Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), ZigBee, EDGE, IEEE 802.11, Light Fidelity (Li-Fi), 802.16, IEEE 802.11s, IEEE 802.11g, multi-hop communication, wireless access point (AP), device-to-device communication, cellular communication protocol, and / or Bluetooth (Blue Tooth) communication protocol or a combination thereof.

[0057] Optionally, the server may further include a user interface, which may include a display, an input unit such as a keyboard, and an optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be referred to as a display screen or a display unit, which is used to display information processed in the server 1 and to display a visual user interface.

[0058] Figure 1 Only the server 1 having components 11-13 and the program 10 modeled on a three-dimensional surface is shown, and it can be understood by those skilled in the art that Figure 1 The structure shown does not constitute a limitation on the server 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0059] In this embodiment, the processor 12 can be used to call the program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0060] constructing a reference system on the three-dimensional surface;

[0061] Correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system;

[0062] Expanding the three-dimensional surface after the direction correction of the coordinate system to obtain a two-dimensional surface;

[0063] Using the two-dimensional surface as a reference surface for the three-dimensional surface and using the three-dimensional surface as a target surface for the two-dimensional surface;

[0064] The object constructed by the user on the two-dimensional surface is projected onto the three-dimensional surface to complete the modeling of the object on the three-dimensional surface.

[0065] In one embodiment, the processor 12 may be used to call a program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0066] Setting a reference point on the three-dimensional surface;

[0067] constructing a reference line based on the reference point and a preset reference axis;

[0068] Generating a projection of the reference line on the three-dimensional surface along the direction of the preset reference axis;

[0069] If the projection is a line projection, the reference system is constructed based on the line projection.

[0070] In one embodiment, the processor 12 may be used to call a program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0071] A first reference axis of the reference system is constructed according to a tangent line of the line projection at the reference point.

[0072] In one embodiment, the processor 12 may be used to call a program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0073] The first reference axis is rotated clockwise by a preset angle around the normal of the tangent plane of the three-dimensional surface at the reference point to construct a second reference axis of the reference system.

[0074] In one embodiment, the processor 12 may be used to call a program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0075] Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis;

[0076] According to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis, the directions of the coordinate axes of the three-dimensional surface coordinate system are adjusted so that the positive direction of the u-axis faces a preset first direction and the positive direction of the v-axis faces a preset second direction.

[0077] In one embodiment, the processor 12 may be used to call a program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0078] Setting the preset first direction as the positive direction of the first reference axis;

[0079] Selecting a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle;

[0080] Selecting a smaller one from the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis as the second angle;

[0081] If the first angle is greater than the second angle, swapping the u-axis and the v-axis;

[0082] If the angle between the u-axis and the positive direction of the first reference axis is greater than a first preset value, the direction of the u-axis is reversed;

[0083] If the angle between the v-axis and the positive direction of the first reference axis is smaller than a second preset value, the direction of the v-axis is reversed.

[0084] In one embodiment, the processor 12 may be used to call a program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0085] Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis;

[0086] According to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis and the second reference axis of the reference system, the directions of the coordinate axes of the three-dimensional surface coordinate system are adjusted so that the positive direction of the u-axis faces the preset first direction and the positive direction of the v-axis faces the preset second direction.

[0087] In one embodiment, the processor 12 may be used to call a program for modeling on a three-dimensional surface stored in the memory 11, and perform the following operations:

[0088] Setting the preset first direction as the positive direction of the first reference axis, and setting the preset second direction as the positive direction of the second reference axis;

[0089] Selecting a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle;

[0090] Selecting a smaller one from the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis as the second angle;

[0091] If the first angle is greater than the second angle, swapping the u-axis and the v-axis;

[0092] If the angle between the u-axis and the positive direction of the second reference axis is greater than a third preset value, the direction of the u-axis is reversed;

[0093] If the angle between the v-axis and the positive direction of the first reference axis is greater than a fourth preset value, the direction of the v-axis is reversed.

[0094] Based on the hardware architecture of the above-mentioned device for modeling on a three-dimensional surface, an embodiment of a method for modeling on a three-dimensional surface of the present invention is proposed. The method for modeling on a three-dimensional surface of the present invention aims to reduce the difficulty of modeling on a three-dimensional surface.

[0095] Reference Figure 2 , Figure 2 This is an embodiment of the method for modeling on a three-dimensional surface of the present invention, and the method for modeling on a three-dimensional surface comprises the following steps:

[0096] S10, constructing a reference system on the three-dimensional surface.

[0097] Among them, a three-dimensional surface refers to a three-dimensional geometric figure with length, width and height in three-dimensional space. It can be flat or curved.

[0098] Specifically, the reference system can be constructed subjectively by the user or by the system based on the shape, type, and other information of the current three-dimensional surface. For example, for a cylinder, its central axis can be used as the Z axis of the reference system, and the circumference of the bottom surface of the cylinder can be used as the XY plane of the reference system.

[0099] S20. Correct the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system.

[0100] Correcting the direction of the coordinate axis means adjusting the direction of each axis in the coordinate system to make it consistent with a specific reference system or standard direction. The purpose of this is to unify the coordinate system of the three-dimensional surface.

[0101] It is worth noting that different coordinate systems may give different coordinate representations for the same point, resulting in the inability to accurately express the coordinate position of the object / model. In order to achieve modeling of objects on a three-dimensional surface, the coordinate position of the object must be accurately expressed, so the coordinate axis direction of the three-dimensional surface coordinate system needs to be corrected to meet expectations.

[0102] Specifically, to correct the direction of the coordinate axes of the three-dimensional surface coordinate system, you can do it based on the following steps:

[0103] 1. Determine the correspondence between the coordinate axes in the 3D surface coordinate system and the reference system. For example, you can specify that the Z axis of the reference system is parallel to the Z axis of the 3D surface coordinate system, and the XY plane of the reference system coincides with the XY plane of the 3D surface coordinate system.

[0104] 2. According to the determined corresponding relationship, the coordinate axes of the three-dimensional surface coordinate system are inverted, swapped, rotated, translated, etc. to adjust the direction of the coordinate axes of the three-dimensional surface coordinate system.

[0105] 3. Update the three-dimensional surface coordinate system: Update the three-dimensional surface coordinate system based on the coordinate axis after the direction adjustment to obtain the desired three-dimensional surface coordinate system.

[0106] S30, unfolding the three-dimensional surface after the direction correction of the coordinate system to obtain a two-dimensional surface.

[0107] Specifically, Rhinocommon (Rhinocommon is a .NET plug-in for Rhino and Grasshopper, which provides a set of APIs (Application Programming Interface) for writing Rhino and Grasshopper plug-ins) can be used to unfold the three-dimensional surface to obtain the required two-dimensional surface.

[0108] Among them, Unroller.PerformUnroll is a method used to flatten a three-dimensional surface or polygonal mesh (such as a polygonal face, polygonal mesh, etc.) into two dimensions.

[0109] Furthermore, the direction of the coordinate axes of the 3D surface coordinate system is kept unchanged during the unrolling process, which means that the relative positions and directions of the u, v, and w axes of the 3D surface coordinate system remain consistent during the unfolding process. In this way, the unfolded 2D surface retains the same coordinate system as the original 3D surface. This makes it possible to directly convert coordinates and dimensions between 2D and 3D surfaces.

[0110] S40: Using the two-dimensional surface as a reference surface for the three-dimensional surface, and using the three-dimensional surface as a target surface for the two-dimensional surface.

[0111] Specifically, when unfolding a 3D surface, the system will retain both the 3D surface that has been calibrated by the coordinate system and the 2D surface that has been unfolded. At this time, the Guid (Globally Unique Identifier) ​​of the 3D surface can be recorded in the userdictionary of the 2D surface to use the 3D surface as the target surface of the 2D surface. At the same time, the Guid of the 2D surface can also be recorded in the userdictionary of the 3D surface to use the 2D surface as the reference surface of the 3D surface.

[0112] Among them, using a two-dimensional surface as a reference surface means treating the two-dimensional surface as a reference for a three-dimensional model. In the modeling process, it is necessary to map the points, lines, surfaces and other elements on the two-dimensional surface into three-dimensional space, and construct a three-dimensional model based on the shape and features of the two-dimensional surface.

[0113] Taking a 3D surface as a target surface means treating the 3D surface as a projection target for a 2D figure or pattern. In the modeling process, it is necessary to project the elements on the 2D surface onto the 3D surface and ensure that the projected elements match the shape and features of the 3D surface.

[0114] After establishing the relationship between the reference surface and the target surface, the system can project objects (graphics, patterns) on the two-dimensional surface onto the three-dimensional surface to create a corresponding three-dimensional model.

[0115] S50: Projecting the object constructed by the user on the two-dimensional surface onto the three-dimensional surface to complete modeling of the object on the three-dimensional surface.

[0116] Specifically, since the two-dimensional surface and the three-dimensional surface record the relationship between the reference surface and the target surface, the SpaceMorph.Morph method in RhinoCommon can be used to project the object onto the three-dimensional surface to obtain the projection result to complete the modeling.

[0117] It is worth adding that in RhinoCommon, the SpaceMorph.Morph method is used to perform space deformation operations on geometric objects. Space deformation is an operation that transforms geometric objects from one space to another, usually used to create deformed or transformed geometric shapes.

[0118] Specifically, the SpaceMorph.Morph method accepts a geometry object to be deformed as an input parameter and returns a new geometry object after the spatial deformation. The type and parameters of the deformation operation depend on the specific SpaceMorph type and settings used. SpaceMorph is a base class in RhinoCommon that defines the basic interface of spatial deformation operations.

[0119] In some embodiments, after obtaining the projection result, the userdictionary on the projection object can be further assigned to the corresponding projection result. At the same time, the Guid of the projection result can also be recorded in the userdictionary of the reference surface B. This facilitates subsequent operations.

[0120] In some embodiments, each time a projection is performed using a three-dimensional surface as a reference surface, the projection object recorded on the three-dimensional surface is deleted first, then SpaceMorph.Morph is executed, and then the data in the userdictionary of the three-dimensional surface is updated.

[0121] It can be seen that, through the modeling method of steps S10 to S50, an object is constructed on a two-dimensional surface constructed based on a three-dimensional surface, and then the object is projected onto the three-dimensional surface, so that the model on the three-dimensional surface can be established. Compared with the traditional method of directly modeling on a three-dimensional surface, this method has the following advantages:

[0122] 1. Simplified operation: Modeling on a two-dimensional plane is more intuitive and easier. Designers can more easily draw and edit the shape and features of the model without having to consider the complexity of the three-dimensional space too much.

[0123] 2. Easy to handle details: 2D representation can present the details of the model more clearly, and designers can control and adjust these details more accurately to ensure the realism and integrity of the model.

[0124] 3. Easy to modify: It is easier to modify on a two-dimensional plane. Designers can easily adjust the shape or features of the model without worrying about affecting other parts.

[0125] 4. Improve efficiency Modeling based on three-dimensional surfaces can improve modeling efficiency, especially for models with complex shapes, which can significantly shorten the time and effort required for modeling.

[0126] It can be understood that the method of modeling on a three-dimensional surface of the technical solution of the present application unifies the coordinate axis direction of the three-dimensional surface through a reference system, and then unfolds the three-dimensional surface to obtain a two-dimensional surface, and uses the two-dimensional surface as a reference surface and the three-dimensional surface as a target surface. In this way, after the user constructs an object on the two-dimensional surface, the system can project the object onto the three-dimensional surface by projection, obtain the model of the object on the three-dimensional surface, and complete the modeling process. In this way, compared with the traditional modeling method of directly modeling on a three-dimensional curved surface, the method of modeling on a three-dimensional surface of the present application has the advantages of simplified operation, convenient modification, and improved efficiency.

[0127] In some embodiments, constructing a reference system on the three-dimensional surface includes:

[0128] S11. Set a reference point on the three-dimensional surface.

[0129] Specifically, the center point of the three-dimensional surface can be specified as the required reference point. In other embodiments, a position that is easy to identify and remember can also be selected as the reference point, such as a reference point or a feature point of the model. Of course, any point on the three-dimensional surface can also be specified as the required reference point.

[0130] S12. Constructing a reference line based on the reference point and a preset reference axis.

[0131] Specifically, the z-axis of the world coordinate system can be selected as the preset reference axis, and then a reference line is constructed based on the z-axis of the world coordinate system and the reference point. Specifically, a line passing through the reference point and parallel to the z-axis of the world coordinate system is made as the reference line.

[0132] Among them, the World Coordinate System (WCS) is a three-dimensional coordinate system that is used to describe the position and orientation of objects in three-dimensional space. The world coordinate system is usually expressed in the form of a Cartesian coordinate system, which consists of three orthogonal axes (X, Y, Z) and an origin.

[0133] Of course, the design of the present application is not limited to this. In other embodiments, other axes may be selected as preset reference axes, such as the x and y axes of the world coordinate system.

[0134] S13. Generate a projection of the reference line on the three-dimensional surface along the direction of the preset reference axis.

[0135] Specifically, the reference line may be projected along the direction of the world coordinate axis z-axis to obtain a projection of the reference line on the three-dimensional surface, wherein the projection type may be a point projection or a line projection.

[0136] S14. If the projection is a line projection, construct the reference system based on the line projection.

[0137] Specifically, if the projection generated in step S13 is a line projection, it means that the three-dimensional surface is a curved surface. In this case, a reference system can be constructed based on the line projection.

[0138] In some embodiments, constructing the reference system based on the line projection includes: constructing a first reference axis of the reference system according to a tangent line of the line projection at the reference point.

[0139] Specifically, we need to determine the tangent direction of the line projection at the reference point. The tangent direction can be obtained in one of two ways:

[0140] 1. Analyze the line segment: If the line projection is a line segment defined by two points, the tangent direction can be obtained by calculating the direction vector between the two points.

[0141] 2. Calculate derivatives: If the line projection is a curve defined by a parametric equation, the tangent direction can be obtained by calculating the derivative of the curve at a reference point.

[0142] Further, based on the tangent direction, a first reference axis of the reference system can be created. In this embodiment, we name the first reference axis the y-axis. At the same time, the reference point is set as the origin of the reference system.

[0143] For example, suppose the line projection is a line segment defined by two points A(1,2,3) and B(4,5,6).

[0144] Then you can follow the steps below to construct the first reference axis:

[0145] 1. Calculate the direction vector between the two points: AB = (4-1, 5-2, 6-3) = (3, 3, 3);

[0146] 2. Normalized direction vector: v = AB / ||AB|| = (1, 1, 1);

[0147] 3. Create the first reference axis: x=v=(1,1,1);

[0148] 4. Set the origin: O=A=(1,2,3).

[0149] In some embodiments, constructing the reference system based on the line projection further includes: rotating the first reference axis clockwise by a preset angle around the normal of the tangent plane of the three-dimensional surface at the reference point to construct a second reference axis of the reference system.

[0150] Specifically, the second reference axis can be constructed based on the following steps:

[0151] 1. Calculate the section normal: The section normal can be obtained by the following methods:

[0152] Three-point method based on points and direction vectors: For a plane defined by a point A and a direction vector d, its normal vector n can be calculated by the following formula:

[0153] n=d / ||d||; wherein point A is a reference point, and direction vector d is obtained by the direction vector of the first reference axis or the direction vector of the tangent line of the line projection.

[0154] 2. Rotate the first reference axis: Rotate the first reference axis clockwise around the normal of the section by a preset angle. The rotation angle can be defined in the following ways:

[0155] Fixed angle: You can directly specify a fixed angle, such as 90 degrees or 180 degrees.

[0156] Parameterized: The rotation angle can be defined using parameters, for example to dynamically adjust based on model parameters or user input.

[0157] Optionally, the preset angle is set to be greater than 0 degrees and not greater than π (i.e., 180 degrees). This design is because if the preset angle is less than 0 degrees or greater than π, the constructed reference system will be incomplete or not conform to the right-hand screw rule. In addition, in three-dimensional space, an orthogonal coordinate system is a common way to describe position and direction. By limiting the preset angle to between 0 degrees and π, it can be ensured that the constructed reference system is orthogonal, thereby facilitating subsequent calculations and operations.

[0158] 3. Create a second reference axis: Use the rotated first reference axis as the second reference axis of the reference system. In this embodiment, we usually name the second reference axis as the x-axis.

[0159] In some embodiments, constructing the reference system based on the line projection further includes: generating a third reference axis of the reference system according to a normal of a section of the three-dimensional surface at a reference point.

[0160] Specifically, the third reference axis can be constructed based on the following steps:

[0161] 1. Calculate the section normal: The section normal can be obtained by the following methods:

[0162] Three-point method based on points and direction vectors: For a plane defined by a point A and a direction vector d, its normal vector n can be calculated by the following formula:

[0163] n=d / ||d||; wherein point A is a reference point, and direction vector d is obtained by the direction vector of the first reference axis or the direction vector of the tangent line of the line projection.

[0164] 2. Determine the direction of the third reference axis: The direction of the third reference axis is usually orthogonal to the first reference axis and the second reference axis, and perpendicular to the three-dimensional surface. Therefore, the direction of the third reference axis can be defined as:

[0165] z=n×x, where n is the normal of the tangent plane of the three-dimensional surface at the reference point, and x is the second reference axis of the reference system.

[0166] 3. Create a third reference axis: Based on the direction of the third reference axis, create a third reference axis of the reference system. In this embodiment, we name the third reference axis as the z-axis.

[0167] When the projection of the reference line is a line projection, we can construct the three coordinate axes of the reference system based on the line projection based on the solution provided in the above embodiment.

[0168] In some embodiments, if the projection generated in step S13 is a point projection, it means that the three-dimensional surface is a plane, and in this case, a coordinate system can be constructed based on the world coordinate system. Specifically, the reference point is used as the origin, the x-axis of the world coordinate system is used as the x-axis of the reference system, the y-axis of the world coordinate system is used as the y-axis of the reference system, and the z-axis of the world coordinate system is used as the z-axis of the reference system.

[0169] In some embodiments, correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system includes:

[0170] S110. Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis.

[0171] Specifically, step S110 aims to establish the coordinate system of the three-dimensional surface itself and use the reference point as the origin of the coordinate system. The specific steps are as follows:

[0172] 1. Define the coordinate axes: First, you need to define the two coordinate axes of the three-dimensional surface coordinate system, usually named u-axis and v-axis. These two axes can be determined according to the shape and characteristics of the three-dimensional surface. For example, for a plane, the u-axis and v-axis can be defined as two perpendicular directions of the plane; for a curved surface, the u-axis and v-axis can be defined as two parametric curves on the curved surface.

[0173] 2. Determine the direction of the coordinate axis: Next, you need to determine the direction of the u-axis and the v-axis. This can be done by analyzing the shape and characteristics of the three-dimensional surface. For example, for a plane, the directions of the u-axis and the v-axis can be defined as the two perpendicular directions of the plane; for a curved surface, the directions of the u-axis and the v-axis can be defined as the tangent directions of the two parametric curves on the curved surface.

[0174] 3. Establish the coordinate system: Finally, establish the three-dimensional surface coordinate system with the reference point as the origin and the u-axis and v-axis as the coordinate axes. The coordinate system can be expressed as:

[0175] M=[u1,u2,u3]

[0176] [v1,v2,v3];

[0177] Among them, u1, u2, u3 are the direction vectors of the u-axis, and v1, v2, v3 are the direction vectors of the v-axis.

[0178] Furthermore, the coordinate system of the three-dimensional surface also includes a w-axis, which is parallel to and in the same direction as the third reference axis of the reference system (ie, the z-axis of the reference system). The w-axis is used to express the coordinates in the height direction of the three-dimensional surface.

[0179] S120. Adjust the directions of the coordinate axes of the three-dimensional surface coordinate system according to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis, so that the positive direction of the u-axis faces a preset first direction and the positive direction of the v-axis faces a preset second direction.

[0180] Step S120 is intended to adjust the coordinate axis direction of the three-dimensional surface coordinate system to keep it consistent with the reference system. In some embodiments, the specific steps of step S120 are as follows:

[0181] S121. Set the preset first direction as the positive direction of the first reference axis.

[0182] Specifically, the preset first direction is set as the positive direction of the first reference axis of the reference system. In this embodiment, the preset first direction is the positive direction of the y-axis of the world coordinate system, that is, the side of the first reference axis from the reference point toward the positive direction of the y-axis of the world coordinate system is the positive direction of the first reference axis.

[0183] S122: Select a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle.

[0184] Specifically, the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis are calculated respectively, and then the two angles are compared to obtain a relatively small angle as the required first angle. The size of the angle reflects the deviation angle between the two directions, and the smaller the angle, the smaller the deviation between the two directions.

[0185] Specifically, the first angle can be calculated based on the following steps:

[0186] 1. Get relevant vectors: First, you need to get the following vectors:

[0187] u-axis direction vector: denoted as u, indicating the direction of the u-axis;

[0188] The direction vector of the first reference axis of the reference system: denoted by r.

[0189] 2. Calculate the angle: Use the vector dot product and the arc cosine function to calculate the angle between the u-axis and the first reference axis of the reference system. The calculation formula is as follows:

[0190] cosθ=u·r / ||u||||r||;

[0191] Among them, θ represents the angle, · represents the vector dot product operation, ||u|| and ||r|| represent the length of the u-axis and the first reference axis of the reference system respectively (usually the standard length).

[0192] 3. Distinguish positive and negative angles: Since the vector dot product can return positive and negative values, it is necessary to distinguish the positive and negative angles according to the actual situation. In general, the angle between the u-axis and the first reference axis of the reference system should be non-negative. If the calculated result is a negative value, it needs to be converted to a positive value.

[0193] 4. Calculate the first angle: Calculate the positive and negative angles between the u-axis and the first reference axis of the reference system, respectively, and record them as θ_u_pos and θ_u_neg; where θ_u_pos represents the angle between the u-axis and the first reference axis of the reference system in the positive direction; θ_u_neg represents the angle between the u-axis and the first reference axis of the reference system in the negative direction. Then, select the smaller one from the angles between the u-axis and its positive and negative directions as the angle between the axis and the first reference axis of the reference system, and record it as the first angle θ_1, where θ_1 = min(θ_u_pos,θ_u_neg).

[0194] S123, selecting a smaller one from among an angle between the v-axis and the positive direction of the first reference axis and an angle between the v-axis and the negative direction of the first reference axis as a second angle.

[0195] Specifically, the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis are calculated respectively, and then the two angles are compared to obtain a relatively small angle as the required second angle. The size of the angle reflects the deviation angle between the two directions, and the smaller the angle, the smaller the deviation between the two directions.

[0196] Specifically, the second angle can be calculated based on the following steps:

[0197] 1. Get relevant vectors: First, you need to get the following vectors:

[0198] v-axis direction vector: denoted as v, indicating the direction of the v-axis;

[0199] The direction vector of the first reference axis of the reference system: denoted by r.

[0200] 2. Calculate the angle: Use the vector dot product and the arc cosine function to calculate the angle between the u-axis and the first reference axis of the reference system. The calculation formula is as follows:

[0201] cosθ=v·r / ||v||||r||;

[0202] Among them, θ represents the angle, · represents the vector dot product operation, ||v|| and ||r|| represent the length of the v-axis and the first reference axis of the reference system respectively (usually the standard length).

[0203] 3. Distinguish positive and negative angles: Since the vector dot product can return positive and negative values, it is necessary to distinguish the positive and negative angles according to the actual situation. In general, the angle between the v-axis and the first reference axis of the reference system should be non-negative. If the calculated result is a negative value, it needs to be converted to a positive value.

[0204] 4. Calculate the first angle: Calculate the positive and negative angles between the v-axis and the first reference axis of the reference system, respectively, and record them as θ_v_pos and θ_v_neg; where θ_v_pos represents the angle between the v-axis and the first reference axis of the reference system in the positive direction; θ_v_neg represents the angle between the v-axis and the first reference axis of the reference system in the negative direction. Then, select the smaller one from the angles between the v-axis and its positive and negative directions as the angle between the axis and the first reference axis of the reference system, and record it as the second angle θ_2, where θ_2 = min(θ_v_pos,θ_v_neg).

[0205] S124: If the first angle is greater than the second angle, swap the u-axis and the v-axis.

[0206] Specifically, compare the first angle and the second angle. If the first angle is greater than the second angle, swap the u-axis and the v-axis. This operation ensures that the degree of deviation of the u-axis and the v-axis from the first reference axis is as small as possible, and maintains the directional relationship between the two. In three-dimensional space, the degree of deviation between two directions depends not only on the size of the angle, but also on the positive and negative nature of the angle. By comparing the first angle and the second angle, it can be ensured that the deviation direction between the u-axis and the v-axis and the first reference axis is consistent, so that the orientation of the three-dimensional surface coordinate system is more in line with the preset requirements.

[0207] S125. If the angle between the u-axis and the positive direction of the first reference axis is greater than a first preset value, reverse the direction of the u-axis.

[0208] Specifically, it is determined whether the angle between the u-axis and the positive direction of the first reference axis is greater than a first preset value. The angle can be calculated by vector dot product and inverse cosine function. If it is greater than the first preset value, the direction of the u-axis is reversed. Otherwise, the current direction of the u-axis is maintained. Reversing the direction of the u-axis means changing the direction of the u-axis to the opposite direction. This operation makes the direction of the u-axis more in line with the preset requirements and avoids a large deviation between the u-axis and the first reference axis.

[0209] The first preset value is a threshold value, which is used to limit the maximum deviation between the u-axis and the positive direction of the first reference axis.

[0210] Optionally, the first preset value is set to π / 2 (i.e., 90 degrees). π / 2 represents a right angle, and setting the first preset value to π / 2 means that the maximum deviation angle between the u-axis and the first reference axis of the reference system is 90 degrees. In other words, the angle between the u-axis and the first reference axis of the reference system must be less than or equal to 90 degrees. This setting means that the direction difference between the u-axis and the first reference axis of the reference system will not be too large. This is conducive to maintaining the directional consistency between the three-dimensional surface coordinate system and the reference system, and avoiding the situation where the u-axis and the first reference axis of the reference system are completely opposite in direction.

[0211] S126. If the angle between the v-axis and the positive direction of the first reference axis is greater than a second preset value, reverse the direction of the v-axis.

[0212] Specifically, it is determined whether the angle between the v-axis and the positive direction of the first reference axis is greater than a second preset value. The angle can be calculated by vector dot product and inverse cosine function. If it is greater than the second preset value, the direction of the v-axis is reversed. Otherwise, the current direction of the v-axis is maintained. Reversing the direction of the v-axis means changing the direction of the v-axis to the opposite direction. This operation makes the direction of the v-axis more in line with the preset requirements and avoids a large deviation between the v-axis and the first reference axis.

[0213] The second preset value is a threshold value, which is used to limit the maximum deviation between the u-axis and the positive direction of the first reference axis.

[0214] Optionally, the first preset value is set to π / 2 (i.e., 90 degrees). π / 2 represents a right angle, and setting the second preset value to π / 2 means that the maximum deviation angle between the v-axis and the first reference axis of the reference system is 90 degrees. In other words, the angle between the v-axis and the first reference axis of the reference system must be less than or equal to 90 degrees. This setting means that the direction difference between the v-axis and the first reference axis of the reference system will not be too large. This is conducive to maintaining the directional consistency between the three-dimensional surface coordinate system and the reference system, and avoiding the situation where the v-axis is in completely opposite directions to the first reference axis of the reference system.

[0215] In some embodiments, correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system includes:

[0216] S210. Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis.

[0217] Specifically, reference may be made to step S110 in the above embodiment for step S210, which will not be described in detail here.

[0218] S220. Adjust the directions of the coordinate axes of the three-dimensional surface coordinate system according to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis and the second reference axis of the reference system, so that the positive direction of the u-axis faces the preset first direction and the positive direction of the v-axis faces the preset second direction.

[0219] Step S220 is intended to adjust the coordinate axis direction of the three-dimensional surface coordinate system to make it consistent with the reference system. In some embodiments, the specific steps of step S220 are as follows:

[0220] S221. Set the preset first direction as the positive direction of the first reference axis, and set the preset second direction as the positive direction of the second reference axis.

[0221] Specifically, the preset first direction is set as the positive direction of the first reference axis of the reference system, and the preset second direction is set as the positive direction of the second reference axis of the reference system, so as to determine the directions of the first reference axis and the second reference axis in the reference system. The preset first direction and the preset second direction are respectively used to determine the orientations of the u-axis and the v-axis of the three-dimensional surface coordinate system. In this embodiment, the preset first direction is the positive direction of the y-axis of the world coordinate system, and the preset second direction is the positive direction of the x-axis of the world coordinate system. That is to say, the side of the first reference axis from the reference point toward the positive direction of the y-axis of the world coordinate system is the positive direction of the first reference axis, and the side of the second reference axis from the reference point toward the positive direction of the x-axis of the world coordinate system is the positive direction of the second reference axis.

[0222] S222, selecting a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle;

[0223] S223, selecting a smaller one from the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis as the second angle;

[0224] S224: If the first angle is greater than the second angle, swap the u-axis and the v-axis.

[0225] Specifically, the specific steps of step S222 to step S224 can refer to step S122 to step S124 of the above embodiment, and will not be repeated here.

[0226] S225: If the angle between the u-axis and the positive direction of the second reference axis is greater than a third preset value, reverse the direction of the u-axis.

[0227] Specifically, determine whether the angle between the u-axis and the positive direction of the second reference axis is greater than a third preset value. The angle can be calculated by vector dot product and inverse cosine function. If it is greater than the third preset value, the direction of the u-axis is reversed. Otherwise, the current direction of the u-axis is maintained. Reversing the direction of the u-axis means changing the direction of the u-axis to the opposite direction. This operation makes the direction of the u-axis more in line with the preset requirements and avoids a large deviation between the u-axis and the second reference axis.

[0228] The third preset value is a threshold value, which is used to limit the maximum deviation between the u-axis and the positive direction of the second reference axis.

[0229] Optionally, the third preset value is set to π / 2 (i.e., 90 degrees). π / 2 represents a right angle, and setting the third preset value to π / 2 means that the maximum deviation angle between the u-axis and the second reference axis of the reference system is 90 degrees. In other words, the angle between the u-axis and the second reference axis of the reference system must be less than or equal to 90 degrees. This setting means that the direction difference between the u-axis and the second reference axis of the reference system will not be too large. This is conducive to maintaining the consistency of direction between the three-dimensional surface coordinate system and the reference system, and avoiding the situation where the u-axis and the second reference axis of the reference system are in completely opposite directions.

[0230] S226: If the angle between the v-axis and the positive direction of the first reference axis is greater than a fourth preset value, reverse the direction of the v-axis.

[0231] Specifically, determine whether the angle between the v-axis and the positive direction of the first reference axis is greater than a fourth preset value. The angle can be calculated by vector dot product and inverse cosine function. If it is greater than the fourth preset value, the v-axis direction is reversed. Otherwise, the current direction of the v-axis is maintained. Reversing the v-axis direction means changing the direction of the v-axis to the opposite direction. This operation makes the direction of the v-axis more in line with the preset requirements and avoids a large deviation between the v-axis and the first reference axis.

[0232] The fourth preset value is a threshold value, which is used to limit the maximum deviation between the u-axis and the positive direction of the first reference axis.

[0233] Optionally, the fourth preset threshold is set to π / 2 (i.e., 90 degrees). π / 2 represents a right angle, and setting the fourth preset value to π / 2 means that the maximum deviation angle between the v-axis and the first reference axis of the reference system is 90 degrees. In other words, the angle between the v-axis and the first reference axis of the reference system must be less than or equal to 90 degrees. This setting means that the direction difference between the v-axis and the first reference axis of the reference system will not be too large. This is conducive to maintaining the consistency of direction between the three-dimensional surface coordinate system and the reference system, and avoiding the situation where the v-axis is in completely opposite directions to the first reference axis of the reference system.

[0234] Compared with step S121 to step S126, step S221 to step S226 introduces a second reference axis to adjust the directions of the u-axis and the v-axis of the three-dimensional surface coordinate system. This arrangement has the following advantages:

[0235] 1. Improve the flexibility of direction control: When only the first reference axis is used to adjust the direction, the directions of the u-axis and the v-axis can only be adjusted according to the first reference axis, which may limit the directional freedom of the 3D surface coordinate system. After the introduction of the second reference axis, the directions of the u-axis and the v-axis can be adjusted according to the first reference axis and the second reference axis respectively, which makes the direction control more flexible and can better meet the needs of 3D surface modeling.

[0236] 2. Enhance the matching degree between the 3D surface coordinate system and the reference system: In some cases, adjusting the direction using only the first reference axis may not make the 3D surface coordinate system and the reference system completely match, such as when the 3D surface and the reference system are tilted or rotated. After introducing the second reference axis, the appropriate first reference axis and second reference axis can be selected according to the specific relationship between the 3D surface and the reference system, so that the 3D surface coordinate system and the reference system are more matched, and the accuracy of 3D surface modeling is improved.

[0237] 3. Simplify the 3D surface coordinate system adjustment process: In some cases, it may take multiple iterations to find the appropriate u-axis and v-axis directions when adjusting the direction using only the first reference axis. After the second reference axis is introduced, the directions of the u-axis and v-axis can be directly determined based on the relationship between the first reference axis and the second reference axis, thereby simplifying the 3D surface coordinate system adjustment process and improving efficiency.

[0238] Of course, compared to step S221 to step S226, the embodiment provided by step S121 to step S126 can use only the first reference axis to adjust the directions of the u-axis and the v-axis of the three-dimensional surface coordinate system, and the operation steps are relatively simple, easy to understand and implement. In addition, when only the first reference axis is used to meet the direction adjustment requirements, there is no need to introduce a second reference axis to increase the calculation complexity, which helps to improve the calculation efficiency.

[0239] It is understandable that when selecting a 3D surface coordinate system orientation adjustment scheme, the specific requirements and limitations of the 3D surface modeling scenario should be comprehensively considered. If the orientation control requirements are not high or the relationship between the 3D surface and the reference system is relatively simple, the steps S121 to S126 can be selected; if the orientation control requirements are high or there is a tilt or rotation between the 3D surface and the reference system, the steps S221 to S226 can be selected.

[0240] In addition, the embodiment of the present invention further proposes a computer-readable storage medium, which may be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, etc. The computer-readable storage medium includes a program 10 for modeling on a three-dimensional surface. The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the method for modeling on a three-dimensional surface and the server 1 described above, and will not be repeated here.

[0241] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0242] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0243] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0244] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0245] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0246] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for modeling on a three-dimensional surface, characterized in that: include: constructing a reference system on the three-dimensional surface; Correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system; Expanding the three-dimensional surface after the direction correction of the coordinate system to obtain a two-dimensional surface; Using the two-dimensional surface as a reference surface for the three-dimensional surface and using the three-dimensional surface as a target surface for the two-dimensional surface; The object constructed by the user on the two-dimensional surface is projected onto the three-dimensional surface to complete the modeling of the object on the three-dimensional surface.

2. The method for modeling on a three-dimensional surface according to claim 1, characterized in that: A reference system is constructed on the three-dimensional surface, including: Setting a reference point on the three-dimensional surface; constructing a reference line based on the reference point and a preset reference axis; Generating a projection of the reference line on the three-dimensional surface along the direction of the preset reference axis; If the projection is a line projection, the reference system is constructed based on the line projection.

3. The method for modeling on a three-dimensional surface as claimed in claim 2, characterized in that: Constructing the reference system based on the line projection includes: A first reference axis of the reference system is constructed according to a tangent line of the line projection at the reference point.

4. The method for modeling on a three-dimensional surface as claimed in claim 3, characterized in that: Constructing the reference system based on the line projection also includes: The first reference axis is rotated clockwise by a preset angle around the normal of the tangent plane of the three-dimensional surface at the reference point to construct a second reference axis of the reference system.

5. The method for modeling on a three-dimensional surface as claimed in claim 3 or 4, characterized in that: Correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system includes: Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis; According to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis, the directions of the coordinate axes of the three-dimensional surface coordinate system are adjusted so that the positive direction of the u-axis faces a preset first direction and the positive direction of the v-axis faces a preset second direction.

6. The method for modeling on a three-dimensional surface as claimed in claim 5, characterized in that: Adjust the direction of the coordinate axes of the 3D surface coordinate system, including: Setting the preset first direction as the positive direction of the first reference axis; Selecting a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle; Selecting a smaller one from the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis as the second angle; If the first angle is greater than the second angle, swapping the u-axis and the v-axis; If the angle between the u-axis and the positive direction of the first reference axis is greater than a first preset value, the direction of the u-axis is reversed; If the angle between the v-axis and the positive direction of the first reference axis is smaller than a second preset value, the direction of the v-axis is reversed.

7. The method for modeling on a three-dimensional surface as claimed in claim 4, characterized in that: Correcting the directions of the coordinate axes of the three-dimensional surface coordinate system according to the reference system includes: Generate a coordinate system of a three-dimensional surface with the reference point as the origin, wherein the coordinate system of the three-dimensional surface includes a u-axis and a v-axis; According to the angles between the u-axis and the v-axis of the three-dimensional surface coordinate system and the first reference axis and the second reference axis of the reference system, the directions of the coordinate axes of the three-dimensional surface coordinate system are adjusted so that the positive direction of the u-axis faces the preset first direction and the positive direction of the v-axis faces the preset second direction.

8. The method for modeling on a three-dimensional surface as claimed in claim 7, characterized in that: Adjust the direction of the coordinate axes of the 3D surface coordinate system, including: Setting the preset first direction as the positive direction of the first reference axis, and setting the preset second direction as the positive direction of the second reference axis; Selecting a smaller one from the angle between the u-axis and the positive direction of the first reference axis and the angle between the u-axis and the negative direction of the first reference axis as the first angle; Selecting a smaller one from the angle between the v-axis and the positive direction of the first reference axis and the angle between the v-axis and the negative direction of the first reference axis as the second angle; If the first angle is greater than the second angle, swapping the u-axis and the v-axis; If the angle between the u-axis and the positive direction of the second reference axis is greater than a third preset value, the direction of the u-axis is reversed; If the angle between the v-axis and the positive direction of the first reference axis is greater than a fourth preset value, the direction of the v-axis is reversed.

9. A device for modeling on a three-dimensional surface, characterized in that: The invention comprises a memory, a processor and a program for modeling on a three-dimensional surface which is stored in the memory and can be run on the processor. When the processor executes the program for modeling on a three-dimensional surface, the method for modeling on a three-dimensional surface as described in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for modeling on a three-dimensional surface, and when the program for modeling on a three-dimensional surface is executed by a processor, the method for modeling on a three-dimensional surface as described in any one of claims 1-8 is implemented.