Three-dimensional object data processing method, device, equipment and storage medium

By converting two-dimensional space into three-dimensional space and using projection picking method to identify objects, the problem that modeling software tools cannot place geometry in three-dimensional space is solved, realizing the ability to freely rotate and place geometry in three-dimensional space.

CN119131227BActive Publication Date: 2026-03-24叁农数据(广州)有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-04
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing modeling software tools cannot recognize objects in three-dimensional space, making it impossible to place geometry in three-dimensional space.

Method used

By acquiring the orientation of the two-dimensional space and the position selected by the user, the two-dimensional space is converted into a three-dimensional space, and objects in the three-dimensional space are identified using a preset projection picking method. The specific steps include adding a Z-axis, calculating the ray source point, emitting rays, and using a BVH tree structure for object recognition.

Benefits of technology

It enables the recognition of user-selected objects in 3D space, solving the problem that modeling software cannot place geometry in 3D space, allowing modeling software to freely rotate and place geometry in 3D space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131227B_ABST
    Figure CN119131227B_ABST
Patent Text Reader

Abstract

The application discloses a three-dimensional object data processing method, device and equipment and a storage medium, and belongs to the modeling technical field. The application obtains the orientation of a two-dimensional space and a position selected by a user, converts the two-dimensional space into a three-dimensional space based on the orientation of the two-dimensional space, and finally identifies 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. The application can make the modeling tool software identify the object selected by the user in the three-dimensional space based on the projection picking method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of modeling, and in particular to methods, apparatus, devices and storage media for processing three-dimensional object data. Background Technology

[0002] Three-dimensional object data processing methods are a key technology in the field of modeling. Various modeling software tools use three-dimensional object data processing methods to identify objects in space and place geometry on the objects. This makes the accurate identification of objects particularly important.

[0003] In existing technologies, modeling software tools can only identify objects in two-dimensional space and place geometry on the objects in two-dimensional space. Because existing modeling software tools cannot identify objects in three-dimensional space, they cannot place geometry in three-dimensional space.

