CAD-oriented interactive and parametric modeling automatic testing method and system

By binding and converting mouse screen coordinates and three-dimensional world coordinates in CAD automation testing, the problem of difficulty in covering all user operation types in the existing technology is solved, and high-precision interactive modeling test is realized, which improves the comprehensiveness and reliability of the test.

CN120104509AActive Publication Date: 2025-06-06ZHEJIANG HUADONG ENG DIGITAL TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510588230.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-06-06
Estimated Expiration
2045-05-08

AI Technical Summary

Technical Problem

The existing CAD automated testing methods are difficult to cover all user operation types during interactive free modeling and parameterized modeling, resulting in reduced comprehensiveness and reliability of the test.

Method used

By binding the mouse screen coordinates and three-dimensional world coordinates during the script recording stage, and introducing coordinate conversion and comparison mechanisms in the script playback stage, we ensure the accurate execution of mouse operation instructions and adapt to different test environments.

Benefits of technology

It realizes high-precision reproduction of interactive free modeling and parameterized modeling operations across environments, improving the comprehensiveness, accuracy and reliability of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104509A_ABST
    Figure CN120104509A_ABST
Patent Text Reader

Abstract

The invention provides a CAD (computer-aided design)-oriented interactive and parametric modeling automatic testing method, which comprises the following steps of: S10, starting a script recording mode, and capturing all user modeling operation instructions; step S20, serializing a user modeling operation instruction, associating a mouse screen coordinate recorded in a mouse operation instruction with a corresponding three-dimensional world coordinate, and writing into a script file; step S30, starting a script playback mode and loading a script file; and step S40, analyzing the script file, sequentially deserializing to generate a user modeling operation instruction, for the mouse operation instruction, calculating to obtain a reconstructed mouse screen coordinate by taking the three-dimensional world coordinate in the script file as a reference and combining the viewport size, the camera transformation matrix and the working plane parameter in the current test operation environment, and performing the operation of the user modeling operation instruction. And updating a mouse operation instruction according to the reconstructed screen coordinate, and executing the updated user modeling operation instruction. According to the method disclosed by the invention, full user operation types are supported, and the comprehensiveness and accuracy of the test are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of engineering digitalization technology, and in particular to a CAD-oriented interactive and parametric modeling automated testing method and system. Background Art

[0002] Computer Aided Design (CAD) is a technology that uses computers and their graphics devices to assist designers in design work. During the CAD modeling process, users need to perform a large number of interactive operations, including editing, zooming in, zooming out, translating, rotating, and parametric modeling of graphics. In order to ensure the stability and functional integrity of CAD software, automated testing is an important part of software development and maintenance. At present, the mainstream CAD automated testing method mainly adopts the method of script recording and playback to realize automated testing by recording user operation instructions.

[0003] However, since CAD modeling involves complex three-dimensional spatial interactions, the existing recording and playback mechanisms have certain limitations and are difficult to cover all types of user operations. Especially in the process of interactive free modeling and parametric modeling, some operation instructions cannot be correctly recorded or played back, and the user's real operations cannot be simulated, which reduces the comprehensiveness and reliability of the test. Summary of the invention

[0004] The present invention provides an interactive and parametric modeling automated testing method and system for CAD, which can support a full range of user operation types, achieve high-precision reproduction of interactive free modeling and parametric modeling operations across environments, and ensure the comprehensiveness, accuracy and reliability of the test.

[0005] In a first aspect, the present disclosure provides a CAD-oriented interactive and parametric modeling automated testing method, comprising: Step S10, starting the script recording mode to capture all user modeling operation instructions; Step S20, serializing the user modeling operation instruction, and associating the mouse screen coordinates recorded in the mouse operation instruction with the corresponding three-dimensional world coordinates, and writing them into a script file; Step S30, start the script playback mode and load the script file; Step S40, parse the script file, deserialize in sequence to generate user modeling operation instructions, and execute the user modeling operation instructions. For mouse operation instructions, take the three-dimensional world coordinates in the script file as a reference, combine the viewport size, camera transformation matrix and working plane parameters in the current test running environment, and calculate the reconstructed mouse screen coordinates; compare the reconstructed mouse screen coordinates with the recorded mouse screen coordinates, if the comparison results are consistent, execute the current mouse operation instructions according to the recorded mouse screen coordinates; if the comparison results are inconsistent, update the current mouse operation instructions according to the reconstructed mouse screen coordinates, execute the updated mouse operation instructions, and record the inconsistent comparison results in the first error report.

