A method and device for calculating the projection area of a 3D mesh model and a storage medium

By acquiring the bounding box data and offset coordinates OPP of the 3D mesh model, and combining the actual and set precision maximum projected areas A and PA, the projected area of ​​the 3D mesh model is calculated, solving the problem of inaccurate projected area calculation in the prior art and achieving accurate calculation.

CN117152236BActive Publication Date: 2025-12-26CHANGSHA MORALE NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311199952.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-12-26
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

The existing method for calculating the projected area of ​​a 3D mesh model mainly involves superimposing the area of ​​each 3D primitive in the projection, which results in low calculation accuracy.

Method used

By acquiring the bounding box data of the 3D mesh model, the offset coordinates OPP, the actual maximum projected area A, and the maximum projected area PA with a set precision are calculated. Using the offset coordinates OPP, the actual maximum projected area A, and the maximum projected area PA with a set precision, the projected area of ​​the 3D mesh model is calculated.

Benefits of technology

It achieves accurate calculation of the projected area of ​​3D mesh models, solving the problem of low accuracy in the calculation of projected area in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117152236B_ABST
    Figure CN117152236B_ABST
Patent Text Reader

Abstract

The application relates to a 3D grid model projection area calculation method, device and storage medium, the method comprising: obtaining bounding box data of a 3D grid model; calculating a set-precision projection maximum area PA on a preset projection plane according to the bounding box data of the 3D grid model; obtaining the bounding box of a 3D primitive on the projection plane according to the vertexes of the 3D primitive in the 3D grid model; obtaining the coordinates PP of the vertex on the projection plane according to the centroid coordinates and the vertex coordinates of the triangle; obtaining the offset coordinates OPP of the coordinates PP relative to the minimum value of the bounding box of the 3D grid model; calculating an actual projection maximum area A according to the bounding box data of the 3D grid model; and calculating the projection area of the 3D grid model according to the offset coordinates OPP, the actual projection maximum area A and the set-precision projection maximum area PA. Through the application, the technical problem of low accuracy of projection area calculation in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of three-dimensional model processing, in particular to a method and device for calculating the projection area of a 3D mesh model and a storage medium. BACKGROUND

[0002] A 3D mesh model has irregular shapes, and may have hollow features in the middle. The projection of a 3D mesh model also has these features. Therefore, there is no method for obtaining the accurate projection area of a 3D mesh model in the prior art. Currently, the calculation of the projection area of a 3D model in the prior art mainly adopts the method of superimposing the area of each projected 3D primitive. This method is not accurate in calculating the projection area. SUMMARY

[0003] In the present application, a method and device for calculating the projection area of a 3D mesh model and a storage medium are provided.

[0004] In a first aspect, a method for calculating the projection area of a 3D mesh model is provided in the present application, and the method comprises:

[0005] obtaining the bounding box data of the 3D mesh model;

[0006] calculating the maximum projection area PA of a set precision on a preset projection plane according to the bounding box data of the 3D mesh model;

[0007] obtaining the bounding box of a 3D primitive on the projection plane according to the vertices of the 3D primitive in the 3D mesh model;

[0008] obtaining the coordinates PP of the vertices on the projection plane according to the centroid coordinates and the vertex coordinates of the triangle;

[0009] obtaining the offset coordinates OPP of the coordinates PP relative to the minimum value of the bounding box of the 3D mesh model;

[0010] calculating the actual maximum projection area A of the 3D mesh model according to the bounding box data of the 3D mesh model;

[0011] calculating the projection area of the 3D mesh model according to the offset coordinates OPP, the actual maximum projection area A, and the maximum projection area PA of the set precision.

[0012] In some embodiments, the calculation of the projection area of the 3D mesh model according to the offset coordinates OPP, the actual maximum projection area A, and the maximum projection area PA of the set precision comprises:

[0013] converting the offset coordinates OPP into the offset coordinates POPP of the set precision, and setting the data at the position of the offset coordinates POPP of the set precision in the memory space to 1.

[0014] counting the number of data with value 1 in the memory space YC;

[0015] According to the number of data YC, the actual maximum projection area A and the set precision projection maximum area PA, the projection area of the 3D mesh model is calculated.

[0016] In some embodiments, the coordinates PP of the point on the projection plane are obtained according to the centroid coordinates and the vertex coordinates of the triangle, comprising:

