Three-dimensional component testing method, system and device and storage medium
By rendering 3D components and generating test instruction sequences using web-based graphics library tools, the problems of test complexity and subjective influence in existing technologies are solved, and efficient and reliable test result generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CISDI INFORMATION TECH CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-01
AI Technical Summary
Existing 3D component testing methods rely on specialized tools and are costly, have complex testing logic, low efficiency in test case design, and are easily affected by human subjectivity.
The system renders 3D component files using web-based graphics library tools, generates test instruction sequences, acquires rendering data based on preset test nodes, automatically analyzes test results, and generates test reports.
The testing process has been web-based, improving the efficiency of test case creation and application, and enhancing the reliability and accuracy of test results.
Smart Images

Figure CN121962453A_ABST
Abstract
Description
A three-dimensional component testing method, system, device, and storage medium Technical Field
[0001] This application relates to the field of development testing, and in particular to a three-dimensional component testing method, system, device and storage medium. Background Technology
[0002] With the continuous evolution of 3D graphics technology, 3D components, as core digital assets for building virtual scenes and interactive experiences, are increasingly being used in fields such as video games, virtual reality, augmented reality, digital twins, and industrial design. The geometric accuracy, material representation, animation smoothness, and operational correctness of 3D components determine the performance stability, visual appeal, and user interaction experience of the final application product. Therefore, comprehensive and efficient quality testing of 3D components has become a crucial step in the development and integration process.
[0003] Currently, the industry's testing of 3D components mainly relies on professional 3D modeling and testing tools, which are costly to purchase and maintain. Furthermore, these tools require testers to possess a high level of expertise in test logic, operational procedures, and script writing, making it difficult to rapidly deploy and execute test tasks on a large scale. Secondly, the design of test cases in existing testing solutions requires scripting or manual configuration across different modules, resulting in a fragmented testing process and low efficiency in test case application. Finally, existing methods often rely on subjective evaluation of test results by testers, which is easily influenced by experience and subjective judgment, making it difficult to guarantee the reliability of the test results. Summary of the Invention
[0004] The purpose of this application is to provide a three-dimensional component testing method, system, device, and storage medium to solve the above-mentioned technical problems.
[0005] This application provides a method for testing three-dimensional components. The method includes: acquiring a three-dimensional component file and rendering the three-dimensional component file using a web-based graphics library tool to obtain a three-dimensional component model; generating a sequence of test instructions for the three-dimensional component model in response to test information input from a user interface, and performing test operations according to the sequence of test instructions; acquiring node test rendering data of the three-dimensional component model based on preset test nodes, and determining node test results based on the comparison results between the node test rendering data and preset test boundary information; and generating a three-dimensional component test report based on all the node test results and displaying the three-dimensional component test report after the test operations are completed.
[0006] In one embodiment of this application, after obtaining the 3D component file, the method further includes: determining file type information based on the 3D component file; matching the corresponding 3D file parsing method based on the file type information, and parsing the 3D component file based on the corresponding 3D file parsing method to obtain 3D file information to be verified; performing file information verification on the 3D file information to be verified, and when the 3D file information to be verified passes the file information verification, performing a test item binding operation on the 3D component file, wherein the file information verification includes integrity verification and format verification, and the test item binding operation includes binding existing test items and binding newly created test items.
[0007] In one embodiment of this application, rendering the 3D component file based on a web graphics library tool includes: creating a canvas element in a webpage; obtaining the web graphics library context of the canvas element by calling the application programming interface provided by the canvas element; configuring the rendering parameters of the web graphics library context to obtain the web graphics library rendering context; calling the corresponding model loader according to the format type of the 3D component file, and reading the 3D model data according to the 3D component file, wherein the 3D model data includes vertex data, texture data, and material data; uploading the 3D model data to the storage area of the graphics processing unit for storage, and configuring the shader program, wherein the shader program includes a vertex shader and a fragment shader; and executing the rendering pipeline to obtain the 3D component model based on the 3D model data stored in the graphics processing unit and the web graphics library rendering context.
[0008] In one embodiment of this application, generating a test instruction sequence for the three-dimensional component model in response to test information input from the user interface includes: providing an instruction library and an instruction editing area in the user interface, the instruction library containing multiple test instructions, including rotation instructions, scaling instructions, and translation instructions for the three-dimensional component model; generating a test instruction sequence based on the selected test instruction in response to the user selecting at least one test instruction from the instruction library; or, reading the written test instruction in response to the user writing test instructions in the instruction editing area, and generating a test instruction sequence based on the written test instruction.
[0009] In one embodiment of this application, performing a test operation according to the test instruction sequence includes: parsing the test instruction sequence and converting the parsed test instruction sequence into an action instruction sequence, wherein the action instruction sequence is used to cause the 3D component model to perform a corresponding transformation operation; sending the action instructions in the action instruction sequence through the rendering control interface of the 3D component model, so that the 3D component model responds to the action instructions and updates the model pose, scaling ratio, or spatial position; and executing the transformation operation corresponding to each action instruction in sequence according to the order of the action instructions in the action instruction sequence, until all instructions in the action instruction sequence have been executed.
[0010] In one embodiment of this application, determining the node test result based on the comparison result between the node test rendering data and the preset test boundary information includes: if the preset test boundary information is a reference image, then the node test rendering data includes the model rendering image corresponding to the node; calculating the image similarity between the model rendering image and the reference image; if the image similarity is greater than or equal to a preset image similarity threshold, then the node test result is passed; if the preset test boundary information is a boundary value range, then the node test rendering data includes the model rendering parameters corresponding to the node; if the model rendering parameters fall within the boundary value range, then the node test result is passed.
[0011] In one embodiment of this application, generating a 3D component test report based on all the node test results includes: obtaining the identifier corresponding to the test item bound to the 3D component file; integrating the identifier corresponding to the test item, the 3D component file, the test instruction sequence, and the node test results of each preset test node to obtain test report text information; and visualizing the test report text information to generate a 3D component test report for display.
[0012] This application embodiment also provides a 3D component testing system, which includes: a component upload module for acquiring 3D component files; a project grouping management module for binding test projects to the 3D component files; a component loading engine for rendering the 3D component files based on a web-based graphics library tool to obtain a 3D component model; an instruction editing module for generating a sequence of test instructions for the 3D component model in response to test information input from the user interface; a test execution engine for performing test operations according to the sequence of test instructions; and a result analysis module for acquiring node test rendering data of the 3D component model based on preset test nodes, and determining node test results based on the comparison results of the node test rendering data and preset test boundary information; when the test operation is completed, generating a 3D component test report based on all the node test results, and displaying the 3D component test report.
[0013] This application also provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the three-dimensional component testing method as described in any of the above embodiments.
[0014] This application also provides a computer-readable storage medium storing computer-readable instructions that, when executed by a computer's processor, cause the computer to perform the three-dimensional component testing method as described in any of the above embodiments.
[0015] The beneficial effects of this application are as follows: This application provides a three-dimensional component testing method, system, device, and storage medium. It acquires a three-dimensional component file and renders it using a web-based graphics library tool to obtain a three-dimensional component model. Responding to test information input from the user interface, it generates a sequence of test instructions for the three-dimensional component model and performs test operations according to the sequence. Based on preset test nodes, it acquires node test rendering data of the three-dimensional component model and determines the node test results based on the comparison between the node test rendering data and preset test boundary information. When the test operations are completed, it generates a three-dimensional component test report based on all node test results and displays the report. This application utilizes a web-based graphics library tool to render the three-dimensional component file, realizing a web-based testing process, enabling test tasks to be executed more quickly and extensively. Furthermore, by responding to test information input from the user interface and generating a structured sequence of test instructions, it improves the efficiency of test case creation and application. Finally, by using data driven by preset test nodes for test result analysis and judgment, it enhances the reliability and accuracy of the test results.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without creative effort. In the drawings: Figure 1 is a schematic diagram of an exemplary system architecture illustrating an exemplary embodiment of this application; Figure 2 is a flowchart of a three-dimensional component testing method illustrating an exemplary embodiment of this application; Figure 3 is a schematic diagram of a three-dimensional component testing system illustrating an exemplary embodiment of this application; Figure 4 is a schematic diagram of the structure of a computer system of an electronic device illustrating an exemplary embodiment of this application. Detailed Implementation
[0018] The embodiments of this application will be described below with reference to the accompanying drawings and specific examples. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.
[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the illustrations only show the components related to this application and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.
[0021] The term "and / or" used in this application describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the related objects before and after it are in an "or" relationship.
[0022] In the process of implementing related technologies, the reliance on professional 3D modeling and testing tools complicates the deployment of the testing environment. Testers need to master specific testing logic and script writing skills, making it difficult to quickly deploy and execute testing tasks on a large scale. At the same time, test case design needs to be completed through script writing or manual configuration across modules, resulting in a fragmented testing process and low efficiency in the application of test cases. In addition, the evaluation of test results depends on the subjective experience and judgment of testers, making it difficult to guarantee the reliability of test results.
[0023] Based on the aforementioned technical problems and characteristics, this application proposes the following technical solution: A 3D component model is obtained by acquiring a 3D component file and rendering it using a web-based graphics library tool. Responding to test information input from the user interface, a sequence of test instructions is generated to perform test operations on the 3D component model. Node test rendering data of the 3D component model is acquired based on preset test nodes, and node test results are determined based on the comparison between the node test rendering data and preset test boundary information. When the test operation is completed, a 3D component test report is generated and displayed based on all node test results. By using a web-based graphics library tool to implement the test process in a web-based manner, test tasks can be executed more conveniently. The generation of structured test instruction sequences in response to user interface input improves the efficiency of test case creation and application. Finally, the accuracy of test result analysis is improved through automatic test result analysis based on preset test nodes.
[0024] Please refer to Figure 1, which is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of this application.
[0025] Referring to Figure 1, the system architecture may include a 3D component file 110 and a computer device 120. The computer device 120 acquires the 3D component file and renders it using a web-based graphics library tool to obtain a 3D component model. Responding to test information input from the user interface, it generates a sequence of test instructions for the 3D component model and performs test operations according to the sequence. Based on preset test nodes, it acquires node test rendering data of the 3D component model and determines the node test results based on the comparison between the node test rendering data and preset test boundary information. When the test operations are completed, it generates a 3D component test report based on all node test results and displays the report. The aforementioned 3D component file 110 is a graphical structure file of a 3D component developed from a 3D image or structure during development activities. The aforementioned computer device 120 refers to a computing power support terminal device that carries the program implementation environment for executing the 3D component testing method, including but not limited to personal computers, industrial control computers, embedded computers, and virtual computers.
[0026] This technical solution can be further discussed and analyzed in detail with multiple steps. Specific steps are shown in Figure 2, which is a flowchart illustrating a three-dimensional component testing method in an exemplary embodiment of this application. This three-dimensional component testing method can be executed in implementation environments supported by various operating systems, and the implementation environment is not specifically limited here. Referring to Figure 2, the flowchart of this three-dimensional component testing method includes at least steps S210 to S240, which are described in detail below: In step S210, a three-dimensional component file is obtained, and the three-dimensional component file is rendered based on a web-based graphics library tool to obtain a three-dimensional component model.
[0027] Among them, the 3D component file is a digital file containing information such as the geometry, texture, material, and animation of the 3D model, such as GLTF, OBJ, and FBX format files, which are the basic data for building virtual scenes and performing 3D interactions; the aforementioned web graphics library tool refers to a software library used to render and display 3D graphics in a web browser environment. In the embodiments of this application, 3D data is processed and displayed on a web page through WebGL; the aforementioned 3D component model is a visualized 3D object presented in virtual space after parsing and rendering the 3D component file.
[0028] In one embodiment of this application, after obtaining the 3D component file, the method further includes determining file type information based on the 3D component file. File type information, such as Gzip or BR format, can be determined by identifying the file extension or reading specific bytes or metadata of the file.
[0029] In one embodiment of this application, the corresponding 3D file parsing method is matched based on the file type information, and the 3D component file is parsed based on the corresponding 3D file parsing method to obtain the 3D file information to be verified.
[0030] Based on the determined file type information, a parser or library specifically designed for that format is selected. This can be done through a configuration table mapping file types to parsers. The corresponding parser is then located in the table based on the file type information, and the appropriate plugin is loaded and invoked for parsing. For example, if the file type is Gzip, the zlib library is used for decompression; if the file type is BR, the Brotli algorithm is used for decompression.
[0031] In one embodiment of this application, file information verification is performed on the 3D file information to be verified, and when the 3D file information passes the file information verification, a test item binding operation is performed on the 3D component file. The aforementioned file information verification includes integrity verification and format verification, and the aforementioned test item binding operation includes binding existing test items and binding newly created test items.
[0032] Integrity verification is used to ensure that all necessary data elements exist and are not missing, such as checking whether the model contains necessary geometric data, whether the texture path is valid, and whether the material parameters are complete. Integrity verification can be performed by comparing hash values. Format verification, on the other hand, is used to ensure that the structure and content of the data meet the expected specifications, such as checking whether the vertex index exceeds the vertex array range, whether the normal vector is valid, and whether the UV coordinates are within a reasonable range. For example, for GLTF format files, it checks whether they contain necessary elements such as scene, nodes, and mesh.
[0033] In one embodiment of this application, binding test projects to 3D component files refers to associating specific test tasks or test cases with the current 3D component files, including binding existing test projects and creating new test projects. Binding existing test projects allows the user to select one or more from a predefined list of test projects and associate them with the current 3D component file; binding new test projects allows the user to create a completely new test project for the current 3D component file and save the new test project. The information of the existing test projects is stored in a relational database, with each test project corresponding to one record. Each test project container is assigned a unique identifier, generated using a UUID (Universally Unique Identifier), used for project management and identification. The binding operation can be performed by establishing an association table between 3D component files and test projects in the relational database, recording the correspondence between 3D component files and test projects. One 3D component file can be associated with multiple test projects, and one test project can contain multiple 3D component files.
[0034] When creating a new test project, a project creation interface is provided, allowing users to enter project information such as project name, test objectives, and test cycle.
[0035] The embodiments of this application solve the problem of test failure or inefficiency caused by input file quality issues, ensuring that only valid and compliant 3D component files can be used for subsequent rendering and testing processes, thereby improving the accuracy of the entire testing method.
[0036] In one embodiment of this application, a canvas element is created in a webpage, and the webpage graphics library context of the canvas element is obtained by calling the application programming interface provided by the canvas element, configuring the rendering parameters of the webpage graphics library context, and thus obtaining the webpage graphics library rendering context.
[0037] A canvas tag is created in a webpage as a rendering carrier, providing a programmable drawing area. This canvas element provides an application programming interface (API) that allows developers to access and control the canvas programmatically. The WebGL rendering context can be obtained using canvas.getContext('webgl'). This webpage graphics library context encapsulates the state and functionality of graphics rendering and serves as the interface for interacting with the underlying graphics hardware or software renderer. Configuring rendering parameters for the webpage graphics library context includes, but is not limited to, viewport size, depth test, backface culling, blending mode, color buffer, depth buffer, and stencil buffer.
[0038] In one embodiment of this application, the corresponding model loader is invoked according to the format type of the 3D component file, and the 3D model data, including vertex data, texture data and material data, is read from the 3D component file. The 3D model data is uploaded to the storage area of the graphics processing unit for storage, and the shader program is configured. Based on the 3D model data stored in the graphics processing unit and the rendering context of the web graphics library, the rendering pipeline is executed to obtain the 3D component model shader program, including vertex shaders and fragment shaders.
[0039] The appropriate model loader is invoked based on the format of the 3D component file. This model loader is a software module or function specifically designed to parse 3D model files of a particular format and extract the data required for rendering. The aforementioned 3D model data comprises all the geometric and appearance information that constitutes the 3D model, including vertex data (vertex coordinates, normal vectors, texture coordinates), texture data (image data describing the surface pattern of the model), and material data (data describing the optical properties of the model surface, such as color, gloss, transparency, and reflectivity). In some feasible environments, GLTF format files are loaded using GLTFLoader from the Three.js library; FBX format files are loaded using FBXLoader.
[0040] In one embodiment of this application, the graphics processing unit (GPU) is hardware used to process graphics rendering tasks. Its storage area is the high-speed video memory inside the GPU, used to store data required for rendering, such as vertex buffer objects, index buffer objects, textures, etc. The shader program is a program that runs on the GPU and is used to control various stages of graphics rendering. The vertex shader processes the data of each vertex, is responsible for calculating the final position of the vertex on the screen, and can pass other data to the fragment shader. The fragment shader processes the data of each pixel, and combines texture data and material data to calculate the final color of the pixel.
[0041] In one embodiment of this application, the rendering pipeline refers to the entire processing flow of graphics rendering from 3D model data to the final screen pixels, including multiple stages such as vertex processing, primitive assembly, rasterization, fragment processing, depth testing, and blending, to obtain a three-dimensional component model.
[0042] The embodiments of this application ensure that the 3D component model can be accurately and smoothly presented on the user interface, providing a reliable visual foundation for subsequent test instruction generation and test operations, enabling complex 3D component files to be rendered quickly and accurately on the web page, ensuring the smooth progress of the test process and the accuracy of the test results.
[0043] In step S220, in response to the test information input from the user interface, a test instruction sequence for the 3D component model is generated, and test operations are performed according to the test instruction sequence.
[0044] In one embodiment of this application, a command library and a command editing area are provided in the user interface. The command library contains multiple test commands, including rotation, scaling, and translation commands for a 3D component model. In response to a user selecting at least one test command from the command library, a test command sequence is generated based on the selected test command; or, in response to a user writing test commands in the command editing area, the written test commands are read, and a test command sequence is generated based on the written test commands.
[0045] The user interface (UI) is a graphical interface for user interaction. Users can input test-related information, view the test process and results, and it can be built using HTML, CSS, and JavaScript. It includes a command library and a command editing area. The command library is a collection of predefined test commands, providing users with convenient command selection. The command library can contain various types of test commands, including but not limited to rotation, scaling, and translation commands for 3D component models. Commands can be presented on the UI as lists, icons, or drop-down menus for direct user selection. It also supports the addition and management of custom commands to adapt to more complex testing needs. Each command includes a command name, parameter description, and function description. Detailed command information can be viewed by clicking or selecting a command entry.
[0046] The aforementioned instruction editing area is where users write or modify test instructions. It can include a text input box, allowing users to write test instructions using specific syntax. In some other embodiments, a visual editor can be used to construct instruction sequences through drag-and-drop, connecting graphical modules, and other methods. This instruction editing area features syntax highlighting, auto-completion, and error messages to improve user writing efficiency and accuracy.
[0047] In one embodiment of this application, the user interface also includes a preview area, which can display the logical flow of the edited test instruction sequence in real time, and show the execution order and dependencies between instructions in the form of a flowchart in some feasible environments.
[0048] The aforementioned test information refers to various parameters and instructions provided by the user to the system through the user interface to guide the testing of 3D components, such as rotation angle, scaling ratio, translation distance, etc.
[0049] In one embodiment of this application, a user can select one or more preset test instructions from the instruction library by clicking, dragging, or typing with a mouse. After receiving the user's selection operation, the selected instructions are used as components of a test instruction sequence, and the selected test instructions are combined according to time sequence or execution logic to form a complete test instruction sequence.
[0050] In the embodiments of this application, by providing an instruction library and instruction editing area in the user interface, a high degree of flexibility is provided, which can meet various complex testing needs, making the generation of test instruction sequences efficient and flexible.
[0051] In one embodiment of this application, the test instruction sequence is parsed and converted into an action instruction sequence, which is used to cause the three-dimensional component model to perform corresponding transformation operations.
[0052] The system utilizes a lexical analyzer and a syntax analyzer to perform syntactic analysis and semantic understanding on command sequences selected by the user from the command library or written in the command editing area, identifying command types, parameters, and other information. The parsed command types and parameters are then further converted into low-level operation commands that the 3D component model rendering engine can directly understand and execute. This can be done based on a mapping table or a preset conversion rule set, mapping each test command type to its corresponding rendering control interface function call and its parameters. Specifically, for rotation commands, the rotation axis and rotation angle are determined; for scaling commands, the scaling ratio in the x, y, and z axes is determined; and for specific business-related commands, they are converted into corresponding operations according to preset business logic. For example, a "play animation" command is converted into a call to the animation playback interface of the 3D component model.
[0053] In one embodiment of this application, motion commands in the motion command sequence are sent through the rendering control interface of the 3D component model, so that the 3D component model responds to the motion commands and updates the model pose, scaling ratio or spatial position; according to the order of the motion commands in the motion command sequence, the transformation operation corresponding to each motion command is executed sequentially until all commands in the motion command sequence are executed.
[0054] In one embodiment of this application, the rendering control interface is a function that allows the 3D component model to interact with external control logic, enabling external programs to modify the rendering state, geometric properties, or transformation parameters of the model, and changing the rendering result of the model by updating the transformation matrix of the 3D component model.
[0055] In the embodiments of this application, by converting the abstract test instruction sequence input by the user into an action instruction sequence that can be directly executed by the 3D component model, and driving the model to transform strictly according to the sequence order, the automated and accurate testing of the 3D component model is realized, which can combine the user's intention with the actual operation of the model.
[0056] In step S230, node test rendering data of the 3D component model is obtained based on preset test nodes, and node test results are determined based on the comparison results between the node test rendering data and preset test boundary information.
[0057] The preset test nodes include preset time nodes and preset test stage nodes. The preset time nodes can be set periodically according to the accuracy requirements of the test results feedback, and the preset test nodes are set based on the set period. The preset test stage nodes divide the test process into different stages, such as one-third of the test progress, half of the test progress, etc. The test progress can be specifically divided according to the test instruction sequence.
[0058] In one embodiment of this application, if the preset test boundary information is a reference image, then the node test rendering data includes the model rendering image corresponding to the node, the image similarity between the model rendering image and the reference image is calculated, and when the image similarity is greater than or equal to the preset image similarity threshold, the node test result is passed.
[0059] The aforementioned reference images are pre-set image data used as test benchmarks, representing the correct rendering state that the 3D component model should have at a specific test node. They can be generated by manually capturing or rendering images of a known correct 3D component model under specific viewpoints and lighting conditions. The model rendering image corresponding to the node refers to the image actually rendered by the 3D component model at a specific preset test node during the test process. It can be obtained by taking a screenshot or reading the frame buffer under specific viewpoints and lighting conditions after executing the test command sequence.
[0060] In the embodiments of this application, the Structural Similarity Index (SSIM) algorithm can be used to measure image similarity in terms of brightness, contrast and structure. In some other feasible environments, algorithms such as Mean Squared Error (MSE) can also be used to calculate the similarity between images.
[0061] In one embodiment of this application, if the preset test boundary information is a boundary value range, then the node test rendering data includes the model rendering parameters corresponding to the node. If the model rendering parameters fall within the boundary value range, then the node test result is passed.
[0062] In one embodiment of this application, the boundary value range in the preset test boundary information can be determined by manually analyzing or according to design specifications, setting minimum and maximum values for specific attributes of the model, and constructing a range based on a certain tolerance. When determining whether the model rendering parameters fall within the boundary value range, for a single parameter, it is directly determined whether it is greater than or equal to the minimum value and less than or equal to the maximum value. For multiple parameters, the multiple parameters can be combined into a vector, and it is determined whether it falls within the spatial region of the vector corresponding to the boundary value range.
[0063] In one embodiment of this application, during the test operation according to the test instruction sequence, information such as the execution time and execution status of the test instruction sequence is recorded and logged.
[0064] In step S240, when the test operation is completed, a three-dimensional component test report is generated based on the test results of all nodes, and the three-dimensional component test report is displayed.
[0065] In one embodiment of this application, the identifier corresponding to the test item bound to the 3D component file is obtained, and the identifier corresponding to the test item, the 3D component file, the test instruction sequence and the node test results of each preset test node are integrated to obtain test report text information. The test report text information is then visualized to generate a 3D component test report for display.
[0066] In one embodiment of this application, the identifier of the test project associated with the currently being tested 3D component file is identified. The name or identifier of the test project associated with the current 3D component file can be retrieved and obtained based on its unique identifier. The 3D component files, test instruction sequences, and node test results of each preset test node generated during the testing process are aggregated and combined with the identifiers corresponding to the test projects to form structured raw text data. This data structure can be concatenated and formatted to form test report text information in JSON, XML, or plain text format. The structured raw text information is then converted into a graphical report format, including using tables to display the test results of each node, using charts to summarize the pass and failure rates, and using color coding to indicate the pass or failure status of nodes. The text information is also converted into PDF, Word documents, or other printable formats.
[0067] This application provides a 3D component testing method. It acquires a 3D component file and renders it using a web-based graphics library tool to obtain a 3D component model. Responding to test information input from the user interface, it generates a sequence of test instructions for the 3D component model and performs test operations according to this sequence. Based on preset test nodes, it acquires node test rendering data of the 3D component model and determines the node test results based on the comparison between the node test rendering data and preset test boundary information. Once the test operations are completed, it generates and displays a 3D component test report based on all node test results. This application utilizes a web-based graphics library tool to render the 3D component file, enabling the test tasks to be executed more quickly and extensively. Furthermore, by responding to test information input from the user interface and generating a structured sequence of test instructions, it improves the efficiency of test case creation and application. Finally, by using data driven by preset test nodes for test result analysis and judgment, it enhances the reliability and accuracy of the test results.
[0068] The following describes a system embodiment of this application, which can be used to execute the three-dimensional component testing method in the above embodiments of this application. For details not disclosed in the system embodiments of this application, please refer to the embodiments of the three-dimensional component testing method described above.
[0069] Figure 3 is a schematic diagram of a three-dimensional component testing system according to an exemplary embodiment of this application. This system can be applied to the method implementation process shown in Figure 1 and is specifically configured in a device with the necessary execution conditions. This embodiment does not impose specific limitations on the devices to which this system is applicable.
[0070] As shown in Figure 3, the exemplary three-dimensional component testing system includes: a component upload module 301, a project group management module 302, a component loading engine 303, an instruction editing module 304, a test execution engine 305, and a result analysis module 306.
[0071] The system comprises the following modules: a component upload module 301 for acquiring 3D component files; a project grouping management module 302 for binding test projects to the 3D component files; a component loading engine 303 for rendering the 3D component files using a web-based graphics library tool to obtain 3D component models; an instruction editing module 304 for generating a sequence of test instructions for the 3D component models in response to test information input from the user interface; a test execution engine 305 for performing test operations according to the test instruction sequence; and a result analysis module 306 for acquiring node test rendering data of the 3D component models based on preset test nodes and determining node test results based on the comparison between the node test rendering data and preset test boundary information. Once the test operations are completed, a 3D component test report is generated based on all node test results and displayed.
[0072] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the three-dimensional component testing method provided in the above embodiments.
[0073] Figure 4 is a schematic diagram illustrating the structure of a computer system for an electronic device according to an exemplary embodiment of this application. It should be noted that the computer system 400 for the electronic device shown in Figure 4 is merely an example and should not impose any limitations on the functionality or scope of use of the embodiments of this application.
[0074] As shown in Figure 4, the computer system 400 includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 402 or programs loaded from storage into Random Access Memory (RAM) 403, such as executing the methods described in the above embodiments. The RAM 403 also stores various programs and data required for system operation. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus. An I / O interface 405 is also connected to the bus 404, where the I / O interface 405 refers to an input / output interface.
[0075] The following components are connected to I / O interface 405: an input section 406 including a keyboard, mouse, etc.; an output section 407 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section performs communication processing via a network such as the Internet. A drive is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 410 as needed so that computer programs read from them can be installed into storage section 408 as needed.
[0076] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs various functions defined in the system of this application.
[0077] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0079] In the corresponding figures of the above embodiments, connecting lines can represent the connection relationship between various components, indicating more constitutive signal paths and / or one or more ends of some lines having arrows to indicate the main information flow direction. Connecting lines are an identifier and are not a limitation on the scheme itself, but rather, using these lines in conjunction with one or more exemplary embodiments helps to more easily connect circuits or logic units. Any signal represented (determined by design requirements or preferences) can actually include one or more signals that can be transmitted in any direction and can be implemented in any suitable type of signal scheme.
[0080] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0081] Another aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.
[0082] Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements a three-dimensional component testing method as described in any of the above embodiments.
[0083] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0084] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.
[0085] This application can be used in a wide range of general-purpose or special-purpose computing system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0086] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0087] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A three-dimensional component testing method, characterized in that, The three-dimensional component testing method includes: acquiring a three-dimensional component file and rendering the three-dimensional component file using a web-based graphics library tool to obtain a three-dimensional component model; generating a test instruction sequence for the three-dimensional component model in response to test information input from the user interface, and performing test operations according to the test instruction sequence; acquiring node test rendering data of the three-dimensional component model based on preset test nodes, and determining node test results based on the comparison results between the node test rendering data and preset test boundary information; and generating a three-dimensional component test report based on all the node test results and displaying the three-dimensional component test report after the test operations are completed.
2. The three-dimensional component testing method according to claim 1, characterized in that, After obtaining the 3D component file, the process further includes: determining file type information based on the 3D component file; matching the corresponding 3D file parsing method based on the file type information, and parsing the 3D component file based on the corresponding 3D file parsing method to obtain 3D file information to be verified; performing file information verification on the 3D file information to be verified, and when the 3D file information to be verified passes the file information verification, performing a test item binding operation on the 3D component file. The file information verification includes integrity verification and format verification, and the test item binding operation includes binding existing test items and binding newly created test items.
3. The three-dimensional component testing method according to claim 1, characterized in that, Rendering the 3D component file using a web-based graphics library tool includes: creating a canvas element in a webpage; obtaining the web-based graphics library context of the canvas element by calling the application programming interface provided by the canvas element; configuring the rendering parameters of the web-based graphics library context to obtain the web-based graphics library rendering context; calling the corresponding model loader according to the format type of the 3D component file, and reading the 3D model data according to the 3D component file, the 3D model data including vertex data, texture data, and material data; uploading the 3D model data to the storage area of the graphics processing unit for storage, and configuring the shader program, the shader program including vertex shaders and fragment shaders; and executing the rendering pipeline based on the 3D model data stored in the graphics processing unit and the web-based graphics library rendering context to obtain the 3D component model.
4. The three-dimensional component testing method according to claim 1, characterized in that, In response to test information input from the user interface, generating a test instruction sequence for the 3D component model includes: providing an instruction library and an instruction editing area in the user interface, the instruction library containing multiple test instructions, including rotation, scaling, and translation instructions for the 3D component model; responding to the user selecting at least one test instruction from the instruction library, generating a test instruction sequence based on the selected test instruction; or, responding to the user's operation of writing test instructions in the instruction editing area, reading the written test instructions, and generating a test instruction sequence based on the written test instructions.
5. The three-dimensional component testing method according to claim 4, characterized in that, The test operation based on the test instruction sequence includes: parsing the test instruction sequence and converting the parsed test instruction sequence into an action instruction sequence, wherein the action instruction sequence is used to cause the 3D component model to perform corresponding transformation operations; sending the action instructions in the action instruction sequence through the rendering control interface of the 3D component model, so that the 3D component model responds to the action instructions and updates the model pose, scaling ratio, or spatial position; and executing the transformation operations corresponding to each action instruction in sequence according to the order of the action instructions in the action instruction sequence, until all instructions in the action instruction sequence have been executed.
6. The three-dimensional component testing method according to claim 1, characterized in that, Determining the node test result based on the comparison between the node test rendering data and the preset test boundary information includes: if the preset test boundary information is a reference image, then the node test rendering data includes the model rendering image corresponding to the node; calculating the image similarity between the model rendering image and the reference image; if the image similarity is greater than or equal to a preset image similarity threshold, then the node test result is passed; if the preset test boundary information is a boundary value range, then the node test rendering data includes the model rendering parameters corresponding to the node; if the model rendering parameters fall within the boundary value range, then the node test result is passed.
7. The three-dimensional component testing method according to any one of claims 1-6, characterized in that, Generating a 3D component test report based on all the node test results includes: obtaining the identifier corresponding to the test item bound to the 3D component file; integrating the identifier corresponding to the test item, the 3D component file, the test instruction sequence, and the node test results of each preset test node to obtain test report text information; and visualizing the test report text information to generate a 3D component test report for display.
8. A three-dimensional component testing system, characterized in that, The 3D component testing system includes: a component upload module for acquiring 3D component files; a project grouping management module for binding test projects to the 3D component files; a component loading engine for rendering the 3D component files using a web-based graphics library tool to obtain a 3D component model; an instruction editing module for generating a sequence of test instructions for the 3D component model in response to test information input from the user interface; a test execution engine for performing test operations according to the sequence of test instructions; and a result analysis module for acquiring node test rendering data of the 3D component model based on preset test nodes, and determining node test results based on the comparison results between the node test rendering data and preset test boundary information. When the test operation is completed, a 3D component test report is generated based on all the node test results, and the 3D component test report is displayed.
9. An electronic device, characterized in that, It includes a processor, a memory, and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the three-dimensional component testing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that enables the computer to perform the three-dimensional component testing method as described in any one of claims 1-7.