[0006] In some embodiments, the user modeling operation instructions include file operation instructions, mouse operation instructions, keyboard operation instructions, tool command instructions, tool setting data operation instructions and attribute operation instructions.

[0007] In some embodiments, the three-dimensional world coordinates are generated by the following steps: Maps the mouse screen coordinates to 3D world coordinates according to the current viewport size, camera transformation matrix, and working plane parameters.

[0008] In some embodiments, the step S20 further includes: if the user's operation is based on editing the initial model file, the initial model file is synchronously saved into the script file.

[0009] In some embodiments, the method further comprises: Step S50, monitoring the process of executing the user modeling operation instructions in the test playback, if there is an abnormality, crash or no response, the test is determined to be failed and a second error report is generated; if all user modeling operation instructions are executed and there is no abnormality, the test model file is output; Step S60, compare the test model with the reference model during recording. If they are completely consistent, it is determined that the system modeling function test has passed; if there is an inconsistency, it is determined that the test has failed and a second error report is generated.

[0010] In some embodiments, in step S60, the modeling result is verified through geometric consistency verification and attribute consistency verification.

[0011] In a second aspect, the present disclosure provides a CAD-oriented interactive and parametric modeling automated testing system, which is used to execute the CAD-oriented interactive and parametric modeling automated testing method as described above, and the system includes: The recording start module is used to start the script recording mode and capture all user modeling operation instructions; The script generation module is used to serialize the user modeling operation instructions, associate the mouse screen coordinates recorded in the mouse operation instructions with the corresponding three-dimensional world coordinates, and write them into the script file; The playback startup module is used to start the script playback mode and load the script file; A script playback module is used to parse script files, deserialize them in sequence to generate user modeling operation instructions, and execute the user modeling operation instructions. For mouse operation instructions, the three-dimensional world coordinates in the script file are used as a reference, combined with the viewport size, camera transformation matrix and working plane parameters in the current test running environment, to calculate the reconstructed mouse screen coordinates; compare the reconstructed mouse screen coordinates with the recorded mouse screen coordinates. If the comparison results are consistent, the current mouse operation instructions are executed according to the recorded mouse screen coordinates; if the comparison results are inconsistent, the current mouse operation instructions are updated according to the reconstructed mouse screen coordinates, the updated mouse operation instructions are executed, and the inconsistent comparison results are recorded in the first error report.

[0012] In some embodiments, the system further comprises: The test run monitoring module is used to monitor the process of executing user modeling operation instructions during test playback. If there are exceptions, crashes or no responses, the test is judged to have failed and a second error report is generated. If all user modeling operation instructions are executed and there are no exceptions, the test model file is output.

[0013] The model verification module is used to compare the test model with the reference model during recording. If they are completely consistent, the system modeling function test is determined to have passed; if there is an inconsistency, the test is determined to have failed and a second error report is generated.

[0014] The beneficial effects of the present disclosure are that, compared with the prior art, the present disclosure has the following advantages: The test method provided by the present invention binds and records the mouse screen coordinates and the three-dimensional world coordinates in the script recording stage, and adds a pre-coordinate conversion step when executing the mouse operation instructions in the script playback stage, so that the mouse coordinates are no longer affected by factors such as the viewport size and camera parameter changes in the test environment during script playback, thereby achieving high-precision restoration of user operations, simulating real user operations, thereby improving the stability of the test and facilitating the implementation of cross-environment testing.

[0015] Therefore, the testing method disclosed in the present invention can support the full range of user operation types. Within a known range, all user operations will be recorded in the script file and accurately restored during playback, achieving high-precision reproduction of interactive free modeling and parametric modeling operations across environments, ensuring the comprehensiveness, accuracy and reliability of the test.