[0017] Obtaining the larger length LAL of the set precision bounding box length in the two axial directions of the projection plane;

[0018] According to the length LAL, the step length SL when traversing the centroid coordinates of the triangle is obtained;

[0019] According to the step length SL, each centroid coordinate of the triangle is traversed, and the coordinates PP of the point on the projection plane are obtained according to the centroid coordinates and the vertex coordinates of the triangle.

[0020] In some embodiments, after obtaining the bounding box data of the 3D mesh model, comprising:

[0021] Selecting a set projection direction from the three XYZ axial directions, and the projection plane is a plane composed of the remaining two axial directions; and the remaining two axial directions are respectively a first projection axis A1 and a second projection axis A2.

[0022] In some embodiments, the offset coordinates OPP of the coordinates PP relative to the minimum value of the bounding box of the 3D mesh model are obtained, comprising:

[0023] According to the bounding box data of the 3D mesh model, the minimum value A1SL in the first projection axis A1 axial direction and the minimum value A2SL in the second projection axis A2 axial direction are obtained;

[0024] The coordinates PP are subtracted by the minimum value A1SL and the minimum value A2SL to obtain the offset coordinates OPP of the coordinates PP relative to the minimum value of the bounding box of the 3D mesh model.

[0025] In some embodiments, the method further comprises:

[0026] Obtaining each 3D primitive of the 3D mesh model;

[0027] The 3D primitive of the N-gon is divided into N-2 triangles; wherein N is a positive integer greater than or equal to 3.

[0028] In some embodiments, the projection area of the 3D mesh model is calculated according to the number of data YC, the actual maximum projection area A, and the maximum projection area PA of the set precision, and the projection area of the 3D mesh model = A*YC / PA.

[0029] In some embodiments, the step length SL when the centroid coordinates of the traversal triangle are obtained is calculated according to the length LAL, and SL = 1 / (LAL+1).

[0030] In a second aspect, the present application provides a device for calculating the projection area of a 3D mesh model, and the device comprises:

[0031] A first obtaining module is configured to obtain the bounding box data of the 3D mesh model.

[0032] A first calculating module is configured to calculate the maximum projection area PA of the set precision on the preset projection plane according to the bounding box data of the 3D mesh model.

[0033] A second obtaining module is configured to obtain the bounding box of the 3D graph element on the projection plane according to the vertex of the 3D graph element in the 3D mesh model.

[0034] A third obtaining module is configured to obtain the coordinate PP of the vertex on the projection plane according to the centroid coordinates and the vertex coordinates of the triangle.

[0035] A fourth obtaining module is configured to obtain the offset coordinate OPP of the coordinate PP relative to the minimum value of the bounding box of the 3D mesh model.

[0036] A second calculating module is configured to calculate the actual maximum projection area A according to the bounding box data of the 3D mesh model.

[0037] A third calculating module is configured to calculate the projection area of the 3D mesh model according to the offset coordinate OPP, the actual maximum projection area A, and the maximum projection area PA of the set precision.

[0038] In a third aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to perform the steps of the method for calculating the projection area of the 3D mesh model according to the first aspect.

[0039] Compared with the prior art, the method, device and storage medium for calculating the projection area of a 3D grid model provided in the application calculate the offset coordinates OPP, the actual projection maximum area A and the projection maximum area PA of the set precision through the bounding box data, and calculate the projection area of the 3D grid model according to the offset coordinates OPP, the actual projection maximum area A and the projection maximum area PA of the set precision, so as to realize the accurate calculation of the projection area of the 3D grid model according to the offset coordinates OPP, the actual projection maximum area A and the projection maximum area PA of the set precision, and solve the technical problem that the calculation of the projection area of the 3D model in the prior art mainly adopts the mode of superimposing the area of each projected 3D primitive, resulting in low accuracy of the projection area calculation.

[0040] The details of one or more embodiments of the application are presented in the following drawings and description to make other features, objects and advantages of the application more apparent. BRIEF DESCRIPTION OF DRAWINGS

[0041] The drawings described herein are intended to provide further understanding of the application, and constitute a part of the application. The illustrative embodiments of the application and their description serve to explain the application, and do not constitute an improper limitation of the application. In the drawings:

[0042] Figure 1 is a hardware structure block diagram of a terminal for performing the method for calculating the projection area of a 3D grid model according to the embodiments of the application;

