Three-dimensional object data processing method and device, equipment and storage medium
By converting two-dimensional space into three-dimensional space and using projection pickup methods, the problem that the modeling tool software cannot identify and place geometry in three-dimensional space is solved, and the ability to identify and place geometry in three-dimensional space is realized, improving modeling The space processing capability of the tool.
Patent Information
- Application Number
- CN202311652020.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2043-12-04
AI Technical Summary
Existing modeling tool software cannot identify objects in three-dimensional space, resulting in the inability to place geometric bodies in three-dimensional space.
By obtaining the orientation of the two-dimensional space and the user-selected position, converting the two-dimensional space into three-dimensional space, and using the preset projection pickup method to identify the user-selected objects in the three-dimensional space, realizing the identification and placement of geometric bodies in the three-dimensional space ability.
This enables the modeling tool software to identify and place geometric bodies in three-dimensional space, solving the problem of not being able to place geometric bodies in three-dimensional space, and improving the spatial processing capabilities of modeling tools.
Smart Images

Figure CN119131227A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of modeling, and in particular to a three-dimensional object data processing method, device, equipment and storage medium. Background Art
[0002] The 3D object data processing method is a key technology in the modeling field. It is used in various modeling tool software to identify objects in space and place geometric bodies on the objects using modeling tool software, which makes the correct identification of objects particularly important.
[0003] In the prior art, modeling tool software can only recognize objects in two-dimensional space and place geometric bodies on objects in two-dimensional space. Since existing modeling tool software cannot recognize objects in three-dimensional space, existing modeling tool software cannot place geometric bodies in three-dimensional space.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a three-dimensional object data processing method, device, equipment and storage medium, aiming to solve the technical problem that existing modeling tool software cannot place geometric bodies in three-dimensional space.
[0006] To achieve the above object, the present application provides a three-dimensional object data processing method, the three-dimensional object data processing method comprising the following steps:
[0007] Get the orientation of the two-dimensional space and the position selected by the user;
[0008] Based on the orientation of the two-dimensional space, converting the two-dimensional space into a three-dimensional space;
[0009] Based on the position selected by the user, a first object selected by the user in the three-dimensional space is identified using a preset projection picking method.
[0010] Optionally, the step of converting the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space includes:
[0011] In the two-dimensional space, a Z axis is added to the direction of the orientation;
[0012] The data of the Z axis is added to the coordinate data of the two-dimensional space so that the two-dimensional space is converted into a three-dimensional space.
[0013] Optionally, the step of identifying the first object selected by the user in the three-dimensional space using a preset projection picking method based on the position selected by the user includes:
[0014] Calculating the source point of the ray based on the position selected by the user;
[0015] Taking the source point of the ray as the starting point, emitting a ray in the direction of the two-dimensional space;
[0016] The first object touched by the ray is calculated using a preset projection picking method, and the object is regarded as the first object selected by the user.
[0017] Optionally, after the step of identifying the first object selected by the user in the three-dimensional space using a preset projection picking method based on the position selected by the user, the method includes:
[0018] Creating a first geometric body based on the first object selected by the user and the ray;
[0019] After receiving the confirmation information from the user, the first geometric body is placed at the current position.
[0020] Optionally, the step of creating a first geometric body based on the first object selected by the user and the ray comprises:
[0021] Based on the first object selected by the user and the ray, reading data of a contact surface between the ray and the first object;
[0022] A first geometric body is created based on the contact point between the ray and the first object as the center, wherein the center coordinates of the first geometric body always coincide with the contact point.
[0023] Optionally, after receiving confirmation information from the user, the step of placing the first geometric body at the current position includes:
[0024] After receiving the user's confirmation information, and based on the first geometric body, a second geometric body is created, wherein the parameters and coordinates of the second geometric body correspond to the first geometric body, so as to perform various operations instead of the first geometric body, and ensure that the first geometric body remains independent after being placed;
[0025] Based on the first object, create a second object, wherein the properties of the second object are the same as those of the second geometric body, and the second object can accommodate a plurality of the second geometric bodies at the same time;
[0026] The second geometric body is merged with the second object, which is regarded as placing the first geometric body at the current position.
[0027] Optionally, the step of merging the second geometric body with the second object is regarded as a step of placing the first geometric body at the current position, comprising:
[0028] Reading coordinate data of the second geometric body and the second object;
[0029] The second geometry is combined with the second object using a Union Boolean operation.
[0030] In addition, to achieve the above-mentioned purpose, the present application also provides a three-dimensional object data processing device, the device comprising:
[0031] An acquisition module, used to acquire the orientation of the two-dimensional space and the position selected by the user;
[0032] A conversion module, configured to convert the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space;
[0033] The recognition module is used to recognize a first object selected by the user in the three-dimensional space by using a preset projection picking method based on the position selected by the user.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a three-dimensional object data processing device, which includes: a memory, a processor, and a three-dimensional object data processing program stored on the memory and executable on the processor, wherein the three-dimensional object data processing program is configured to implement the steps of the three-dimensional object data processing method as described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, on which a three-dimensional object data processing program is stored, and when the three-dimensional object data processing program is executed by a processor, the steps of the three-dimensional object data processing method as described above are implemented.
[0036] The present application provides a three-dimensional object data processing method, apparatus, device and storage medium. Compared with the problem that the existing modeling tool software in the related art cannot recognize objects in three-dimensional space, resulting in the modeling tool software being unable to place geometric bodies in three-dimensional space, the present application obtains the orientation of two-dimensional space and the position selected by the user, and then converts the two-dimensional space into three-dimensional space based on the orientation of the two-dimensional space, and finally recognizes the first object selected by the user in the three-dimensional space based on the position selected by the user using a preset projection picking method. It can be understood that the present application recognizes the object selected by the user in the three-dimensional space (the three-dimensional space is obtained based on the conversion of the two-dimensional space) based on the projection picking method, so that the modeling tool software can recognize the object selected by the user in the three-dimensional space, thereby solving the problem that the modeling tool software cannot place geometric bodies in the three-dimensional space. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a structural diagram of a three-dimensional object data processing device in a hardware operating environment involved in an embodiment of the present application;
[0038] Figure 2This is a flow chart of the first embodiment of the present application;
[0039] Figure 3 A schematic diagram of the bvh number structure using a binary tree structure;
[0040] Figure 4 This is a flow chart of the second embodiment of the present application;
[0041] Figure 5 A result map of a first geometric body created by a three-dimensional object data processing device;
[0042] Figure 6 A result image of merging the second geometric body and the second object;
[0043] Figure 7 placing the first geometric body on the first object and maintaining an independent result graph;
[0044] Figure 8 This is a structural block diagram of an embodiment of a three-dimensional object data processing device of the present application.
[0045] The realization of the purpose, functional features and advantages of this application 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 application and are not used to limit the present application.
[0047] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a three-dimensional object data processing device in the hardware operating environment involved in the embodiment of the present application.
[0048] like Figure 1As shown, the three-dimensional object data processing device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0049] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the three-dimensional object data processing device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0050] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a three-dimensional object data processing program.
[0051] exist Figure 1 In the three-dimensional object data processing device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the three-dimensional object data processing device of the present application can be set in the three-dimensional object data processing device, and the three-dimensional object data processing device calls the three-dimensional object data processing program stored in the memory 1005 through the processor 1001, and executes the three-dimensional object data processing method provided in the embodiment of the present application.
[0052] The first embodiment of the present application provides a three-dimensional object data processing method, referring to Figure 2 , the three-dimensional object data processing method comprises:
[0053] It should be noted that the method execution subject of this embodiment is a three-dimensional object data processing device, which can be a three-dimensional object data processing device or a modeling tool device or other device with three-dimensional object data processing capabilities, and this application does not impose any specific restrictions.
[0054] It should be understood that the computer code of this embodiment is Python language. In specific implementation, the computer code can also use any computer language such as Java or C. This application does not impose specific restrictions. Among them, this embodiment uses Python language only to explain the calculation method of this solution.
[0055] It can be understood that the difference between the present solution and the prior art is that the present solution uses three-dimensional space to process object data. In traditional technology, modeling tool software uses two-dimensional space to process object data. Since objects cannot be rotated arbitrarily in two-dimensional space, the modeling tool software cannot place geometric bodies on any surface or angle of the object. The present solution uses three-dimensional space to process object data. Since the modeling tool software can rotate the processed objects at will when processing object data, the present solution can place geometric bodies on any surface or angle of the object.
[0056] The following is a specific description using a three-dimensional object data processing device as a terminal.
[0057] Step S10: Obtain the orientation of the two-dimensional space and the position selected by the user.
[0058] It is understandable that the position selected by the user should be displayed as coordinate data of a two-dimensional coordinate point in the two-dimensional space, wherein the coordinate data of the two-dimensional coordinate point only includes data of the X-axis and the Y-axis.
[0059] It should be noted that the data of the X-axis and Y-axis are used to characterize the relative position of the coordinate point on the X-axis and Y-axis. The three-dimensional object data processing device can identify the specific position of the coordinate point in the two-dimensional space based on the data of the X-axis and Y-axis.
[0060] It should be understood that the coordinate ruler of the X-axis is used to represent the minimum distance between the coordinate point and the Y-axis, and the coordinate ruler of the Y-axis is used to represent the minimum distance between the coordinate point and the X-axis, wherein the sizes of the coordinate rulers of the X-axis and Y-axis can be manually set as needed.
[0061] For example, if the coordinate scales of the X-axis and Y-axis of the two-dimensional space are both 100:
[0062] The coordinate data of the coordinate point is (X: 50, Y: 50). Since the maximum value of the coordinate ruler of the X axis is 100, the X value of the coordinate data of the coordinate point is 50, which means that the coordinate point is at half of the X axis coordinate ruler, and the coordinate point is at least 50 units away from the Y axis.
[0063] Since the maximum value of the Y-axis coordinate ruler is 100, the Y value of the coordinate data of the coordinate point is 50, which means that the coordinate point is at half of the Y-axis coordinate ruler, and the specific X-axis distance of the coordinate point is at least 50 units;
[0064] In the two-dimensional space, the only coordinate that meets this condition is the point at the center of the two-dimensional space. The three-dimensional object data processing device can therefore infer that the coordinate point is located at the center of the two-dimensional space.
[0065] In a specific implementation, a three-dimensional object data processing device obtains the orientation of the two-dimensional space and the position selected by the user.
[0066] Step S20: based on the orientation of the two-dimensional space, convert the two-dimensional space into a three-dimensional space.
[0067] In a specific implementation, a three-dimensional object data processing device converts the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space.
[0068] It should be understood that the three-dimensional space adds a Z axis on the basis of the X axis and Y axis of the two-dimensional space to characterize distance or depth, wherein the starting points of the scales of the Z axis, X axis and Y axis are the same.
[0069] The step of converting the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space specifically includes:
[0070] Step S21: In the two-dimensional space, add a Z axis to the direction of the orientation.
[0071] In a specific implementation, the three-dimensional object data processing device, based on the two-dimensional space, takes the intersection of the X-axis and the Y-axis in the two-dimensional space as the starting point, and adds a Z-axis in the direction of the two-dimensional space, wherein the scale size of the Z-axis can be manually set as needed.
[0072] Step S22: adding the data of the Z axis to the coordinate data of the two-dimensional space, so that the two-dimensional space is converted into a three-dimensional space.
[0073] In a specific implementation, the three-dimensional object data processing device adds a set of data to the coordinate data of the two-dimensional space, which is used to write the data of the Z axis, so that the two-dimensional space is converted into a three-dimensional space.
[0074] It should be noted that the default value of the added Z-axis data is 0, and the Z-axis data does not affect the original coordinate data in the two-dimensional space when added.
[0075] For example, if the original coordinate data in the two-dimensional space is (X: 50, Y: 50), after adding the default data of the Z axis, the coordinate point data in the three-dimensional space is (X: 50, Y: 50, Z: 0).
[0076] Step S30: Based on the position selected by the user, a preset projection picking method is used to identify a first object selected by the user in the three-dimensional space.
[0077] In a specific implementation, the three-dimensional object data processing device uses a preset projection picking method based on the position selected by the user to identify the first object selected by the user in the three-dimensional space.
[0078] It should be noted that the position selected by the user is a three-dimensional coordinate point after the transformation based on the three-dimensional space, wherein the Z-axis data of the three-dimensional coordinate point should be 0, and the X-axis and Y-axis data are the same as the data of the coordinate point selected by the user in the two-dimensional space.
[0079] The step of identifying the first object selected by the user in the three-dimensional space using a preset projection picking method based on the position selected by the user specifically includes:
[0080] Step S31: Calculate the source point of the ray based on the position selected by the user.
[0081] In a specific implementation, the three-dimensional object data processing device calculates the source point of the ray based on the three-dimensional coordinate data of the position selected by the user.
[0082] The calculation code of the ray source point is as follows:
[0083]
[0084] It should be noted that, in this code, rv3d is the three-dimensional space, area is the two-dimensional space, and coord is the position selected by the user.
[0085] It should be noted that the source point of the ray is emitted from a coordinate point selected by the user in the two-dimensional space, and the Z-axis data of the source point of the ray should be 0.
[0086] Step S32: Taking the source point of the ray as the starting point, a ray is emitted in the direction of the two-dimensional space.
[0087] It should be understood that the direction of the two-dimensional space is the same as the direction corresponding to the Z-axis scale in the three-dimensional space.
[0088] In a specific implementation, the three-dimensional object data processing device takes the source point of the ray as the starting point and emits a ray in the direction of the two-dimensional space.
[0089] The calculation code of the ray direction is as follows:
[0090] viewinv=rv3d.view_matrix.inverted()
[0091] view_vector=-viewinv.col[2].xyz
[0092] view_vector.normalize()
[0093] It should be noted that, in this code, rv3d is the three-dimensional space.
[0094] Step S33: using a preset projection picking method, calculating the first object touched by the ray, and considering the object as the first object selected by the user.
[0095] It should be noted that the preset projection picking method should use the bvh tree structure, wherein the full English name of the bvh tree structure is Bounding Volume Hierarchy, which is translated as a hierarchical bounding volume structure. The bvh tree structure is a method for searching for objects in a three-dimensional scene.
[0096] It should be understood that the bvh tree structure is mainly used for acceleration in the ray tracing algorithm. In order to ensure the image quality of ray tracing, each pixel needs to be sampled thousands of times, which leads to the ray tracing algorithm having very high requirements on the computing power of the computer. Among them, the ray tracing algorithm detects whether the ray emitted from the emission source point into the three-dimensional space intersects with the object in the three-dimensional space. If the intersection is detected, the angle and direction of the reflection or refraction of the ray are calculated according to the parameters of the object, and the ray is tracked until the ray reaches the maximum recursive depth or does not touch any object.
[0097] It should be understood that if the bvh tree structure is not used, each ray must perform intersection detection with all objects (spheres, rectangles or complex geometric bodies) in the three-dimensional scene. Since the shapes of the objects being calculated to intersect are not fixed, the intersection detection scene between the ray and the object is complex and the calculation time is long.
[0098] It can be understood that the bvh tree structure uses a hierarchy to group and surround the objects. Before the ray needs to detect whether it intersects with an object in the three-dimensional space, the ray first detects whether it intersects with the enclosure. If it does not intersect with the enclosure, it means that the ray will never intersect with the object in the enclosure, and it is determined that the ray cannot touch the object in the enclosure. If it intersects with the enclosure, the ray continues to detect whether it intersects with the next level of enclosure until it is detected that it intersects with the object in the lowest level of enclosure.
[0099] It should be noted that the most commonly used Bounding Volume is the axis-aligned minimum boundingbox (AABB method), which is a hierarchical bounding volume that can just surround the object along the coordinate axis direction. Figure 3 As shown, if there are multiple objects in the three-dimensional scene, the bvh tree structure uses a binary tree structure to manage the three-dimensional scene.
[0100] In a specific implementation, the three-dimensional object data processing device uses a preset projection picking method to calculate the first object touched by the ray, and regards the object as the first object selected by the user.
[0101] The code for ray casting picking is as follows:
[0102]
[0103]
[0104] Among them, ray_start_local is the ray source point, and ray_normal_local is the ray direction.
[0105] The present application provides a three-dimensional object data processing method, apparatus, device and storage medium. In this embodiment, compared with the problem that the existing modeling tool software in the related art cannot recognize objects in three-dimensional space, resulting in the modeling tool software being unable to place geometric bodies in three-dimensional space, the present application obtains the orientation of the two-dimensional space and the position selected by the user, and then converts the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space, and finally uses a preset projection picking method based on the position selected by the user to recognize the first object selected by the user in the three-dimensional space. It can be understood that the present application recognizes the object selected by the user in the three-dimensional space (the three-dimensional space is obtained based on the conversion of the two-dimensional space) based on the projection picking method, so that the modeling tool software can recognize the object selected by the user in the three-dimensional space, thereby solving the problem that the modeling tool software cannot place geometric bodies in the three-dimensional space.
[0106] In addition, based on the first embodiment, a second embodiment of the data processing method of the present application is proposed. In this embodiment, referring to Figure 4 After step S30, the process specifically includes steps A10-A20:
[0107] Step A10: Create a first geometric body based on the first object selected by the user and the ray.
[0108] In a specific implementation, a three-dimensional object data processing device creates a first geometric body based on the first object selected by the user and the ray.
[0109] It should be noted that the first geometric body may be a triangle, a rectangle or any irregular shape, wherein if the first geometric body is an irregular shape, the center point of the first geometric body needs to be manually set.
[0110] The step of creating a first geometric body based on the first object selected by the user and the ray specifically includes:
[0111] Step A11: Based on the first object selected by the user and the ray, read data of the contact surface between the ray and the first object.
[0112] In a specific implementation, the three-dimensional object data processing device reads a specific contact surface between the ray and the first object based on the first object selected by the user and the ray, and then reads data of the contact surface.
[0113] It should be understood that if the contact surface is a curve or an arc surface, the contact surface is split into multiple planes, and then the data of the plane where the ray contacts the first object is read.
[0114] Step A12: Create a first geometric body based on the contact point between the ray and the first object as the center, wherein the center coordinates of the first geometric body always coincide with the contact point.
[0115] It should be noted that the first geometric body may be a regular triangle, rectangle or circle, or any irregular shape, and the specific shape may be manually set based on the needs of the user.
[0116] In the specific implementation, Figure 5 As shown, the three-dimensional object data processing device creates a first geometric body based on the contact point between the ray and the first object as the center, wherein the center coordinates of the first geometric body always coincide with the contact point, so that the first geometric body is close to the wall of the first object and can be moved at any time according to the position selected by the user.
[0117] It should be understood that if the first geometric body is an irregular shape and the center coordinates of the first geometric body cannot be found, it is necessary to manually set a coordinate point in the first geometric body and regard the manually set coordinate point as the center coordinates of the first geometric body.
[0118] The calculation code of the first geometric body coordinate data is as follows:
[0119]
[0120] Among them, y is the plane normal, and pt is the three-dimensional coordinate after the two-dimensional space is transformed.
[0121] Step A20: After receiving the user's confirmation information, the first geometric body is placed at the current position.
[0122] In a specific implementation, after receiving confirmation information from the user, the three-dimensional object data processing device fixes the first geometric body at the current position, which is regarded as placing the first geometric body on the wall of the first object.
[0123] It should be noted that the user's confirmation information may be a mouse click signal or a signal for arbitrarily determining the placement of the first geometric body.
[0124] The step of placing the first geometric body at the current position after receiving the confirmation information from the user specifically includes:
[0125] Step A21: After receiving the user's confirmation information, and based on the first geometric body, a second geometric body is created, wherein the parameters and coordinates of the second geometric body correspond to the first geometric body, so as to replace the first geometric body to perform various operations and ensure that the first geometric body remains independent after placement.
[0126] In a specific implementation, after receiving confirmation information from the user, the three-dimensional object data processing device creates a second geometric body based on the first geometric body.
[0127] It should be noted that the second geometric body has the same main mesh structure as the first geometric body but is not filled with color. The second geometric body exists as a subcomponent of the first geometric body, wherein the second geometric body has the same position coordinates, shape constraints and entity parameters as the first geometric body, and performs various operations instead of the first geometric body to ensure that the first geometric body remains independent after placement.
[0128] Step A22: creating a second object based on the first object, wherein the properties of the second object are the same as those of the second geometric body, and the second object can accommodate multiple second geometric bodies at the same time.
[0129] In a specific implementation, a three-dimensional object data processing device creates a second object based on the object data of the first object.
[0130] It should be noted that the function of the second object is similar to that of the second geometric body, and is mainly used to replace the first object to perform various operations to ensure that the first object remains independent.
[0131] It should be understood that the second object can be directly created, wherein the second object does not require the mesh information of the first object, and the creation of the second object is only used to assist the calculation of the first object, and there is no need to create an entity.
[0132] It should be noted that the grid information is a type of the object information, such as the coordinate information of the vertices or faces of the object, which are all the grid information. The function of the grid information is to constrain the object and identify the edge of the object.
[0133] Step A23: Merging the second geometric body with the second object is regarded as placing the first geometric body at the current position.
[0134] In a specific implementation, the three-dimensional object data processing device merges the second geometric body with the second object, and regards the first geometric body as being placed at the current position of the first object.
[0135] It should be understood that if Figure 6 As shown, the merging of the second geometric body and the second object only uses the second geometric body and the second object for calculation, and the first object and the first geometric body still remain independent.
[0136] The step of merging the second geometric body with the second object is regarded as a step of placing the first geometric body at the current position, which specifically includes:
[0137] Step A231: Read the coordinate data of the second geometric body and the second object.
[0138] In a specific implementation, a three-dimensional object data processing device reads coordinate data of the second geometric body and the second object.
[0139] Step A232: Use the union Boolean operation to merge the second geometric body and the second object.
[0140] In a specific implementation, the three-dimensional object data processing device uses a union Boolean operation to merge the second geometric body with the second object.
[0141] It should be noted that if Figure 7As shown, the three-dimensional object data processing device uses a union Boolean operation to merge the second geometric body and the second object, so that the first geometric body is placed on the first object, but the first geometric body and the first object remain independent.
[0142] It should be understood that the steps of the union Boolean operation are as follows:
[0143] 1. Calculate whether the second geometric body overlaps with the second object, wherein the calculation method is to determine whether the bounding boxes of the second geometric body and the second object intersect, or to determine whether the vertices of the second geometric body are in the second object.
[0144] 2. If the second geometric body intersects with the second object, traverse and calculate the intersection of all faces of the second geometric body and the second object. If all faces of the second geometric body intersect with the second object, determine that the face of the second geometric body is a curved surface.
[0145] 3. Add all intersecting surfaces to the second geometric body and the second object.
[0146] 4. Based on the actual operation method, the second geometric body and the second object are clipped, and the vertices and edges are regenerated.
[0147] It should be noted that the actual operation method is divided into union, intersection and difference, among which, union means that the edges and faces of the second geometric body and the second object are the same, then the edges and faces of the second object are directly saved, intersection means that the edges and faces of the second geometric body and the second object intersect, then all the edges and faces of the second geometric body and the second object are saved, and difference means that there is a difference between the edges and faces of the second geometric body and the second object, then in the second object, the common part of the second geometric body and the second object is subtracted.
[0148] It should be understood that the edge surface is used to represent the contact surface between the geometric body and the object.
[0149] In this embodiment, a first geometric body is created based on the first object selected by the user and the ray, and then the first geometric body is placed at the current position after receiving the user's confirmation information, so that the construction tool software can place the geometric body on any surface and at any angle in three-dimensional space.
[0150] In addition, the present application also provides a three-dimensional object data processing device, referring to Figure 8 , the three-dimensional object data processing device comprises:
[0151] An acquisition module 10, used to acquire the orientation of the two-dimensional space and the position selected by the user;
[0152] A conversion module 20, configured to convert the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space;
[0153] The recognition module 30 is used to recognize a first object selected by the user in the three-dimensional space by using a preset projection picking method based on the position selected by the user.
[0154] Optionally, the conversion module 20 includes:
[0155] An adding unit, used for adding a Z axis in the direction of the orientation in the two-dimensional space;
[0156] The conversion unit is used to add Z-axis data to the coordinate data of the two-dimensional space so that the two-dimensional space is converted into a three-dimensional space.
[0157] Optionally, the identification module 30 includes:
[0158] A calculation unit, used for calculating the source point of the ray based on the position selected by the user;
[0159] An emitting unit, configured to emit a ray in a direction of the two-dimensional space with the source point of the ray as a starting point;
[0160] The touch unit is used to calculate the first object touched by the ray using a preset projection picking method, and regard the object as the first object selected by the user.
[0161] Optionally, the three-dimensional object data processing device further includes:
[0162] A creation module, used for creating a first geometric body based on the first object selected by the user and the ray;
[0163] The placement module is used to place the first geometric body at the current position after receiving the confirmation information from the user.
[0164] Optionally, the creation module includes:
[0165] A reading unit, configured to read data of a contact surface between the ray and the first object based on the first object selected by the user and the ray;
[0166] The first creation unit is used to create a first geometric body based on the contact point between the ray and the first object as the center, wherein the center coordinates of the first geometric body always coincide with the contact point.
[0167] Optionally, the placement module includes:
[0168] A second creation unit is used to create a second geometric body based on the first geometric body after receiving confirmation information from the user, wherein the parameters and coordinates of the second geometric body correspond to those of the first geometric body, so as to perform various operations instead of the first geometric body, and ensure that the first geometric body remains independent after being placed;
[0169] a third creating unit, configured to create a second object based on the first object, wherein the second object has the same characteristics as the second geometric body, and the second object can simultaneously accommodate a plurality of the second geometric bodies;
[0170] A merging unit is used to merge the second geometric body with the second object, which is regarded as placing the first geometric body at the current position.
[0171] Optionally, the merging unit further includes:
[0172] A reading subunit, used for reading the coordinate data of the second geometric body and the second object;
[0173] The merging subunit is used to merge the second geometric body and the second object by using a union Boolean operation.
[0174] The specific implementation of the three-dimensional object data processing device of the present application is basically the same as the various embodiments of the three-dimensional object data processing method described above, and will not be repeated here.
[0175] An embodiment of the present application provides a storage medium, and the storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the three-dimensional object data processing methods described above.
[0176] The specific implementation of the storage medium of the present application is basically the same as the above-mentioned embodiments of the three-dimensional object data processing method, and will not be repeated here.
[0177] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0178] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0179] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0180] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A three-dimensional object data processing method, characterized in that: The three-dimensional object data processing method comprises the following steps: Get the orientation of the two-dimensional space and the position selected by the user; Based on the orientation of the two-dimensional space, converting the two-dimensional space into a three-dimensional space; Based on the position selected by the user, a first object selected by the user in the three-dimensional space is identified using a preset projection picking method.
2. The three-dimensional object data processing method according to claim 1, characterized in that: The step of converting the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space includes: In the two-dimensional space, a Z axis is added to the direction of the orientation; The data of the Z axis is added to the coordinate data of the two-dimensional space so that the two-dimensional space is converted into a three-dimensional space.
3. The three-dimensional object data processing method according to claim 1, characterized in that: The step of identifying the first object selected by the user in the three-dimensional space using a preset projection picking method based on the position selected by the user includes: Calculating the source point of the ray based on the position selected by the user; Taking the source point of the ray as the starting point, emitting a ray in the direction of the two-dimensional space; The first object touched by the ray is calculated using a preset projection picking method, and the object is regarded as the first object selected by the user.
4. The three-dimensional object data processing method according to claim 1, characterized in that: After the step of identifying the first object selected by the user in the three-dimensional space using a preset projection picking method based on the position selected by the user, the method includes: Creating a first geometric body based on the first object selected by the user and the ray; After receiving the confirmation information from the user, the first geometric body is placed at the current position.
5. The three-dimensional object data processing method according to claim 4, characterized in that: The step of creating a first geometric body based on the first object selected by the user and the ray comprises: Based on the first object selected by the user and the ray, reading data of a contact surface between the ray and the first object; A first geometric body is created based on the contact point between the ray and the first object as the center, wherein the center coordinates of the first geometric body always coincide with the contact point.
6. The three-dimensional object data processing method according to claim 4, characterized in that: The step of placing the first geometric body at the current position after receiving the confirmation information from the user comprises: After receiving the user's confirmation information, and based on the first geometric body, a second geometric body is created, wherein the parameters and coordinates of the second geometric body correspond to the first geometric body, so as to perform various operations instead of the first geometric body, and ensure that the first geometric body remains independent after being placed; Based on the first object, create a second object, wherein the properties of the second object are the same as those of the second geometric body, and the second object can accommodate a plurality of the second geometric bodies at the same time; The second geometric body is merged with the second object, which is regarded as placing the first geometric body at the current position.
7. The three-dimensional object data processing method according to claim 6, characterized in that: The step of merging the second geometric body with the second object, which is regarded as placing the first geometric body at the current position, comprises: Reading coordinate data of the second geometric body and the second object; The second geometry is combined with the second object using a Union Boolean operation.
8. A three-dimensional object data processing device, characterized in that: The device comprises: An acquisition module, used to acquire the orientation of the two-dimensional space and the position selected by the user; A conversion module, configured to convert the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space; The recognition module is used to recognize a first object selected by the user in the three-dimensional space by using a preset projection picking method based on the position selected by the user.
9. A three-dimensional object data processing device, characterized in that: The device includes: a memory, a processor, and a three-dimensional object data processing program stored in the memory and executable on the processor, wherein the three-dimensional object data processing program is configured to implement the steps of the three-dimensional object data processing method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a three-dimensional object data processing program, which, when executed by a processor, implements the steps of the three-dimensional object data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Target selection method, device, equipment and readable storage medium
CN111381677A
Three-dimensional image editing method and system, storage medium and terminal equipment
CN114764851A
Pickup method, device and equipment of three-dimensional model component and storage medium
CN115272605A
Device and system for volume visualization and interaction in a virtual reality or augmented reality environment
US20210132687A1