[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, device, and storage medium for processing three-dimensional object data, aiming to solve the technical problem that existing modeling software tools cannot place geometric objects in three-dimensional space.

[0006] To achieve the above objectives, this application provides a three-dimensional object data processing method, which includes the following steps:

[0007] Obtain the orientation in two-dimensional space and the location selected by the user;

[0008] Based on the orientation of the two-dimensional space, the two-dimensional space is converted into a three-dimensional space;

[0009] Based on the user-selected location, a preset projection picking method is used to identify the first object selected by the user in three-dimensional space.

[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, add a Z-axis in the direction of orientation;

[0012] Adding Z-axis data to the coordinate data in the two-dimensional space transforms the two-dimensional space into a three-dimensional space.

[0013] Optionally, the step of identifying the first object selected by the user in three-dimensional space using a preset projection picking method based on the user-selected location includes:

[0014] Calculate the source point of the ray based on the location selected by the user;

[0015] Starting from the source point of the ray, a ray is emitted in the direction that the two-dimensional space is facing;

[0016] Using a preset projection picking method, the first object touched by the ray is calculated and regarded as the first object selected by the user.

[0017] Optionally, after the step of identifying the first object selected by the user in three-dimensional space using a preset projection picking method based on the user-selected location, the method includes:

[0018] Based on the first object selected by the user and the ray, a first geometry is created;

[0019] After receiving confirmation from the user, the first geometry is placed at the current position.

[0020] Optionally, the step of creating the first geometry based on the user-selected first object and the ray includes:

[0021] Based on the first object selected by the user and the ray, read the data of the contact surface between the ray and the first object;

[0022] A first geometric shape is created centered on the point of contact between the ray and the first object, wherein the center coordinates of the first geometric shape always coincide with the point of contact.

[0023] Optionally, the step of placing the first geometry at the current position after receiving confirmation from the user includes:

[0024] After receiving the user's confirmation information, and based on the first geometry, a second geometry is created, wherein the parameters and coordinates of the second geometry correspond to those of the first geometry, in order to replace the first geometry in performing various calculations, ensuring that the first geometry remains independent after placement;

[0025] Based on the first object, a second object is created, wherein the characteristics of the second object are the same as those of the second geometry, and the second object can simultaneously contain multiple second geometries;

[0026] Merging the second geometry with the second object is considered as placing the first geometry at the current position.

[0027] Optionally, the step of merging the second geometry with the second object, which is considered as placing the first geometry at the current position, includes:

[0028] Read the coordinate data of the second geometric shape and the second object;

[0029] Use the union Boolean operation to merge the second geometry and the second object.

[0030] Furthermore, to achieve the above objectives, this application also provides a three-dimensional object data processing apparatus, the apparatus comprising:

[0031] The acquisition module is used to acquire the orientation in two-dimensional space and the position selected by the user;

[0032] A conversion module is used 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 identify the first object selected by the user in three-dimensional space based on the user-selected location using a preset projection picking method.

[0034] In addition, to achieve the above objectives, this application also provides a three-dimensional object data processing device, the device comprising: a memory, a processor, and a three-dimensional object data processing program stored in the memory and executable on the processor, the three-dimensional object data processing program being configured to implement the steps of the three-dimensional object data processing method as described above.

[0035] In addition, to achieve the above objectives, this application also provides a storage medium storing a three-dimensional object data processing program, which, when executed by a processor, implements the steps of the three-dimensional object data processing method described above.

[0036] This application provides a method, apparatus, device, and storage medium for processing three-dimensional object data. Compared with existing modeling software in related technologies, which cannot recognize objects in three-dimensional space, thus preventing the modeling software from placing geometric objects in three-dimensional space, this application obtains the orientation of two-dimensional space and the position selected by the user, then converts the two-dimensional space into three-dimensional space based on the orientation, and finally uses a preset projection picking method to identify the first object selected by the user in three-dimensional space based on the position selected by the user. It can be understood that this application identifies the object selected by the user in three-dimensional space (which is obtained by converting from two-dimensional space) based on the projection picking method, enabling the modeling software to recognize the object selected by the user in three-dimensional space, thus solving the problem that the modeling software cannot place geometric objects in three-dimensional space. Attached Figure Description

[0037] 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 embodiments of this application;

[0038] Figure 2This is a flowchart illustrating the first embodiment of this application;

[0039] Figure 3 This is a schematic diagram of the BVH number structure using a binary tree;

[0040] Figure 4 This is a flowchart illustrating the second embodiment of this application;

[0041] Figure 5 The resulting image of the first geometry created for a 3D object data processing device;

[0042] Figure 6 This is a diagram showing the combined result of the second geometric shape and the second object;

[0043] Figure 7 The first geometry is placed on the first object, and the resulting image remains independent;

[0044] Figure 8 This is a structural block diagram of an embodiment of the three-dimensional object data processing device of this application.

[0045] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0046] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this 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 embodiments of this 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. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0049] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the three-dimensional object data processing device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0050] like Figure 1 As shown, the memory 1005, which serves 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 illustrated three-dimensional object data processing device, 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 this 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 this application.

[0052] The first embodiment of this application provides a method for processing three-dimensional object data, referring to... Figure 2 The three-dimensional object data processing method includes:

[0053] It should be noted that the method execution subject in this embodiment is a three-dimensional object data processing device. The three-dimensional object data processing device can be a three-dimensional object data processing device or a modeling tool device, or other devices with three-dimensional object data processing capabilities. This application does not impose any specific limitations.

[0054] It should be understood that the computer code in this embodiment is in Python language. In specific implementations, the computer code can also use any computer language such as Java or C. This application does not impose specific limitations. In this embodiment, the use of Python language is only for explaining the calculation method of this solution.

[0055] Understandably, the difference between this solution and existing technologies lies in the fact that this solution uses three-dimensional space to process object data. In traditional technologies, modeling software uses two-dimensional space to process object data. Since objects cannot be rotated freely in two-dimensional space, modeling software cannot place geometry on any face or angle of the object. This solution uses three-dimensional space to process object data. Because modeling software can rotate the object being processed freely when processing object data, this solution can place geometry on any face or angle of the object.