[0043] Figure 2 is a flowchart of the method for calculating the projection area of a 3D grid model according to the embodiments of the application;

[0044] Figure 3 is a flowchart of the method for calculating the projection area of a 3D grid model according to the embodiments of the application;

[0045] Figure 4 is a structure block diagram of the device for calculating the projection area of a 3D grid model according to the embodiments of the application. DETAILED DESCRIPTION

[0046] In order to more clearly understand the objects, technical solutions and advantages of the application, the application is described and explained below in combination with the drawings and embodiments.

[0047] Unless otherwise defined, technical terms and scientific terms used in the present application shall have the same meaning as those commonly understood by a person of ordinary skill in the art to which the present application belongs. The terms "one", "a", "an", "the", "these", and similar terms in the present application do not mean "only one" or "exactly one", but can mean "one or more". The terms "include", "contain", "have", and any variant thereof in the present application are intended to cover the non-exclusive inclusion; for example, a process, method, and system, product or device containing a series of steps or modules (units) are not limited to the listed steps or modules (units), but can include steps or modules (units) not listed, or can include other steps or modules (units) inherent to the process, method, product or device. The terms "connect", "connect", "couple" and the like in the present application are not limited to physical or mechanical connection, but can include electrical connection, whether direct or indirect. The term "multiple" in the present application means two or more. The term "and / or" describes the association between the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. Generally, the character " / " represents an "or" relationship between the associated objects. The terms "first", "second", "third" and the like in the present application are only used to distinguish similar objects, and do not represent a specific order of the objects.

[0048] The method embodiments provided in the present application can be executed in a terminal, a computer or a similar computing device. For example, the method embodiments are executed on a terminal, Figure 1 is a hardware structure diagram of a terminal for executing a 3D mesh model projection area calculation method according to an embodiment of the present application. As shown in Figure 1 , the terminal can include one or more (only one is shown in Figure 1 ) processor 102 and memory 104 for storing data, wherein the processor 102 can include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA. The terminal can also include a transmission device 106 for communication function and an input / output device 108. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, which does not limit the structure of the terminal. For example, the terminal can include more or less components than those shown in Figure 1 , or have a different configuration from that shown in Figure 1 .

[0049] The memory 104 can be used to store computer programs, such as software programs of application software and modules, for example, a computer program corresponding to the method for calculating the projection area of a 3D mesh model in the embodiment. The processor 102 can execute various functional applications and data processing, i.e., implement the method described above, by running the computer program stored in the memory 104. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include memories remotely arranged with respect to the processor 102, which can be connected to the terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0050] The transmission device 106 is used to receive or send data via a network. The network described above includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.

[0051] A method for calculating the projection area of a 3D mesh model is provided in the present application, Figure 2 is a flowchart of the method for calculating the projection area of a 3D mesh model in the embodiment of the present application, as shown in Figure 2 The flowchart includes the following steps:

[0052] In step S201, the bounding box data of the 3D mesh model is obtained.

[0053] In step S202, the projection maximum area PA of the set precision on the preset projection plane is calculated according to the bounding box data of the 3D mesh model.

[0054] In step S203, the bounding box of the 3D primitive on the projection plane is obtained according to the vertex of the 3D primitive in the 3D mesh model.

[0055] In step S204, the coordinate PP of the vertex on the projection plane is obtained according to the centroid coordinate and the vertex coordinate of the triangle.

[0056] In step S205, the offset coordinate OPP of the coordinate PP with respect to the minimum value of the bounding box of the 3D mesh model is obtained.

[0057] In step S206, the actual projection maximum area A is calculated according to the bounding box data of the 3D mesh model.

[0058] In step S207, the projection area of the 3D mesh model is calculated according to the offset coordinates OPP, the actual maximum projection area A and the projection maximum area PA of the set precision.

[0059] In the embodiment, the offset coordinates OPP, the actual maximum projection area A and the projection maximum area PA of the set precision are calculated through the bounding box data, and the projection area of the 3D mesh model is calculated according to the offset coordinates OPP, the actual maximum projection area A and the projection maximum area PA of the set precision, so as to realize the accurate calculation of the projection area of the 3D mesh model according to the offset coordinates OPP, the actual maximum projection area A and the projection maximum area PA of the set precision, and solve the technical problem that the calculation of the projection area of the 3D model in the prior art mainly adopts the way of superimposing the area of each projected 3D primitive, resulting in low accuracy of the projection area calculation.