[0016] In addition, the test method disclosed in the present invention combines the real-time abnormal monitoring mechanism during the test operation and the comparison and verification of the modeling results, which can timely discover potential problems and verify the correctness of the modeling / editing operations, so that the test system can better adapt to the complex CAD modeling test requirements. For the case where the reconstructed mouse screen coordinates are deviated, it is an error that does not affect the core function test, and it is classified as a warning level error so that the tester can view and analyze the test operation report of the error when necessary. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0018] Figure 1 A schematic diagram of a CAD platform framework provided in an embodiment of the present disclosure; Figure 2 A schematic diagram of a CAD-oriented interactive and parametric modeling automated testing method flow chart provided in an embodiment of the present disclosure; Figure 3 A schematic diagram of another CAD-oriented interactive and parametric modeling automated testing method flow provided in an embodiment of the present disclosure; Figure 4 A schematic diagram of different representation methods of coordinates corresponding to a user's mouse operation in multiple coordinate systems provided in an embodiment of the present disclosure;

[0019] Figure 5 A schematic diagram of the front-end UI interface of the CAD platform provided in the embodiment of the present disclosure;

[0020] Figure 6 A schematic diagram of an interactive and parametric modeling automated testing system for CAD provided in an embodiment of the present disclosure.

[0021] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0022] The present disclosure is further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present disclosure, and cannot be used to limit the protection scope of the present disclosure.

[0023] The sequence of steps in the present disclosure is for illustrative purposes only. In actual implementation, the sequence may be adjusted as needed, or some steps may be executed in parallel. Unless the execution of a certain step is clearly dependent on the result of the previous step, the sequence between the steps does not constitute a limitation on the present disclosure.

[0024] Figure 1 It is the CAD platform framework used in the embodiments of the present disclosure, including a front-end module, an interactive center, and a back-end module. Among them, the front-end module is used for display and user interaction, receiving all user operation instructions, and sending the operation instructions to the interactive center. The interactive center serves as the distribution center of all operation instructions, and transmits the received user operation instructions and response results between the front and back ends. The back-end module is used to respond to user operation instructions.

[0025] It should be noted that the deployment forms of the back-end module include local stand-alone services, cloud computing nodes or distributed server clusters, and this application does not make specific limitations on this.

[0026] like Figure 2 As shown, the first embodiment of the present disclosure proposes an interactive and parametric modeling automated testing method for CAD, comprising: Step S10, start the script recording mode to capture all user modeling operation instructions.

[0027] Script recording refers to recording the user's operation process on the front end of the CAD platform and recording the user's operation in a special way.

[0028] Specifically, the user starts the automated test script recording mode and captures the operation instructions input by the user at the front end of the CAD platform in real time through the interactive center.

[0029] In some embodiments, user modeling operations include file operations, mouse operations, keyboard operations, tool command operations, tool setting data operations, and attribute operations.

[0030] See also Figure 5 In a shown example, the UI interface of the CAD platform is composed of multiple UI functional components arranged in different areas, including the drawing area (work area), tool setting panel component, resident command interaction component, property panel component, message display component, menu and toolbar component, etc. Specifically, the UI interface is divided into six areas: A, B, C, D, E, and F, which are: Area A: Menu and toolbar component; Area B: Property panel component; Area C: Tool setting view component; Area D: Drawing area (work area); Area E: Message display component; Area F: resident command interaction component.

[0031] In the embodiment of the present disclosure, the mouse operation and the keyboard operation include operations such as movement, clicking, scrolling, and keyboard key input performed by the user in the drawing area (area D) based on the mouse or keyboard.

[0032] In the CAD platform, the main way of interactive free modeling is the mouse and keyboard, which are used to operate the 3D model, control the 3D view (translation, rotation, zoom), pick up 3D points in space, create / select / edit models, and other operations.

[0033] Parametric modeling also requires the coordinated operation of the mouse and keyboard. For example, when creating a parametric geometric shape, you can first draw the basic outline with the mouse, and then use the keyboard to enter parameters to control the complexity of the shape, such as the radius of the arc, the number of sides of the polygon, etc., to meet the actual modeling needs.

[0034] It should be noted that in the embodiment of the present disclosure, "mouse operation instructions" specifically refer to mouse operation instructions executed in the drawing area (area D), which are used to complete model element picking, obtaining point coordinates, etc., as well as view operations (translation / rotation / zooming, etc.).