[0056] The following explanation uses a 3D object data processing device as the terminal.

[0057] Step S10: Obtain the orientation of the two-dimensional space and the location selected by the user.

[0058] It is understood that the location selected by the user should be displayed as the coordinates of a two-dimensional coordinate point in a two-dimensional space, wherein the coordinates of the two-dimensional coordinate point only include the X-axis and Y-axis data.

[0059] It should be noted that the X-axis and Y-axis data 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 two-dimensional space based on the X-axis and Y-axis data.

[0060] It should be understood that the X-axis coordinate scale is used to represent the minimum distance of the coordinate point from the Y-axis, and the Y-axis coordinate scale is used to represent the minimum distance of the coordinate point from the X-axis. The size of the X-axis and Y-axis coordinate scales can be manually set as needed.

[0061] For example, if the coordinate scales of the X and Y axes in 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 X-axis coordinate scale is 100, and the X value of the coordinate data of the coordinate point is 50, it means that the coordinate point is at half the position of the X-axis coordinate scale, and the coordinate point is at least 50 units away from the Y-axis.

[0063] Since the maximum value of the Y-axis coordinate scale is 100, and the Y value of the coordinate data of the coordinate point is 50, it means that the coordinate point is at half the position of the Y-axis coordinate scale, and the coordinate point is at least 50 units away from the X-axis.

[0064] In the two-dimensional space, the only coordinate that meets this condition is the point at the very center of the two-dimensional space. Therefore, the three-dimensional object data processing device can infer that the coordinate point is located at the very center of the two-dimensional space.

[0065] In practice, the 3D object data processing device acquires the orientation of the 2D 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, the 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 is based on the two-dimensional space with the X-axis and Y-axis, plus a Z-axis, which is used to represent distance or depth. The scales of the Z-axis, X-axis and Y-axis start from the same point.