[0060] In some embodiments, the projection area of the 3D mesh model is calculated according to the offset coordinates OPP, the actual maximum projection area A and the projection maximum area PA of the set precision, including:

[0061] The offset coordinates OPP are converted into the offset coordinates POPP of the set precision, and the data at the position of the offset coordinates POPP of the set precision in the memory space is set to 1;

[0062] The number YC of the data with the value of 1 in the memory space is counted;

[0063] The projection area of the 3D mesh model is calculated according to the number YC of the data, the actual maximum projection area A and the projection maximum area PA of the set precision.

[0064] In some embodiments, the coordinates PP of the vertex on the projection plane are obtained according to the centroid coordinates and the vertex coordinates of the triangle, including:

[0065] The larger length LAL of the bounding box length of the set precision in the two axial directions of the projection plane is obtained;

[0066] The step length SL of traversing the centroid coordinates of the triangle is obtained according to the length LAL;

[0067] Each centroid coordinate of the triangle is traversed according to the step length SL, and the coordinates PP of the point on the projection plane are obtained according to the centroid coordinates and the vertex coordinates of the triangle.

[0068] In some embodiments, after obtaining the bounding box data of the 3D mesh model, including:

[0069] A projection direction is selected from the three axes XYZ, and a projection plane is a plane formed by the remaining two axes; the remaining two axes are respectively a first projection axis A1 and a second projection axis A2.

[0070] In some embodiments, the offset coordinate OPP of the coordinate PP relative to the minimum value of the bounding box of the 3D mesh model is obtained, including:

[0071] The minimum value A1SL on the first projection axis A1 and the minimum value A2SL on the second projection axis A2 are obtained according to the bounding box data of the 3D mesh model;

[0072] The coordinate PP is subtracted by the minimum value A1SL and the minimum value A2SL to obtain the offset coordinate OPP of the coordinate PP relative to the minimum value of the bounding box of the 3D mesh model.

[0073] In some embodiments, the method further includes:

[0074] Obtaining each 3D primitive of the 3D mesh model;

[0075] The 3D primitive of the N-gon is divided into N-2 triangles; wherein N is a positive integer greater than or equal to 3.

[0076] In some embodiments, the projection area of the 3D mesh model is calculated according to the data number YC, the actual projection maximum area A, and the projection maximum area PA of the set precision, including: the projection area of the 3D mesh model = A*YC / PA.

[0077] In some embodiments, the step length SL when traversing the triangle centroid coordinates is obtained according to the length LAL, including: SL = 1 / (LAL+1).

[0078] The embodiments of the present application are described and explained below through specific embodiments.

[0079] Figure 3 is a flowchart of a 3D mesh model projection area calculation method of the present embodiment, as shown in Figure 3 The flowchart includes the following steps:

[0080] Step S301, calculate the bounding box size of the 3D mesh model.

[0081] Step S302, obtain the set projection direction and the projection plane from the XYZ axis.

[0082] Step S303, calculate the projection maximum area PA of the set precision.

[0083] Step S304, allocate a memory space to save PA bit data, and initialize the memory space.

[0084] Step S305, processing each 3D primitive of the 3D mesh model.

[0085] Step S306, judging whether all 3D primitives are processed; if yes, executing step S318; if no, executing step S307.

[0086] Step S307, dividing the 3D primitive of N polygon into N-2 triangles.

[0087] Step S308, processing each divided triangle.

[0088] Step S309, judging whether all divided triangles are processed; if yes, executing step S305; if no, executing step S310.

[0089] Step S310, obtaining the greater edge length of the projection bounding box of the triangle with the set precision.

[0090] Step S311, calculating the step length when traversing the triangle centroid coordinates.

[0091] Step S312, traversing each centroid coordinate of the triangle according to the step length.

[0092] Step S313, judging whether all centroid coordinates are traversed; if yes, executing step S308; if no, executing step S314.

[0093] Step S314, obtaining the projection plane coordinate of the current centroid coordinate.

[0094] Step S315, obtaining the offset coordinate of the projection plane coordinate relative to the minimum value of the model bounding box.