[0035] In contrast, mouse events in other areas of the UI interface are processed by the front-end module and will not be passed to the back-end module. For example, when a user clicks the "draw line" button, the front-end module will process the click event, interpret the behavior of clicking the draw line button as starting the line drawing tool, and construct a tool command to start the line drawing tool, which is passed to the back-end module. The back-end module starts the line drawing tool according to the tool command. In other words, unlike the "mouse operation instructions" in this embodiment, mouse events in other areas of the UI interface can be considered global, and each interactive tool requires the cooperation of the mouse and keyboard.

[0036] In the embodiments of the present disclosure, tool commands refer to instructions used by users to switch and call various tools to complete modeling operations during the modeling process. The tools include two-dimensional primitive graphics drawing, two-dimensional complex line / graphics drawing, three-dimensional primitive entity creation, three-dimensional complex entity creation, etc.

[0037] For example, users can switch different tools (such as drawing, stretching, rotating, etc.) through tool commands to perform modeling according to modeling / editing needs; In the disclosed embodiment, the tool setting data operation is used to specify various input tool setting data of the modeling tool operation parameters, for example, the cube drawing tool setting data includes: whether orthogonal, whether to specify the length, length, whether to specify the width, width, whether to specify the height, height.

[0038] In the disclosed embodiment, property operation refers to the global operation of viewing, adding, deleting, modifying and querying model properties (including basic properties such as color, line type, line width, transparency, layer, and custom extended properties) by selecting a CAD model when the property component is in the display state during system operation.

[0039] In the disclosed embodiment, file operations include creating, opening, saving and closing files.

[0040] In some embodiments, starting the script recording mode is to initialize the system for script recording, which specifically includes: starting the CAD platform from the automated test mode entry, turning on the script recording switch in the interactive center message receiving interface, so that the received user modeling operation instructions can be written into the script file (for example, the script file can be written through a script writer object).

[0041] Step S20, serializing the user modeling operation instructions, and associating the recorded mouse screen coordinates in the mouse operation instructions with the corresponding three-dimensional world coordinates, and writing them into a script file.

[0042] Specifically, to ensure the simulation of real user scenarios, all instructions sent from the front-end module to the interaction center are captured and recorded during script recording to form an instruction sequence, which is then written into the script file one by one in the chronological order of the operations. In this process, the mouse screen coordinates ( X s ,Y s ) and the corresponding three-dimensional world coordinates ( X w ,Y w ,Z w ) to associate the corresponding three-dimensional world coordinates ( X w ,Y w ,Z w ) is saved synchronously to the script file; when the recording is completed, the system will automatically save the script file and exit the recording mode.

[0043] The recorded mouse screen coordinates refer to the mouse screen coordinates recorded in the script file in the recording mode.

[0044] like Figure 4 As shown, the mouse screen coordinates are the rectangular coordinate system of the two-dimensional projection of the three-dimensional space on the screen. The three-dimensional world coordinates are the rectangular coordinate system of the model space of the three-dimensional space, which is used as the basis for coordinate conversion in the script playback stage mentioned later. It can be understood that the three-dimensional model presents a three-dimensional form in the three-dimensional viewport of the CAD drawing interface.

[0045] In some embodiments, the three-dimensional world coordinates ( X w ,Y w ,Z w) are as follows: According to the current viewport size, camera transformation matrix and working plane parameters, the mouse screen coordinates ( X s ,Y s ) is mapped to 3D world coordinates.

[0046] Specifically, based on the current viewport size, camera transformation matrix and working plane parameters, the mouse screen coordinates can be mapped to three-dimensional world coordinates using conventional image coordinate and three-dimensional coordinate conversion technology. This is a common method of interactive modeling software. The relevant method is well known to those skilled in the art and will not be repeated here.

[0047] In this embodiment, the viewport size refers to the plane size presented when the model space is rendered to a two-dimensional screen, that is, the plane size of the drawing area (area D), including width and height, and is usually expressed in pixels.

[0048] The camera transformation matrix is ​​a mathematical matrix used in computer graphics to map a three-dimensional object into a two-dimensional screen view through view transformation and projection transformation. The view transformation (including translation and rotation) describes the direction and position of the camera in the world coordinate system, and the projection transformation describes the projection mode used (including orthogonal projection or perspective projection). The backend module updates the camera transformation matrix in response to the user's translation, rotation, and scaling operations on the view.