[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 in the direction of orientation.

[0071] In a specific implementation, the three-dimensional object data processing device adds a Z-axis to the two-dimensional space, starting from the intersection of the X-axis and Y-axis in the two-dimensional space, in the direction the two-dimensional space is facing. The scale of the Z-axis can be manually set as needed.

[0072] Step S22: Add Z-axis data to the coordinate data in the two-dimensional space to convert the two-dimensional space 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 in the two-dimensional space to write the data of the Z-axis, thereby converting the two-dimensional space into a three-dimensional space.

[0074] It should be noted that the default value of the added Z-axis data is 0, and the addition of the Z-axis data does not affect the original coordinate data in the two-dimensional space.

[0075] For example, if the original coordinate data in the two-dimensional space is (X: 50, Y: 50), after adding the default data for the Z-axis, the coordinate point data in the three-dimensional space will be (X: 50, Y: 50, Z: 0).

[0076] Step S30: Based on the user-selected location, use a preset projection picking method to identify the first object selected by the user in the three-dimensional space.

[0077] In practice, the 3D object data processing device identifies the first object selected by the user in 3D space using a preset projection picking method based on the user's selected location.

[0078] It should be noted that the location selected by the user is a three-dimensional coordinate point after the transformation of the three-dimensional space. 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 3D space using a preset projection picking method based on the user-selected location specifically includes:

[0080] Step S31: Calculate the source point of the ray based on the location 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 location selected by the user.

[0082] The calculation code for the ray source point is as follows:

[0083]

[0084] It should be noted that in this code segment, rv3d refers to the three-dimensional space, area refers to the two-dimensional space, and coord refers to the location selected by the user.

[0085] It should be noted that the source point of the ray is emitted from the coordinate point selected by the user in two-dimensional space, and the Z-axis data of the source point of the ray should be 0.

[0086] Step S32: Starting from the source point of the ray, emit a ray in the direction of the two-dimensional space.

[0087] It should be understood that the direction of the two-dimensional space orientation 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 emits a ray from the source point of the ray in the direction of the two-dimensional space.

[0089] The calculation code for 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 segment, rv3d refers to the three-dimensional space.

[0094] Step S33: Using a preset projection picking method, calculate the first object touched by the ray and regard the object as the first object selected by the user.

[0095] It should be noted that the preset projection picking method should use a BVH tree structure, where the full English name of the BVH tree structure is Bounding Volume Hierarchy, which is a method for finding objects in a 3D scene.

[0096] It is important to understand that the BVH tree structure is mainly used to accelerate ray tracing algorithms. To ensure the image quality of ray tracing, each pixel needs to be sampled thousands of times, which makes the ray tracing algorithm very demanding on the computing power of the computer. The ray tracing algorithm detects whether a ray emitted from the source point into the three-dimensional space intersects with an object in the three-dimensional space. If an intersection is detected, the angle and direction of the ray's reflection or refraction are calculated based on the object's parameters, and the ray continues to be tracked until the ray reaches the maximum recursion depth or does not touch any object.

[0097] It should be understood that without using a BVH tree structure, each ray would have to perform intersection detection with all objects (spheres, rectangles, or complex geometries) in the 3D scene. Since the shapes of the objects being calculated to intersect are not fixed, the intersection detection scenario between the ray and the object becomes complex and computationally time-consuming.

[0098] It is understandable that the BVH tree structure uses hierarchy to group and enclose objects. Before a ray needs to detect whether it intersects with an object in three-dimensional space, the ray first checks whether it intersects with the enclosing object. If it does not intersect with the enclosing object, it means that the ray will never intersect with an object in the enclosing object, and it is determined that the ray cannot touch an object in the enclosing object. If it intersects with the enclosing object, it continues to check whether the ray intersects with the next level of enclosing object, until it detects an intersection with an object in the lowest level of enclosing object.

[0099] It should be noted that the most commonly used Bounding Volume is the axis-aligned minimum bounding box (AABB method), which is a bounding volume that exactly encloses the object along the coordinate axes. For example... Figure 3 As shown, if there are multiple objects in the 3D scene, the BVH tree structure uses a binary tree structure to manage the 3D scene.

[0100] In a specific implementation, the 3D object data processing device uses a preset projection picking method to calculate the first object touched by the ray and regard that object as the first object selected by the user.

[0101] The code for ray projection picking is as follows:

[0102]

[0103]

[0104] Where ray_start_local is the ray source point, and ray_normal_local is the ray direction.

[0105] This application provides a method, apparatus, device, and storage medium for processing three-dimensional object data. In this embodiment, compared with the existing modeling tools in related technologies that cannot recognize objects in three-dimensional space, thus preventing the modeling tools from placing geometric objects in three-dimensional space, this application obtains the orientation of two-dimensional space and the position selected by the user, then converts the two-dimensional space into three-dimensional space based on the orientation of the two-dimensional space, and finally uses a preset projection picking method to identify the first object selected by the user in three-dimensional space based on the position selected by the user. It can be understood that this application identifies the object selected by the user in three-dimensional space (which is obtained by converting from two-dimensional space) based on the projection picking method, enabling the modeling tools to recognize the object selected by the user in three-dimensional space, thus solving the problem that the modeling tools cannot place geometric objects in three-dimensional space.

[0106] Furthermore, based on the first embodiment, a second embodiment of the data processing method of this application is proposed. In this embodiment, reference is made to... Figure 4 Following step S30, the specific steps include A10-A20:

[0107] Step A10: Create a first geometry based on the first object selected by the user and the ray.

[0108] In a specific implementation, the three-dimensional object data processing device creates a first geometry based on the first object selected by the user and the ray.

[0109] It should be noted that the first geometric object can be a triangle, a rectangle, or any irregular shape. If the first geometric object is an irregular shape, the center point of the first geometric object needs to be set manually.

[0110] The step of creating the first geometry 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 the 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 the specific contact surface between the ray and the first object based on the first object selected by the user, and then reads the data of the contact surface.

[0113] It should be understood that if the contact surface is curved or has an arc, the contact surface is divided into multiple planes, and then the data of the planes of the contact surface between the ray and the first object are read.

[0114] Step A12: Create a first geometry centered on the contact point between the ray and the first object, wherein the center coordinates of the first geometry always coincide with the contact point.

[0115] It should be noted that the first geometric shape can be a regular triangle, rectangle, or circle, or any irregular shape. The specific shape can be manually set according to the user's needs.

[0116] In specific implementations, such as Figure 5 As shown, the three-dimensional object data processing device creates a first geometry based on the contact point between the ray and the first object. The center coordinates of the first geometry always coincide with the contact point, so that the first geometry 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, then a coordinate point needs to be manually set in the first geometric body, and the manually set coordinate point is regarded as the center coordinates of the first geometric body.

[0118] The calculation code for the first geometric coordinate data is as follows:

[0119]

[0120] Where y is the plane normal and pt is the three-dimensional coordinate after the transformation from two-dimensional space.

[0121] Step A20: After receiving the user's confirmation, place the first geometry at the current position.

[0122] In a specific implementation, after receiving the user's confirmation information, the three-dimensional object data processing device fixes the first geometry in the current position, which is regarded as placing the first geometry on the wall of the first object.

[0123] It should be noted that the user's determination information can be a mouse click signal or any signal that determines the placement of the first geometric object.

[0124] The step of placing the first geometric object at the current position after receiving confirmation from the user specifically includes:

[0125] Step A21: After receiving the user's confirmation information, and based on the first geometry, create a second geometry, wherein the parameters and coordinates of the second geometry correspond to those of the first geometry, to replace the first geometry in performing various calculations, ensuring that the first geometry remains independent after placement.

[0126] In a specific implementation, after receiving the user's confirmation information, the three-dimensional object data processing device creates a second geometry based on the first geometry.

[0127] It should be noted that the second geometry has the same main mesh structure as the first geometry but is not filled with color. The second geometry exists as a sub-component of the first geometry. The second geometry has the same position coordinates, shape constraints and solid parameters as the first geometry, and performs various calculations in place of the first geometry to ensure that the first geometry remains independent after placement.

[0128] Step A22: Based on the first object, create a second object, wherein the characteristics of the second object are the same as those of the second geometry, and the second object can simultaneously accommodate multiple second geometries.

[0129] In a specific implementation, the 3D object data processing device creates a second object based on the object data of the first object.

[0130] It should be noted that the second object functions similarly to the second geometric object, primarily serving to perform various calculations on behalf of the first object, ensuring that the first object remains independent.

[0131] It should be understood that the second object can be created directly. The second object does not require the mesh information of the first object. The creation of the second object is only used to assist the calculation of the first object and does not require the creation of an entity.

[0132] It should be noted that the mesh information is a type of object information, such as the coordinate information of the object's vertices or faces. The function of the mesh information is to constrain the object and identify its edges.

[0133] Step A23: Merge the second geometry with the second object, which is considered as placing the first geometry at the current position.

[0134] In a specific implementation, the three-dimensional object data processing device merges the second geometry with the second object and considers it as placing the first geometry at the current position of the first object.

[0135] It should be understood that, such as Figure 6 As shown, the merging of the second geometry and the second object only uses the second geometry and the second object for calculation, while the first object and the first geometry remain independent.

[0136] The step of merging the second geometry with the second object, which is considered as placing the first geometry at the current position, specifically includes:

[0137] Step A231: Read the coordinate data of the second geometry and the second object.

[0138] In a specific implementation, the three-dimensional object data processing device reads the coordinate data of the second geometry and the second object.

[0139] Step A232: Use the union Boolean operation to merge the second geometry and the second object.

[0140] In a specific implementation, the 3D object data processing device uses a union Boolean operation to merge the second geometry with the second object.

[0141] It should be noted that, as Figure 7As shown, the three-dimensional object data processing device uses a union Boolean operation to merge the second geometry and the second object, so that the first geometry is placed on the first object, but the first geometry 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 geometry and the second object overlap, wherein the calculation method is to determine whether the bounding boxes of the second geometry and the second object intersect, or to determine whether the vertices of the second geometry are in the second object.

[0144] 2. If the second geometric body intersects with the second object, then iterate through and calculate the intersection of all faces of the second geometric body with the second object. If all faces of the second geometric body intersect with the second object, then determine that the face of the second geometric body is a curved surface.

[0145] 3. Add all intersecting surfaces to the second geometry and the second object.

[0146] 4. Based on the actual calculation method, the second geometry and the second object are trimmed, and the vertices and edges are regenerated.

[0147] It should be noted that the actual calculation methods are divided into union, intersection, and difference. Union means that the second geometric body and the second object have the same edges and faces, so 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, so all the edges and faces of the second geometric body and the second object are saved. Difference means that the edges and faces of the second geometric body and the second object have a difference, so the common part of the second geometric body and the second object is subtracted from the second object.

[0148] It should be understood that the edge surface is used to characterize the surface where the geometry and the object come into contact.

[0149] In this embodiment, a first geometry is created based on the first object selected by the user and the ray. Then, after receiving the user's confirmation information, the first geometry is placed at the current position, so that the building tool software can place the geometry on any face and at any angle in three-dimensional space.

[0150] Furthermore, embodiments of this application also propose a three-dimensional object data processing device, referring to... Figure 8 The three-dimensional object data processing device includes:

[0151] The acquisition module 10 is used to acquire the orientation in two-dimensional space and the position selected by the user;

[0152] The conversion module 20 is used 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 identify the first object selected by the user in three-dimensional space based on the user-selected position using a preset projection picking method.

[0154] Optionally, the conversion module 20 includes:

[0155] An addition unit is used to add a Z-axis in the oriented direction in the two-dimensional space;

[0156] The transformation unit is used to add Z-axis data to the coordinate data in the two-dimensional space, so that the two-dimensional space is transformed into a three-dimensional space.

[0157] Optionally, the identification module 30 includes:

[0158] A calculation unit is used to calculate the source point of the ray based on the location selected by the user;

[0159] The emitting unit is used to emit a ray from the source point of the ray in the direction of the two-dimensional space.

[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 is used to create a first geometry based on the first object selected by the user and the ray;

[0163] The placement module is used to place the first geometry at the current position after receiving confirmation information from the user.

[0164] Optionally, the creation module includes:

[0165] The reading unit is used to read data of the 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 geometry based on the contact point between the ray and the first object, wherein the center coordinates of the first geometry always coincide with the contact point.

[0167] Optionally, the placement module includes:

[0168] The second creation unit is used to create a second geometry based on the first geometry after receiving the user's confirmation information. The parameters and coordinates of the second geometry correspond to those of the first geometry, so as to perform various calculations in place of the first geometry and ensure that the first geometry remains independent after placement.

[0169] The third creation unit is used to create a second object based on the first object, wherein the characteristics of the second object are the same as those of the second geometry, and the second object can simultaneously accommodate multiple second geometries.

[0170] The merging unit is used to merge the second geometry with the second object, which is regarded as placing the first geometry at the current position.

[0171] Optionally, the merging unit further includes:

[0172] The read sub-unit is used to read the coordinate data of the second geometry and the second object;

[0173] Merge sub-units, used to merge the second geometry and the second object using the union Boolean operation.

[0174] The specific implementation of the three-dimensional object data processing device of this application is basically the same as the embodiments of the three-dimensional object data processing method described above, and will not be repeated here.

[0175] This application provides a storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the three-dimensional object data processing method described above.

[0176] The specific implementation of the storage medium in this application is basically the same as the embodiments of the three-dimensional object data processing method described above, and will not be repeated here.

[0177] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0178] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0179] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0180] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for processing three-dimensional object data, characterized in that, The three-dimensional object data processing method includes the following steps: Obtain the orientation in two-dimensional space and the location selected by the user; In the two-dimensional space, add a Z-axis in the direction of orientation; Add Z-axis data to the coordinate data in the two-dimensional space to transform the two-dimensional space into a three-dimensional space; Calculate the source point of the ray based on the location selected by the user; Starting from the source point of the ray, a ray is emitted in the direction that the two-dimensional space is facing; The objects in the 3D scene are grouped into hierarchical bounding volumes using a binary tree BVH tree structure. The intersection of rays and bounding volumes is detected level by level to quickly locate the first object touched by the ray and regard that object as the first object selected by the user. Based on the first object selected by the user and the ray, the data of the contact surface between the ray and the first object is read, and a first geometry is created with the contact point between the ray and the first object as the center, wherein the center coordinates of the first geometry always coincide with the contact point; After receiving the user's confirmation instruction, a second geometry is created. The second geometry has the same main mesh structure as the first geometry but is not filled with color, and serves as a sub-component of the first geometry. The second geometry and the second object are merged using a union Boolean operation. This includes reading the coordinate data of the second geometry and the second object, calculating whether the second geometry and the second object overlap, traversing and calculating all face intersections, trimming the intersecting surfaces, and regenerating vertices and edges to achieve independent placement of the first geometry in three-dimensional space. The parameters and coordinates of the second object are the same as those of the first object, and it is used to replace the first object in the calculation.