[0095] Step S316, converting the offset coordinate into the offset coordinate POPP with the set precision, setting the data at the coordinate POPP in the memory space to 1; executing step S312.

[0096] Step S317, the projection area of the 3D mesh model is A*YC / PA; the program ends.

[0097] Step S318, counting the number of data with value 1 in the memory space YC.

[0098] Step S319, calculating the projection maximum area A, and executing step S317.

[0099] In the embodiment, the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision are calculated through the bounding box data, and the projection area of the 3D grid model is calculated according to the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision, so that the accurate calculation of the projection area of the 3D grid model according to the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision is realized, and the technical problem that the calculation of the projection area of the 3D model in the prior art mainly adopts the manner of superimposing the area of each projected 3D primitive, resulting in low accuracy of the projection area calculation is solved.

[0100] The embodiment further provides another method for calculating the projection area of a 3D grid model, comprising the following steps:

[0101] Step 1, calculating the size of the bounding box of the 3D grid model.

[0102] Specifically, the bounding box is a cuboid box used for determining the boundary of a model, and is additional data frequently used in model processing and does not replace the original data of the 3D grid model. The size of the bounding box is usually calculated by traversing all vertices of the model and recording the maximum value and the minimum value of all vertices on the three XYZ axial directions. The bounding box is represented by the minimum value on the three XYZ axial directions and the maximum value on the three axial directions.

[0103] Step 2, selecting a set projection direction from the three XYZ axial directions, and the projection plane is a plane composed of the remaining two axial directions, which are denoted by A1 and A2.

[0104] Step 3, calculating the projection maximum area PA of the set precision according to the bounding box data, and obtaining the minimum value A1SL on the A1 axial direction and the minimum value A2SL on the A2 axial direction according to the bounding box data.

[0105] Specifically, the bounding box data includes the minimum value on the three XYZ axial directions and the maximum value on the three axial directions, and thus the length of the bounding box on each XYZ axial direction can be calculated. If the unit of the model is meter, the length of the bounding box on each axial direction is also in meter, and if the set precision is millimeter, the projection maximum area PA is equal to (the length of the bounding box on the A1 axial direction * 1000) * (the length of the bounding box on the A2 axial direction * 1000).

[0106] Step 4, allocating a memory space to save PA bit data, and resetting the bit data to 0 value.

[0107] Step 5, processing each 3D primitive of the 3D grid model as follows:

[0108] Step 5.1.3.3, convert the offset coordinate OPP to the offset coordinate POPP of the set precision, and set the data at the coordinate POPP position in the memory space MPA to 1.

[0109] Step 5.1.1, find the bounding box of the triangle on the projection plane according to each vertex of the triangle, and obtain the length LAL of the bounding box set in the precision of the two axial directions of the projection plane.

[0110] Specifically, the bounding box of step 1 is the bounding box of the entire model, which is a three-dimensional bounding box. The bounding box here is the bounding box of a triangle in the model after projection on the projection plane, which is a two-dimensional bounding box.

[0111] Step 5.1.2, obtain the step length SL when traversing the centroid coordinates of the triangle according to the length LAL.

[0112] Specifically, the step length SL = 1 / (LAL+1).

[0113] Step 5.1.3, traverse each centroid coordinate of the triangle according to the step length SL, and process each centroid coordinate as follows:

[0114] Step 5.1.3.1, obtain the point coordinate PP on the projection plane according to the centroid coordinate and the vertex coordinate of the triangle;

[0115] Step 5.1.3.2, subtract the minimum value A1SL and A2SL from the coordinate PP to obtain the offset coordinate OPP of the coordinate PP relative to the minimum value of the model bounding box;

[0116] Step 5.1.3.3, convert the offset coordinate OPP to the offset coordinate POPP of the set precision, and set the data at the coordinate POPP position in the memory space MPA to 1.

[0117] Step 6, count the number YC of data with value 1 in the memory space MPA, and calculate the projection maximum area A according to the bounding box of the 3D mesh model.

[0118] Specifically, the projection maximum area A is equal to the length of the 3D model bounding box in the A1 axial direction multiplied by the length of the 3D model bounding box in the A2 axial direction. The difference between PA and A is that PA is the set precision projection maximum area, which is an integer value representing the maximum number of data with value 1 in the memory space MPA; A is the actual projection maximum area, which is a floating point value.