[0049] Among them, the method for determining the camera transformation matrix belongs to a common technology in computer graphics used in the field of two-dimensional projection image and three-dimensional object coordinate mapping conversion. The relevant method is well known to those skilled in the art and will not be repeated here.

[0050] The work plane refers to the specific two-dimensional plane where points are picked up and graphics are drawn during the modeling process. It is used to assist positioning and drawing operations.

[0051] For example, you can set the working plane to the XY plane in the world coordinate system: the working plane is defined by the point (0,0,0) and the normal vector (0,0,1), and all points on the plane satisfy z=0.

[0052] In this embodiment, the current viewport size, camera transformation matrix and working plane parameters are obtained from the operation data of the backend module.

[0053] In other embodiments, the mouse screen coordinates ( X s ,Y s ) corresponds to the three-dimensional world coordinates ( X w ,Yw ,Z w ).

[0054] Further optionally, the step S20 also includes generating a reference model file for recording the reference model finally generated during the script recording process.

[0055] In some embodiments, the step S20 further includes: if the user's operation is based on editing the initial model file, the initial model file is synchronously saved into the script file.

[0056] Specifically, the initial model file is synchronously saved into the script file, for example, by directly embedding the complete binary data or text structure data (such as STEP format) of the initial model file into the script file, or by recording the storage path of the initial model file in the script file.

[0057] In some embodiments, the script file uses a structured text format (such as JSON, XML) or a binary encoding format (such as Protocol Buffers, custom byte stream).

[0058] Step S30, start the script playback mode and load the script file.

[0059] Script playback means allowing the CAD platform to automatically execute the user's operation process according to the recorded script file.

[0060] Specifically, starting the script playback mode is to initialize the system for script playback, including: starting the CAD platform from the automated test mode entrance, starting the script playback switch in the interactive center message receiving interface, loading and parsing the script file, so that the interactive center can receive the parsed user modeling operation instructions, and then execute the script playback, and specify the test model file output during the playback execution process.

[0061] Step S40, parse the script file, deserialize in sequence to generate user modeling operation instructions, and execute the user modeling operation instructions. For mouse operation instructions, take the three-dimensional world coordinates in the script file as a reference, combine the viewport size, camera transformation matrix and working plane parameters in the current test running environment, and calculate the reconstructed mouse screen coordinates; compare the reconstructed mouse screen coordinates with the recorded mouse screen coordinates, if the comparison results are consistent, execute the current mouse operation instructions according to the recorded mouse screen coordinates; if the comparison results are inconsistent, update the current mouse operation instructions according to the reconstructed mouse screen coordinates, execute the updated mouse operation instructions, and record the inconsistent comparison results in the first error report.

[0062] Further optionally, inconsistent comparison results are recorded in an error report and classified as warning-level errors.

[0063] It should be noted that in the CAD platform, when the command is a mouse operation, including mouse movement, clicking, scrolling, etc., the data sent by the front-end module to the interaction center contains the coordinates of the mouse, which are the coordinates Ps ( X s ,Y s ), when the back-end module performs modeling, it receives the mouse operation command sent by the front-end user, and converts it into the coordinate Pw( X w ,Y w ,Z w ), the final modeling data is based on the three-dimensional world coordinates.

[0064] However, during the script playback process, the execution of the command sequence is a chain process. The correct execution of each command depends on the correct execution of the previous command. Among them, the number of mouse operation commands is the largest. When executing commands, the following problems usually occur: 1) Due to hardware or software environment problems, the 3D viewport size during playback is different from that during recording, which causes a deviation in the conversion of screen coordinates to 3D world coordinates during playback; 2) When adjusting the view (translation, rotation, zoom), due to problems with the CAD platform execution, the camera is not adjusted to the orientation during recording (that is, the current camera transformation matrix is ​​different from that during recording), resulting in deviations when converting screen coordinates to 3D world coordinates.

[0065] For example, when recording, in a 800x600 pixel viewport, clicking the screen center coordinate (400, 300) generates a cube, which corresponds to the 3D world coordinate (5, 5, 0). When replaying, the viewport is changed to 1800x1012 pixels, and the screen center coordinate becomes (900, 506). If the recorded screen center coordinate (400, 300) is used directly, the cube will be incorrectly placed far away from the actual target.