2. The three-dimensional object data processing method as described in claim 1, characterized in that, After the step of identifying the first object selected by the user in three-dimensional space using a preset projection picking method based on the user-selected location, the method includes: Based on the first object selected by the user and the ray, a first geometry is created; After receiving confirmation from the user, the first geometry is placed at the current position.

3. The three-dimensional object data processing method as described in claim 2, characterized in that, The step of creating a first geometry based on the user-selected first object and the ray includes: Based on the first object selected by the user and the ray, read the data of the contact surface between the ray and the first object; A first geometric shape is created centered on the point of contact between the ray and the first object, wherein the center coordinates of the first geometric shape always coincide with the point of contact.

4. The three-dimensional object data processing method as described in claim 2, characterized in that, The step of placing the first geometric object at the current position after receiving confirmation from the user includes: After receiving the user's confirmation information, and based on the first geometry, a second geometry is created, wherein the parameters and coordinates of the second geometry correspond to those of the first geometry, in order to replace the first geometry in performing various calculations, ensuring that the first geometry remains independent after placement; Based on the first object, a second object is created, wherein the characteristics of the second object are the same as those of the second geometry, and the second object can simultaneously contain multiple second geometries; Merging the second geometry with the second object is considered as placing the first geometry at the current position.

5. The three-dimensional object data processing method as described in claim 4, characterized in that, The step of merging the second geometry with the second object, which is considered as placing the first geometry at the current position, includes: Read the coordinate data of the second geometric shape and the second object; Use the union Boolean operation to merge the second geometry and the second object.