[0119] Step 7, the projection area of the 3D mesh model is A*YC / PA.

[0120] In the embodiment, the bounding box data is used to calculate the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision, and the projection area of the 3D mesh model is calculated according to the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision, so that the accurate calculation of the projection area of the 3D mesh model according to the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision is realized, and the technical problem that the calculation of the projection area of the 3D model in the prior art mainly adopts the manner of superimposing the area of each projected 3D primitive, resulting in low accuracy of the projection area calculation is solved.

[0121] It should be noted that the steps shown in the above flow or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0122] In the present application, a 3D mesh model projection area calculation device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. The terms "module", "unit", "sub-unit" and the like used below can be a combination of software and / or hardware that realizes a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and is conceived.

[0123] Figure 4 is a structural block diagram of a 3D mesh model projection area calculation device of an embodiment of the present application, as Figure 4 shown, the device comprises:

[0124] The first acquisition module 410 is configured to acquire the bounding box data of the 3D mesh model.

[0125] The first calculation module 420 is configured to calculate the projection maximum area PA of the set precision on the preset projection plane according to the bounding box data of the 3D mesh model.

[0126] The second acquisition module 430 is configured to acquire the bounding box of the 3D primitive on the projection plane according to the vertex of the 3D primitive in the 3D mesh model.

[0127] The third acquisition module 440 is configured to acquire the coordinate PP of the vertex on the projection plane according to the centroid coordinate and the vertex coordinate of the triangle.

[0128] The fourth acquisition module 450 is configured to acquire the offset coordinate OPP of the coordinate PP relative to the minimum value of the bounding box of the 3D mesh model.

[0129] The second calculation module 460 is configured to calculate an actual projection maximum area A according to the bounding box data of the 3D mesh model.

[0130] The third calculation module 470 is configured to calculate the projection area of the 3D mesh model according to the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision.

[0131] It should be noted that each of the above modules can be a functional module or a program module, and can be implemented by software or hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor; or each of the above modules can also be located in different processors in any combination.

[0132] In the present application, an electronic device is also provided, which includes a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the above method embodiments.

[0133] Optionally, the electronic device can further include a transmission device and an input / output device, wherein the transmission device is connected with the processor, and the input / output device is connected with the processor.

[0134] Optionally, in the present embodiment, the processor can be configured to execute the following steps through the computer program:

[0135] S1, obtaining bounding box data of a 3D mesh model;

[0136] S2, calculating a projection maximum area PA of set precision on a preset projection plane according to the bounding box data of the 3D mesh model;

[0137] S3, obtaining a bounding box of a 3D primitive on the projection plane according to vertexes of the 3D primitive in the 3D mesh model;

[0138] S4, obtaining a coordinate PP of the vertex on the projection plane according to the centroid coordinate and the vertex coordinate of the triangle;

[0139] S5, obtaining an offset coordinate OPP of the coordinate PP relative to the minimum value of the bounding box of the 3D mesh model;

[0140] S6, calculating an actual projection maximum area A according to the bounding box data of the 3D mesh model;

[0141] S7, calculating the projection area of the 3D mesh model according to the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision.

[0142] It should be noted that the specific examples in the present embodiment can refer to the examples described in the above embodiments and optional implementation manners, and will not be described herein again.

[0143] In addition, in combination with the method for calculating the projection area of a 3D mesh model provided in the above embodiments, a storage medium can also be provided to implement the method in the present embodiment. The storage medium has a computer program stored thereon; the computer program is executed by a processor to implement the steps of any of the methods for calculating the projection area of a 3D mesh model in the above embodiments.

[0144] It should be understood that the specific embodiments described herein are merely intended to explain the application, but not to limit it. According to the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of the present application.

[0145] Obviously, the drawings are only some examples or embodiments of the present application, and can be applied to other similar situations without creative efforts for those of ordinary skill in the art. In addition, it can be understood that, although the work done in the development process can be complex and long, some design, manufacture or production changes according to the technical content disclosed in the present application are only routine technical means for those of ordinary skill in the art, and should not be regarded as insufficient disclosure of the present application.

[0146] The term "embodiment" in the present application means that the specific features, structures or characteristics described in combination with the embodiments can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean independence or alternatives to other embodiments. It can be clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined without conflict.