[0066] For example, when recording, a horizontal line is drawn using a frontal perspective, and during playback, the perspective is switched to a top-down perspective due to deviation. The same screen coordinates may be mapped to different three-dimensional space heights, causing the line to shift.

[0067] However, on the one hand, the mouse operation interface generally has no return value or exception report. During the test process, it is impossible to determine whether the system responds correctly to the mouse operation from the interface call level. Therefore, the mouse operation response error may interfere with the test operation of the CAD core modeling function, making it difficult to distinguish whether the source of the error is an abnormal mouse operation response or a core modeling function failure, resulting in the inability to execute the CAD test process normally. On the other hand, when the user actually operates, he is not concerned about the screen coordinates themselves, but the target position in the three-dimensional space (such as clicking on a model vertex). If there is a response deviation such as the viewport size and camera parameters that causes the model view to not be adjusted to the expected state, the user will reposition the target by translating / rotating the view, etc. The coordinate conversion mechanism is equivalent to simulating this adaptation process during playback.

[0068] Therefore, in order to ensure that the test operation is not affected by the deviation when the mouse screen coordinates are converted to three-dimensional world coordinates during script playback, and to ensure that the test is executed normally, the core of the test of the embodiment of the present disclosure is to verify the correctness of the modeling operation process and results. To this end, a mouse screen coordinate comparison verification and correction mechanism is introduced in the script playback stage. Specifically, in the script recording stage, when the mouse command is recorded, the three-dimensional world coordinates in the current modeling state are attached. In the script playback stage, when the mouse operation command is executed, based on the three-dimensional world coordinates in the script file, combined with the viewport size, camera transformation matrix and working plane parameters in the current test run, the reconstructed mouse screen coordinates are calculated, and the reconstructed mouse screen coordinates are compared with the recorded mouse screen coordinates. If the comparison results are consistent, the current mouse operation instruction is executed according to the recorded mouse screen coordinates; if the comparison results are inconsistent, the current mouse operation instruction is updated according to the reconstructed mouse screen coordinates, and the updated mouse operation instruction is executed, thereby eliminating the coordinate mapping error caused by viewport scaling, camera perspective difference or working plane offset, thereby achieving high-precision restoration of interactive free modeling and parametric modeling operations across environments, and ensuring the normal execution of the test.

[0069] On the other hand, errors resulting from the inconsistency between the comparison results of the reconstructed mouse screen coordinates and the recorded mouse screen coordinates do not affect the core function test and are classified as warning-level errors so that testers can view and analyze the test run report of the error when necessary.

[0070] Among them, the three-dimensional world coordinates in the script file are used as a reference, combined with the viewport size, camera transformation matrix and working plane parameters in the current test run, to calculate the reconstructed mouse screen coordinates. The conventional two-dimensional projection image coordinates and three-dimensional world coordinates conversion method in the field can be used. The relevant method is well known to those skilled in the art and will not be repeated here.

[0071] Optionally, the viewport size, camera transformation matrix and working plane parameters in this embodiment can be obtained from the instruction running data of the backend module.

[0072] In some embodiments, during the script playback phase, when executing a file opening operation instruction, the system operates as follows: importing the initial model file, restoring the settings saved in the initial model file, including the currently activated layer, color, line type, line width, camera perspective, etc.

[0073] The disclosed embodiment binds and records the mouse screen coordinates and the three-dimensional world coordinates during the script recording stage, and introduces a mouse screen coordinate comparison, verification and correction mechanism during the script playback stage when executing mouse operation instructions, thereby ensuring that the mouse coordinates are not affected by factors such as viewport size and camera parameter changes in the test environment during script playback, thereby achieving accurate restoration of the model position of the mouse operation in different test environments, simulating the user's real operation, and accurately completing the modeling operation test, which is conducive to the implementation of cross-environment testing.

[0074] Therefore, the testing method of the embodiment of the present disclosure can support the full range of user operation types. Within a known range, all user operations will be recorded in the script file and accurately restored during playback, achieving high-precision reproduction of interactive free modeling and parametric modeling operations across environments, ensuring the comprehensiveness, accuracy and reliability of the test.