6. A three-dimensional object data processing device, characterized in that, The device includes: The acquisition module is used to acquire the orientation in two-dimensional space and the position selected by the user; An addition unit is used to add a Z-axis in the oriented direction in the two-dimensional space; A transformation unit is used to add Z-axis data to the coordinate data in the two-dimensional space, so that the two-dimensional space is transformed into a three-dimensional space; A calculation unit is used to calculate the source point of the ray based on the location selected by the user; The emitting unit is used to emit a ray from the source point of the ray in the direction of the two-dimensional space. The touch unit is used to group objects in the 3D scene into hierarchical bounding volumes using a binary tree BVH tree structure, detect the intersection of rays and bounding volumes level by level, quickly locate the first object touched by the ray, and regard that object as the first object selected by the user. The first creation unit is used to read the data of the contact surface between the ray and the first object based on the first object selected by the user and the ray, and to create a first geometry based on the contact point between the ray and the first object as the center, wherein the center coordinates of the first geometry always coincide with the contact point; The second creation unit is used to create a second geometry after receiving a user confirmation instruction. The second geometry has the same main mesh structure as the first geometry but is not filled with color, and serves as a sub-component of the first geometry. The first merging unit is used to merge the second geometry and the second object using a union Boolean operation. This includes reading the coordinate data of the second geometry and the second object, calculating whether the second geometry and the second object overlap, traversing and calculating all intersecting surfaces, trimming the intersecting surfaces, and regenerating vertices and edges to achieve independent placement of the first geometry in three-dimensional space. The parameters and coordinates of the second object are consistent with those of the first object, and it is used to replace the first object in calculations.

7. 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, the three-dimensional object data processing program being configured to implement the steps of the three-dimensional object data processing method as described in any one of claims 1 to 5.

8. 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 as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Three-dimensional image editing method and system, storage medium and terminal equipment

    CN114764851A