[0147] The above-described embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of patent protection. It should be noted that, for those of ordinary skill in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which all fall within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A method for calculating the projected area of a 3D mesh model, characterized in that, The method comprises: acquiring bounding box data of a 3D mesh model; calculating a projection maximum area PA of a set precision on a preset projection plane according to the bounding box data of the 3D mesh model; acquiring a bounding box of a 3D primitive on the projection plane according to a vertex of the 3D primitive in the 3D mesh model; dividing the 3D primitive of the N-gon into N-2 triangles, wherein N is a positive integer greater than or equal to 3, and acquiring a coordinate PP of the vertex on the projection plane according to a centroid coordinate of the triangle and a vertex coordinate of the triangle; acquiring an offset coordinate OPP of the coordinate PP relative to a minimum value of the bounding box of the 3D mesh model; calculating an actual projection maximum area A according to the bounding box data of the 3D mesh model; calculating a projection area of the 3D mesh model according to the offset coordinate OPP, the actual projection maximum area A and the projection maximum area PA of the set precision; converting the offset coordinate OPP into a set-precision offset coordinate POPP, setting data at a position of the set-precision offset coordinate POPP in a memory space to 1, counting a number YC of data with the value 1 in the memory space, and calculating the projection area of the 3D mesh model according to the number YC, the actual projection maximum area A and the projection maximum area PA of the set precision; the projection area of the 3D mesh model = A*YC / PA.

2. The method of claim 1, wherein, The method comprises: obtaining a length LAL of a bounding box of a set precision in two axial directions of the projection plane, the length LAL being greater than or equal to 0; acquiring a step length SL for traversing the centroid coordinates of the triangles according to the length LAL; traversing each centroid coordinate of the triangles according to the step length SL, and acquiring the coordinate PP of the point on the projection plane according to the centroid coordinate and the vertex coordinate of the triangle.

3. The method of claim 1, wherein, After acquiring the bounding box data of the 3D mesh model, the method comprises: selecting a set projection direction from three XYZ axial directions, and the projection plane being a plane composed of the remaining two axial directions; and the remaining two axial directions being respectively a first projection axis A1 and a second projection axis A2.

4. The method of claim 1, wherein, The method comprises: acquiring a minimum value A1SL in the axial direction of the first projection axis A1 and a minimum value A2SL in the axial direction of the second projection axis A2 according to the bounding box data of the 3D mesh model; subtracting the minimum value A1SL and the minimum value A2SL from the coordinate PP to obtain the offset coordinate OPP of the coordinate PP relative to the minimum value of the bounding box of the 3D mesh model. The method comprises:

5. The method of claim 2, wherein, SL = 1 / (LAL + 1).

6. A device for calculating the projection area of a 3D mesh model, characterized in that, The device comprises: a first acquiring module configured to acquire bounding box data of a 3D mesh model; a first calculating module configured to calculate a projection maximum area PA of a set precision on a preset projection plane according to the bounding box data of the 3D mesh model; a second acquiring module configured to acquire a bounding box of a 3D primitive on the projection plane according to a vertex of the 3D primitive in the 3D mesh model; The third obtaining module is configured to divide the 3D primitive of the N-polygon into N-2 triangles, wherein N is a positive integer greater than or equal to 3, and obtain the coordinate PP of the vertex in the projection plane according to the centroid coordinate of the triangle and the vertex coordinate of the triangle; The fourth obtaining module is configured to obtain the offset coordinate OPP of the coordinate PP relative to the minimum value of the bounding box of the 3D mesh model; The second calculating module is configured to calculate the actual maximum projection area A according to the bounding box data of the 3D mesh model; The third calculating module is configured to calculate the projection area of the 3D mesh model according to the offset coordinate OPP, the actual maximum projection area A, and the maximum projection area PA of the set precision. The offset coordinate OPP is converted into the offset coordinate POPP of the set precision, the data at the position of the offset coordinate POPP of the set precision in the memory space is set to 1, the number YC of the data with the value of 1 in the memory space is counted, the projection area of the 3D mesh model is calculated according to the number YC, the actual maximum projection area A, and the maximum projection area PA of the set precision, and the projection area of the 3D mesh model is A*YC / PA.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to realize the steps of the calculation method of the projection area of the 3D mesh model according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for calculating projection area of three-dimensional model

    JP1997259283A

  • Apparatus and method for information processing

    JP2002324093A