[0075] like Figure 3 As shown, the second embodiment of the present disclosure proposes another CAD-oriented interactive and parametric modeling automated testing method, which, based on the above first embodiment, further includes: Step S50, monitor the process of executing user modeling operation instructions in the test playback. If there is an exception, crash or no response, the test is determined to have failed and a second error report is generated; if all user modeling operation instructions are executed and there is no exception, the test model file is output.

[0076] Step S60, compare the test model with the reference model during recording. If they are completely consistent, it is determined that the system modeling function test has passed; if there is an inconsistency, it is determined that the test has failed and a second error report is generated.

[0077] In the disclosed embodiment, the test model file is used to record the test model generated during the playback execution process, and the reference model file is used to record the reference model generated during the script recording process.

[0078] Specifically, during the judgment test process, if all user modeling operation instructions are executed and there are no abnormal situations, the test is judged to be executed without problems and the modeling / editing results need to be further checked.

[0079] After the test is completed, save the executed operation information and the output test model file as the basis for use case comparison.

[0080] In some embodiments, the modeling results are verified by geometric consistency verification and attribute consistency verification. Geometric consistency verification includes: standardized preprocessing of the test model and the reference model, topological structure consistency comparison and verification, and comparison based on hash values ​​(such as SHA-256) to ensure the geometric data consistency of the model, and record the difference position when there is inconsistency; attribute consistency verification compares each attribute of the model (such as layer, color, line type, etc.) item by item to ensure the integrity and accuracy of the model attributes.

[0081] At the same time, the error report can be output to facilitate testers to query the running process and perform subsequent debugging and optimization according to the test running situation.

[0082] The disclosed embodiments can detect potential problems in a timely manner and avoid missing erroneous results by real-time monitoring of abnormalities, crashes or unresponsiveness during the test run. By comparing the model generated during the test with the reference model during recording, the correctness of the modeling / editing operations can be effectively verified, so that the test system can better adapt to the needs of complex CAD modeling tests.

[0083] like Figure 6 As shown, the third embodiment of the present disclosure proposes a CAD-oriented interactive and parametric modeling automated testing system 100, which is used to execute the CAD-oriented interactive and parametric modeling automated testing method as described in the above embodiments, and the system includes: The recording start module 101 is used to start the script recording mode and capture all user modeling operation instructions; The script generation module 102 is used to serialize the user modeling operation instructions, associate the mouse screen coordinates recorded in the mouse operation instructions with the corresponding three-dimensional world coordinates, and write them into a script file; The playback start module 103 is used to start the script playback mode and load the script file; The script playback module 104 is used to parse the script file, deserialize it in sequence to generate user modeling operation instructions, and execute the user modeling operation instructions. For mouse operation instructions, the three-dimensional world coordinates in the script file are used as a reference, combined with the viewport size, camera transformation matrix and working plane parameters in the current test running environment, to calculate the reconstructed mouse screen coordinates; compare the reconstructed mouse screen coordinates with the recorded mouse screen coordinates, if the comparison results are consistent, execute the current mouse operation instructions according to the recorded mouse screen coordinates; if the comparison results are inconsistent, update the current mouse operation instructions according to the reconstructed mouse screen coordinates, execute the updated mouse operation instructions, and record the inconsistent comparison results in the first error report.

[0084] In some embodiments, the system further comprises: The test operation monitoring module 105 is used to monitor the process of executing user modeling operation instructions during test playback. If there is an exception, crash or no response, the test is determined to have failed and a second error report is generated; if all user modeling operation instructions are executed and there is no exception, the test model file is output.

[0085] The model verification module 106 is used to compare the test model with the reference model during recording. If they are completely consistent, it is determined that the system modeling function test has passed; if there is an inconsistency, it is determined that the test has failed and a second error report is generated.

[0086] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0088] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A CAD-oriented interactive and parametric modeling automated testing method, characterized in that: include: Step S10, starting the script recording mode to capture all user modeling operation instructions; Step S20, serializing the user modeling operation instruction, and associating the mouse screen coordinates recorded in the mouse operation instruction with the corresponding three-dimensional world coordinates, and writing them into a script file; Step S30, start the script playback mode and load the script file; Step S40, parse the script file, deserialize in sequence to generate user modeling operation instructions, and execute the user modeling operation instructions. For mouse operation instructions, take the three-dimensional world coordinates in the script file as a reference, combine the viewport size, camera transformation matrix and working plane parameters in the current test running environment, and calculate the reconstructed mouse screen coordinates; compare the reconstructed mouse screen coordinates with the recorded mouse screen coordinates, if the comparison results are consistent, execute the current mouse operation instructions according to the recorded mouse screen coordinates; if the comparison results are inconsistent, update the current mouse operation instructions according to the reconstructed mouse screen coordinates, execute the updated mouse operation instructions, and record the inconsistent comparison results in the first error report.

2. The CAD-oriented interactive and parametric modeling automated testing method according to claim 1, characterized in that: The user modeling operation instructions include file operation instructions, mouse operation instructions, keyboard operation instructions, tool command instructions, tool setting data operation instructions and attribute operation instructions.

3. The CAD-oriented interactive and parametric modeling automated testing method according to claim 1, characterized in that: The three-dimensional world coordinates are generated by the following steps: Maps the mouse screen coordinates to 3D world coordinates based on the current viewport size, camera transformation matrix, and working plane parameters.

4. The CAD-oriented interactive and parametric modeling automated testing method according to claim 1, characterized in that: In the step S20, it also includes: if the user's operation is based on the initial model file for editing, the initial model file is synchronously saved in the script file.

5. The CAD-oriented interactive and parametric modeling automated testing method according to claim 1, characterized in that: The method further comprises: Step S50, monitoring the process of executing the user modeling operation instructions in the test playback, if there is an abnormality, crash or no response, the test is determined to be failed and a second error report is generated; if all user modeling operation instructions are executed and there is no abnormality, the test model file is output; Step S60, compare the test model with the reference model during recording. If they are completely consistent, it is determined that the system modeling function test has passed; if there is an inconsistency, it is determined that the test has failed and a second error report is generated.

6. The CAD-oriented interactive and parametric modeling automated testing method according to claim 5, characterized in that: In step S60, the modeling result is verified through geometric consistency verification and attribute consistency verification.

7. A CAD-oriented interactive and parametric modeling automated testing system, used to execute the CAD-oriented interactive and parametric modeling automated testing method as claimed in any one of claims 1 to 6, characterized in that: The system comprises: The recording start module is used to start the script recording mode and capture all user modeling operation instructions; The script generation module is used to serialize the user modeling operation instructions, associate the mouse screen coordinates recorded in the mouse operation instructions with the corresponding three-dimensional world coordinates, and write them into the script file; The playback startup module is used to start the script playback mode and load the script file; A script playback module is used to parse script files, deserialize them in sequence to generate user modeling operation instructions, and execute the user modeling operation instructions. For mouse operation instructions, the three-dimensional world coordinates in the script file are used as a reference, combined with the viewport size, camera transformation matrix and working plane parameters in the current test running environment, to calculate the reconstructed mouse screen coordinates; compare the reconstructed mouse screen coordinates with the recorded mouse screen coordinates. If the comparison results are consistent, the current mouse operation instructions are executed according to the recorded mouse screen coordinates; if the comparison results are inconsistent, the current mouse operation instructions are updated according to the reconstructed mouse screen coordinates, the updated mouse operation instructions are executed, and the inconsistent comparison results are recorded in the first error report.

8. The CAD-oriented interactive and parametric modeling automated testing system according to claim 7, characterized in that: The system further comprises: The test run monitoring module is used to monitor the process of executing the user modeling operation instructions in the test playback. If there is an exception, crash or no response, the test is judged to have failed and a second error report is generated; if all user modeling operation instructions are executed and there is no exception, the test model file is output; The model verification module is used to compare the test model with the reference model during recording. If they are completely consistent, the system modeling function test is determined to have passed; if there is an inconsistency, the test is determined to have failed and a second error report is generated.

Citation Information

Patent Citations

  • Automatic test method and device of CAD software, storage medium and processor

    CN114116485A

  • Three-dimensional CAD test script generation method and system based on unified interface design technology

    CN114546835A

  • Automatic testing method and equipment of three-dimensional CAD system and medium

    CN118503139A