A method and system for processing collision data of primitives in modeling applications

By establishing and updating primitive collision data and automatically calculating the optimal position, the inefficiency caused by primitive overlap in modeling applications is solved, generating a simple and easy-to-maintain model diagram, thus improving modeling efficiency and security.

CN120893039BActive Publication Date: 2026-04-03NUCLEAR POWER INSTITUTE OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Overlapping primitives in modeling applications leads to low modeling efficiency, increases design costs and raises the risk of errors, and makes it difficult to generate clear, concise, and easy-to-maintain model diagrams.

Method used

By establishing collision data for target primitives, calculating the operational range during model editing, updating the collision data of colliding primitives, and automatically calculating the optimal position based on real-time collision data, the system performs graphic updates, thereby achieving automatic collision calculation and layout of primitives.

Benefits of technology

It automatically calculates the editing range of graphic elements, reduces human error, improves modeling efficiency, generates concise, intuitive, and easy-to-maintain model diagrams, and reduces design costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120893039B_ABST
    Figure CN120893039B_ABST
Patent Text Reader

Abstract

This application provides a method and system for processing collision data of primitives in modeling applications. The method, after establishing collision data for target primitives, calculates the operational range during model editing based on the collision data, updates the collision data of the colliding primitives according to the operational range, performs a return-based automatic collision calculation based on the colliding primitives, finds the optimal position based on real-time collision data from the automatic collision calculation, and then updates the target primitive's graphics according to the optimal position. The automatic collision calculation includes boundary collision calculation aimed at model display integrity and inter-primary collision calculation aimed at model display accuracy. This method can automatically calculate the primitive editing range, automatically perform collision calculations, find the optimal position, and thus complete the graphics update, alleviating the problem of low modeling efficiency caused by primitive overlap in modeling applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of instrumentation and control technology in nuclear power plants, and in particular to a method and system for processing collision data of modeling application primitives. Background Technology

[0002] Nuclear power plant processing unit operations are applications requiring high safety. For such applications with stringent safety requirements, the engineering design utilizes an authoritative and validated modeling application (tool) to complete the graphical model design, which is then automatically generated and compiled into an executable program. Only after verification can the executable program be proven safe and reliable for operation in a distributed control system (DCS) environment.

[0003] The output of modeling applications that directly interact with designers is presented in the form of model diagrams. For high-security DCS systems, the model diagrams after application logic transformation are complex. To facilitate later VV, testing, and maintenance, the generated model diagrams must be accurate, intuitive, concise, and easy to read. During the DCS system engineering design process, model diagrams are drawn onto drawings, with dozens to thousands of model elements often appearing on a single page. Designers frequently edit and design on these model diagrams, resulting in a significant amount of element placement editing work. During element placement editing, the goal is to ensure that element objects do not overlap and are laid out logically.

[0004] However, modeling applications allow overlapping of model primitives during model editing, making it difficult to achieve clear, concise, and maintainable output model diagrams. This necessitates manual adjustments by designers to the model diagram layout, which not only increases the risk of design errors but also drastically increases design costs, leading to low modeling efficiency. Summary of the Invention

[0005] In view of this, embodiments of this application provide a method and system for processing collision data of primitives in modeling applications, so as to solve the problem of low modeling efficiency caused by primitive overlap in modeling applications.

[0006] According to one aspect of this application, a method for processing primitive collision data in modeling applications is provided, the method comprising:

[0007] Collision data for target primitives is established, wherein the target primitives are primitives whose positions change in the modeling space of the modeling application; the collision data are a combination of parameters that are associated with the target primitives; the parameter combination includes the identifier ID, position information, and primitive type of the target primitive;

[0008] The operational range during model editing is calculated based on the collision data. The operational range is an effective model operational range determined based on the scope. The scope is determined according to the model editing instructions corresponding to the primitive type and position change.

[0009] The collision data of the collision element is updated according to the operation range, wherein the collision element is the element that overlaps with the target element at the docking point position specified by the model editing instruction;

[0010] The system performs a return-type automatic collision calculation based on the collision primitives, and finds the optimal position based on the real-time collision data in the automatic collision calculation. The automatic collision calculation includes boundary collision calculation with the goal of model display integrity and inter-primary collision calculation with the goal of model display accuracy. The real-time collision data includes collision points and collision directions.

[0011] Perform a graphical update on the target primitive according to the optimal position.

[0012] In some embodiments, the operational range for model editing is calculated based on the collision data, including:

[0013] In response to a model editing command, the operation type of the model editing command and the target primitive selected by the model editing command are obtained;

[0014] The target scope of the target graphic element is determined according to the graphic element type of the target graphic element. The target scope includes at least one of the page scope, condition block scope, and state machine scope.

[0015] Determine the effective model operation range based on the target scope;

[0016] Read the graph data within the target scope, and update the collision data according to the data format corresponding to the parameter combination based on the graph data.

[0017] In some embodiments, updating the collision data of collision primitives according to the operating range includes:

[0018] The base point of the operation object is determined according to the operation type of the model editing instruction. If the operation type is a copy operation, the base point of the operation object is the center point determined according to the operation range. If the operation type is a new operation or a move operation, the base point of the operation object is the operation point of the model editing instruction.

[0019] The straight-line distance method is used to determine the stopping point of the operation object;

[0020] Calculate the position information of the target graphic element based on the base point and docking point of the operation object;

[0021] The collision data is updated according to the location information and the data format corresponding to the parameter combination.

[0022] In some embodiments, the method of determining the docking point of the operated object using the straight-line distance method includes:

[0023] Obtain the operation release point of the model editing command;

[0024] Set the docking point of the operation model area according to the operation release point;

[0025] Calculate the movement distance of the manipulated object, where the movement distance is the coordinate difference between the base point of the manipulated object and the docking point of the operation model area;

[0026] Traverse multiple operation objects within the operation range;

[0027] Calculate the difference between the vertex position of the manipulated object and the moving distance to obtain the new stopping point of the manipulated object.

[0028] In some embodiments, performing a return-type automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes:

[0029] Obtain the constituent elements of the target graphic element, the constituent elements including connections, pins and core graphic elements;

[0030] Based on the principle of graphic integrity, boundary collision calculations are performed on each of the constituent elements to obtain collision results; the boundary collision calculations include pin boundary collision calculations, connection boundary collision calculations, and primitive boundary collision calculations.

[0031] If the collision result represents the collision boundary of the constituent element, the collision data is updated according to the collision result to obtain the real-time collision data, and the optimal position is found according to the real-time collision data;

[0032] If the collision result indicates that the constituent element did not collide with the boundary, the model editing operation corresponding to the model editing instruction is executed.

[0033] In some embodiments, performing a return-type automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes:

[0034] Select the reference points within the corresponding operation range of the target graphic element and the collision graphic element;

[0035] The collision point is determined by comparing the reference point coordinates of the target graphic element and the collision graphic element. The collision point is the reference point of the target graphic element that is located within the operation range of the collision graphic element.

[0036] The collision edge is determined based on the collision point.

[0037] In some embodiments, performing a return-type automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes:

[0038] Obtain the collision point of the target primitive and the collision direction corresponding to the collision point;

[0039] Record the direction axis corresponding to the collision direction;

[0040] The collision point is moved in the opposite direction along the direction axis by a preset number of pixels to obtain the collision return base point;

[0041] Using the collision return base point as a reference, move the return distance in the opposite direction along the direction axis to obtain a new docking point. The return distance is 1 / 2 of the target graphic element's operating range in the direction axis dimension.

[0042] The automatic collision calculation of returnable elements is re-executed according to the new stopping point, and the optimal position is found based on the real-time collision data after the automatic collision calculation of returnable elements is re-executed.

[0043] In some embodiments, after obtaining the collision point of the target primitive and the collision direction corresponding to the collision point, the method further includes:

[0044] Obtain the collision history data of the target primitive;

[0045] The collision order is determined by extracting collision records in the collision direction from the collision history data.

[0046] If the collision sequence is the first collision, execute the step of recording the direction axis corresponding to the collision direction;

[0047] If the collision sequence is not the first collision, the optimal position is found using a quadratic search closed-loop algorithm in the same direction.

[0048] In some embodiments, the optimal position is found using a quadratic search closed-loop algorithm in the same direction, including:

[0049] Position type data is defined based on the collision direction;

[0050] Acquire the recorded data of the previous collision, the recorded data including the recording direction, the recording direction being used to characterize the collision direction of the previous collision;

[0051] If the collision direction is consistent with the recording direction, the target primitive is restored to its original position according to the position information;

[0052] If the collision direction is inconsistent with the recording direction, the optimal position is searched by initializing the recording data.

[0053] According to another aspect of this application, a modeling application primitive collision data processing system is provided, the system comprising:

[0054] The collision data establishment module is used to establish collision data for target primitives, wherein the target primitives are primitives whose positions change in the modeling space of the modeling application; the collision data are a combination of parameters that are associated with the target primitives; the parameter combination includes the identifier ID, position information, and primitive type of the target primitives;

[0055] The operation range calculation module is used to calculate the operation range during model editing based on the collision data. The operation range is an effective model operation range determined based on the scope. The scope is determined according to the model editing instructions corresponding to the primitive type and position change.

[0056] The collision data update module is used to update the collision data of the collision elements according to the operation range. The collision elements are elements that overlap with the target element at the docking point position specified by the model editing instruction.

[0057] The collision execution module is used to perform return-type automatic collision calculation based on the collision primitives, and to find the optimal position based on the real-time collision data in the automatic collision calculation. The automatic collision calculation includes boundary collision calculation with the goal of model display integrity and inter-primary collision calculation with the goal of model display accuracy. The real-time collision data includes collision points and collision directions.

[0058] The graphics update module is used to perform graphics update on the target primitive according to the optimal position.

[0059] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described modeling application primitive collision data processing method.

[0060] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described modeling application primitive collision data processing method.

[0061] By employing the above technical solutions, embodiments of this application provide a method and system for processing collision data of modeling application primitives. The method, after establishing collision data for target primitives, calculates the operational range during model editing based on the collision data, updates the collision data of the colliding primitives according to the operational range, performs a return-based automatic collision calculation based on the colliding primitives, finds the optimal position based on real-time collision data from the automatic collision calculation, and then updates the target primitive's graphics according to the optimal position. The automatic collision calculation includes boundary collision calculation aimed at model display integrity and inter-primary collision calculation aimed at model display accuracy. This method can automatically calculate the primitive editing range, automatically perform collision calculations, find the optimal position, and thus complete the graphics update, alleviating the problem of low modeling efficiency caused by primitive overlap in modeling applications.

[0062] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0063] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0064] Figure 1 This is a schematic diagram of the modeling application primitive collision data processing method provided in the embodiments of this application;

[0065] Figure 2 This is a schematic diagram of the modeling application primitive collision data processing flow provided in the embodiments of this application;

[0066] Figure 3 This is a schematic diagram of the operation range calculation process based on the scope provided in the embodiments of this application;

[0067] Figure 4 A schematic diagram of the overall business process provided for the embodiments of this application;

[0068] Figure 5 A schematic diagram illustrating the calculation process of collision data for collision primitives provided in this application embodiment;

[0069] Figure 6 This is a schematic diagram of the collision calculation process between primitives provided in an embodiment of this application;

[0070] Figure 7 This is a schematic diagram of the state boundary collision effect provided in an embodiment of this application;

[0071] Figure 8 This is a schematic diagram illustrating the effect of state movement in an embodiment of this application;

[0072] Figure 9 A schematic diagram illustrating the effect of automatic collision to dock at the optimal position provided in an embodiment of this application;

[0073] Figure 10 This is a schematic diagram of the structure of the modeling application primitive collision data processing system provided in the embodiments of this application. Detailed Implementation

[0074] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0075] In this application embodiment, the modeling application is a computer application specifically designed for creating, editing, analyzing, and validating models. Modeling applications can be applied in various fields such as engineering, science, and business to simulate and understand the behavior of complex systems or processes based on domain data.

[0076] Taking the instrumentation and control system of a nuclear power plant as an example, modeling applications can be used in the system design, commissioning, and operation and maintenance phases of a nuclear power plant. In the system design phase, modeling applications can simulate and verify the functions of numerous sensors, controllers, and actuators, and assist in equipment selection. In the commissioning phase, modeling applications can perform fault injection and diagnostic testing, as well as parameter optimization and adjustment. In the operation and maintenance phase, modeling applications can monitor and predict equipment performance, and also assist in operation training and drills.

[0077] Modeling applications can build and edit models, which are abstract representations of real-world systems or processes. These models can be mathematical, physical, logical, or other forms of models. Modeling tools are used to create, modify, simulate, and analyze these models to help users better understand the characteristics, behavior, and performance of systems, and to make predictions and optimizations.

[0078] For example, applications involving the operation of nuclear power plant processing units are high-safety applications. For such applications with high safety requirements, the engineering design process uses an authoritative and validated modeling application (tool) to complete the graphical model design, which is then automatically generated and compiled into an executable program. Only the validated executable program can be proven to be safe and reliable for operation in a distributed control system (DCS) environment.

[0079] A model represented graphically can be called a graphical element. A graphical element is a graphical component or symbol used to construct a model. Elemental elements are the basic building blocks in graphical modeling tools; by combining these elements, users can create more complex system models. Different modeling software and domains may have different types of graphical elements. For example, based on geometric shape, graphical elements can include rectangular elements, circular elements, line elements, etc. Based on function, graphical elements can include sensor elements, controller elements, and actuator elements, etc.

[0080] The output of modeling applications that directly interact with designers is presented in the form of model diagrams. For high-security DCS systems, the model diagrams after application logic transformation are complex. To facilitate later VV, testing, and maintenance, the generated model diagrams must be accurate, intuitive, concise, and easy to read. During the DCS system engineering design process, model diagrams are drawn onto drawings, with dozens to thousands of model elements often appearing on a single page. Designers frequently edit and design on these model diagrams, resulting in a significant amount of element placement editing work. During element placement editing, the goal is to ensure that element objects do not overlap and are laid out logically.

[0081] However, modeling applications allow overlapping of model primitives during model editing, making it difficult to achieve clear, concise, and maintainable output model diagrams. This necessitates manual adjustments by designers to the model diagram layout, which not only increases the risk of design errors but also drastically increases design costs, leading to low modeling efficiency.

[0082] To address the problem of low modeling efficiency caused by primitive overlap in modeling applications, this application, based on the actual design and requirements of current nuclear power plant DCS systems, and considering the high security and reliability requirements of applications operating within these systems, as well as the high-frequency editing needs of the operational logic model, provides a method for processing primitive collision data in modeling applications, specifically addressing the requirement for nuclear power plant DCS systems to design model diagrams that are highly valuable, cost-effective, accurate, concise, and easy to maintain. Figure 1 , Figure 2 As shown, the method includes:

[0083] S101. Establish collision data for the target primitives.

[0084] Modeling applications can respond to user-input control commands to perform editing operations such as model creation, modification, and deletion. Some editing operations cause changes in the position or shape of model primitives loaded in the modeling space. The control commands corresponding to these editing operations can be called model editing commands. The primitives targeted by the model editing commands are called target primitives, that is, the target primitives are the primitives in the modeling space of the modeling application that have undergone positional changes.

[0085] In response to editing operations performed on model primitives in the modeling space of the modeling application, the processing system running the modeling application generates collision data. This collision data consists of parameter combinations associated with the target primitive; these parameter combinations include the target primitive's identifier ID, location information, and primitive type. The processing system can construct the collision data based on the "three simultaneities" principle: simultaneous generation, simultaneous disappearance, and simultaneous updating. Furthermore, during collision data construction, the collision data can be organized and stored according to a preset format of parameter combinations. A strict correspondence can be designed between the collision data and the target primitive, meaning each primitive corresponds to a set of collision data, and the collision data can be stored in the corresponding drawing page of the primitive.

[0086] Collision data can be organized and stored according to a pre-defined parameter combination format. For example, the parameter combination format is: int ID_Item, <QList <qpoint>iPontList,QList <qpoint>`nPontList, int typeItem>`. In the above parameter combination format, `ID_Item` represents the identification ID of the target graphic element. A unique ID is automatically generated when the `ID_Item` object is created, serving as the data key. `iPontList` stores the original position data before the object was edited; `nPontList` stores the new position data after the object was edited; `typeItem` stores the type of the graphic element. Collision data can be represented by different graphic element types using `typeItem`: 0 for invalid, 1 for point, 2 for line, 3 for triangle, 4 for rectangle, 5 for rhombus, 6 for circle, and 7 for others.

[0087] S102. Calculate the operating range when editing the model based on the collision data.

[0088] After establishing collision data, the processing system can respond to model editing commands, edit model primitives, and synchronously update the collision data. During model editing, the operation range can be accurately calculated based on the scope. The operation range is the effective model operation range determined by the scope; the scope is determined according to the model editing commands corresponding to the primitive type and position changes.

[0089] like Figure 3 As shown, in some embodiments, when the processing system executes the operation range for calculating model editing based on the collision data, it can receive a model editing instruction and, in response to the instruction, obtain the operation type and the target primitive selected by the instruction. Then, it determines the target scope of the target primitive based on its primitive type. The target scope includes at least one of a page scope, a conditional block scope, and a state machine scope. Based on the target scope, it determines the effective model operation range and updates the collision data according to the data format corresponding to the parameter combination by reading the primitive data within the target scope.

[0090] To accurately calculate the scope of operations when model primitives are edited, the processing system can initiate model editing based on triggering patterns. These triggering patterns include collisions during the regeneration of copied and pasted primitives, collisions upon the initial creation of primitives, and collisions when primitive positions change. The system iterates through various collision scenarios, including collisions between primitives, collisions between primitives and page borders, and collisions between primitives and the borders of bounded primitives.

[0091] The effective model operation range is then determined based on the scope. For primitive types such as condition blocks, state machines, basic operators, and custom operators, the data flow can be the entire page; therefore, these primitives collectively form the page scope bounded by the page border. Condition nodes and condition node connectors, both belonging to condition blocks, are bounded by the condition block border, forming the condition block scope. States, branches, and transitions, both belonging to states, are bounded by the state machine border, forming the state machine scope. Editing of primitives is only supported within the same scope; the system processes events from only one scope at a time. When a user issues an edit command, the system reads the scope of the last selected primitive as the target scope and automatically invalidates the selection of objects outside the target scope.

[0092] Based on the defined effective model operation range, the processing system can read graph data within the target scope and organize and update collision data according to a custom format. For example, when modifying the position of a target graph element using model editing commands, the processing system can update the collision data by modifying the nPontList in the collision data based on the modified position data.

[0093] S103. Update the collision data of the collision primitives according to the operation range.

[0094] After calculating the operating range, the processing system can calculate and determine the collision data of the collision elements based on the operating range, and update the collision data of the collision elements according to the operating range. The collision element is the element that overlaps with the target element at the docking point specified in the model editing instruction.

[0095] For example, when a model editing command performs a position change operation on element A, the position data after the position change can be determined based on the model editing command. The changed position data can be represented by docking points, indicating that element A is moved to the position corresponding to the docking point. Then, after moving element A to the position corresponding to the docking point, if the operation range corresponding to element A overlaps with the operation range corresponding to element B, element B can be identified as a collision element.

[0096] It should be noted that, due to the relativity of position movement, target primitives and collision primitives have a relative relationship. That is, for the same model editing command, when primitive A is the target primitive, primitive B is the collision primitive; while when primitive B is the target primitive, primitive A is the collision primitive.

[0097] like Figure 4 As shown, in some embodiments, when updating collision data of collision primitives according to the operation range, the processing system can determine the base point of the operation object based on the operation type of the model editing instruction. Specifically, if the operation type is a copy operation, the base point of the operation object is the center point determined according to the operation range; that is, the range center method is used to determine the base point of the copy operation object.

[0098] For example, the processing system can extract the position data of all selected graphic elements, calculate the maximum and minimum values ​​in the horizontal and vertical directions for each graphic element, and calculate the maximum and minimum values ​​in the horizontal and vertical directions for all graphic elements. Then, it can use the maximum and minimum values ​​in the horizontal and vertical directions of the entire range to calculate the center point, and the resulting point is the base point of the operation object.

[0099] If the operation type is a new operation or a move operation, the base point of the operation object is the operation point of the model editing command. For example, when a user inputs model editing commands corresponding to new operations and move operations on a target primitive using an external input device such as a mouse, the processing system can use the mouse press point as the base point of the operation object.

[0100] After determining the base point of the operation object, the processing system can determine the docking point of the operation object using the straight-line distance method. In some embodiments, when the processing system executes the method of determining the docking point of the operation object using the straight-line distance method, it can first obtain the operation release point of the model editing command and set the docking point of the operation model area according to the operation release point. Then, it calculates the movement distance of the operation object. The movement distance is the coordinate difference between the base point of the operation object and the docking point of the operation model area. By traversing multiple operation objects within the operation range, the difference between the vertex position of the operation object and the movement distance is calculated to obtain the new docking point of the operation object.

[0101] For example, when the mouse release point is a docking point in the operation model area, the distance calculated by subtracting the docking point in the operation model area from the base point of the operation object can be used as the distance moved by each object. By traversing each operation object and subtracting the movement distance from each vertex position, the resulting points are used as a new set of docking points for each operation object, and the data is recorded.

[0102] After determining the base point and docking point of the operation object, the processing system can calculate the position information of the target graphic element based on the base point and docking point of the operation object, and then update the collision data according to the data format corresponding to the parameter combination based on the position information.

[0103] As can be seen, in the process of calculating and determining collision data for colliding elements, the processing system can use the range center method to determine the base point of the copy operation object, and use the operation point as the base point for new and move operations. The straight-line distance method is used to determine the docking point of the operation object, and the position data of the operation elements is calculated. Thus, the collision data is organized and updated according to a pre-set parameter combination format, achieving automatic organization and updating of collision data to maintain its timeliness.

[0104] S104. Perform a return-type automatic collision calculation based on the collision primitives, and find the optimal position based on the real-time collision data in the automatic collision calculation.

[0105] After identifying the colliding primitives and updating the collision data, the processing system can also perform automatic collision calculations for the target primitive and the colliding primitives using a return-type (spring-like) method. This means that automatic collision calculations are performed based on the colliding primitives. The automatic collision calculations include boundary collision calculations aimed at achieving model display integrity and inter-primary collision calculations aimed at achieving model display accuracy.

[0106] Return-type automatic element collision refers to the process where, during the movement of a target element or a colliding element, once the target element and the colliding element come into contact, it is considered a collision. At this time, the processing system reverses the position so that the graphic corresponding to the target element or the colliding element can return a certain distance. The return process is like a spring bouncing back, so it is also called spring-type automatic element collision.

[0107] During the automatic primitive collision process, the processing system can read collision data and perform boundary collisions with the goal of ensuring model display integrity, and / or inter-primary collisions with the goal of ensuring model display accuracy. The system then updates the collision data to memory and calls the graphics update interface.

[0108] like Figure 5 As shown, in some embodiments, when performing boundary collision calculations with the goal of model display integrity, the processing system can first obtain the constituent elements of the target primitive when performing return-type automatic collision calculations based on the collision primitives. These constituent elements include connections, pins, and core primitives. Then, based on the principle of graphic integrity, boundary collision calculations are performed on each of the constituent elements to obtain the collision results. The boundary collision calculations include pin boundary collision calculations, connection boundary collision calculations, and primitive boundary collision calculations.

[0109] Since the elements related to primitives mainly include three parts: connections, pins, and core primitives, and the integrity of the graphics is an important principle for displaying the model diagram, based on this principle, when there is a boundary collision, we can use the method of colliding connections, pins, and primitives separately.

[0110] For pin boundary collision calculation, in the model diagram, the operator pin consists of two points: the start point and the end point. Before calculating the collision, the pin data is obtained first, and then the coordinates of the start and end points of the pin are used to determine whether the pin is a horizontal pin or a vertical pin. Finally, it is determined whether the X (Y) axis value of the end point of the horizontal (vertical) pin is less than 0 or greater than the page width (height). If the above judgment conditions are met, it means that a boundary collision has occurred; otherwise, it means that no boundary collision has occurred.

[0111] For line boundary collision calculation, in the model diagram, a line can consist of 4 points. Before calculating the collision, the line data is first acquired, and all the nodes of the line data are sorted and stored in a data structure. The attribute values ​​of the collision boundary are then retrieved. For example, X_MIN = left boundary, X_MAX = right boundary, Y_MIN = top boundary, and Y_MAX = bottom boundary. Then, the corresponding coordinates of the sorted points are retrieved based on the attribute values. Finally, it is determined whether the corresponding coordinate value is less than 0 or greater than the page width (height). If the above conditions are met, it indicates that a boundary collision has occurred; otherwise, it indicates that no boundary collision has occurred.

[0112] For primitive boundary collision calculation, before calculating the collision, we can first obtain the primitive data and sort all the points of the primitive data into a data structure, then retrieve the attribute values ​​of the collision boundary. For example, X_MIN = left boundary, X_MAX = right boundary, Y_MIN = top boundary, Y_MAX = bottom boundary. Then, based on the attribute values, we retrieve the corresponding coordinates of the sorted points. Finally, we determine whether the corresponding coordinate value is less than 0 or greater than the page width (height). If the above conditions are met, it means that a boundary collision has occurred; otherwise, it means that no boundary collision has occurred.

[0113] After obtaining the collision results, they can be read to determine whether the constituent elements of the target primitive collide with the boundary. If the collision results indicate that the constituent element collides with the boundary, the collision data is updated according to the collision results to obtain the real-time collision data. If the collision results indicate that the constituent element does not collide with the boundary, the model editing operation corresponding to the model editing instruction is executed.

[0114] During the automatic collision calculation of returnable primitives, the processing system can update the collision data in real time based on the calculation data generated during the collision process to obtain real-time collision data. This real-time collision data includes the collision point and collision direction. Based on the real-time collision data, the processing system can find the optimal position; that is, it performs an optimal position search after each collision calculation.

[0115] To find the optimal location, in some embodiments, when the processing system performs a return-based automatic collision calculation based on the colliding primitives, and searches for the optimal location based on real-time collision data from the automatic collision calculation, it can select a reference point within the corresponding operating range of the target primitive and the colliding primitives. By comparing the coordinates of the reference points of the target primitive and the colliding primitives, the collision point is determined, and then the collision edge is determined according to the collision point. The collision point is a reference point within the operating range of the colliding primitive in the target primitive.

[0116] For example, such as Figure 6 As shown, for the collision calculation between primitives aimed at improving model display accuracy, the processing system uses the lower left corner of the border as the base point of the coordinate system. When the primitives in this model are rectangular primitives, collisions between points and lines are not considered. Therefore, the target primitive (operational primitive) can be selected as impact primitive A, and the collision primitive can be selected as primitive B. Then, iteratively, it can be determined whether each point (impact point) of A is inside primitive B. The criteria for determination are: the x-axis coordinate of the impact point is greater than the x-axis coordinate of the left side of the B rectangle; the x-axis coordinate of the impact point is less than the x-axis coordinate of the right side of the B rectangle; the y-axis coordinate of the impact point is greater than the y-axis coordinate of the top of the B rectangle; and the y-axis coordinate of the impact point is less than the y-axis coordinate of the bottom of the B rectangle.

[0117] After the above judgment, the processing system also needs to swap primitive A and primitive B, and repeat the judgment according to the above-mentioned collision calculation method between primitives with the goal of model display accuracy, so as to obtain the collision point and the collision edge of the collided primitive.

[0118] After determining the collision edge, the processing system can perform a return-type automatic collision calculation based on the collision edge. In some embodiments, when the processing system performs a return-type automatic collision calculation based on the collision element and searches for the optimal position based on the real-time collision data in the automatic collision calculation, it can obtain the collision point of the target element and the collision direction corresponding to the collision point.

[0119] After acquiring the collision point of the target primitive and the corresponding collision direction, the processing system can also determine whether the current collision direction is the first collision. This involves acquiring the collision history data of the target primitive and extracting the collision records along the collision direction from the historical data to determine the collision order. If the collision order is the first collision, the processing system can record the direction axis corresponding to the collision direction and then move the collision point backward along the direction axis by a preset number of pixels to obtain the collision return point.

[0120] For example, to find the optimal position after a collision, the processing system can obtain the point of collision and its direction after a collision occurs, and determine whether it is the first collision on the current coordinate axis. If it is the first collision, the system can record the direction axis corresponding to the current collision direction and move the collision point 5 pixels in the opposite direction as the collision return base point.

[0121] Using the collision return base point as a reference, move the target element back a distance in the opposite direction along the direction axis to obtain a new stopping point. The return distance is half the dimension of the direction axis within the target element's operating range. Then, re-execute the automatic collision calculation for the returning element based on the new stopping point, and find the optimal position based on the real-time collision data after the re-execution. That is, using the current base point as a reference, move half the original width or height in the opposite direction as the new stopping point for the graphic area, and continue collision calculations based on the new stopping point until there are no overlapping areas between the target element and the colliding element.

[0122] If the collision sequence is not the first collision, a quadratic search closed-loop algorithm in the same direction can be used to find the optimal position. In some embodiments, when the processing system uses the quadratic search closed-loop algorithm in the same direction to find the optimal position, it can define position type data according to the collision direction and obtain the recorded data of the previous collision. The recorded data includes a recording direction, which represents the collision direction of the previous collision. By comparing the collision direction and the recording direction, if the collision direction is consistent with the recording direction, the target primitive is restored to its original position based on the position information.

[0123] For example, for a non-first collision on the coordinate axis corresponding to the current collision direction, the processing system can use a closed-loop algorithm with two searches in the same direction to prove that there is no optimal position at this editing point. That is, after a second collision occurs in the same direction, the position found by reverse search will always return to the position of the first collision, thus proving that there is no reasonable stopping position at this stopping point. To this end, the data storing the direction in which the collision occurred can be defined as `positionType`, recording the data of the previous collision. The default value is 0, with 1 representing the horizontal direction and 2 representing the vertical direction. When a collision occurs, the previous `positionType` is retrieved, and it is determined whether it is consistent with the current direction. If they are consistent, the collision ends, proving that no optimal position was found during this editing operation. At this point, the position data before the graphic editing can be restored, i.e., the original position can be restored.

[0124] If the collision direction is inconsistent with the recording direction, the optimal position is searched again by initializing the recording data. That is, when the directions are inconsistent, indicating the first collision in that direction, the positionType can be initialized to continue searching for the position. Figure 7 , Figure 8 , Figure 9 As shown.

[0125] S105. Perform a graphic update on the target primitive according to the optimal position.

[0126] After calculating the optimal position using real-time collision data, the processing system can perform a graphical update on the target primitives according to the optimal position, thus updating the graphics after a collision. During the graphical update, the processing system can synchronize the graphical update with model editing and collision detection. Furthermore, the graphical update is divided into updates during the event execution process and updates at the end of the event.

[0127] For updates during event execution, the processing system can primarily reflect these updates during movement operations. When the mouse moves, collision calculations are not performed. The mouse's movement point is used as the docking point, and new position data for all manipulated objects is calculated. Furthermore, the position borders of the manipulated objects are drawn in real-time as dashed lines. The graphical representation of the event execution process updates is only for user viewing and is not the final graphic. Moreover, the graphical representations during event execution contain overlapping or intersecting elements that are not permitted in the model diagram.

[0128] For updates at the end of an event, the processing system can reflect these updates in all operations. The updated graphic at the end of the event is the final graphic, without overlaps or intersections. At the end of the event, the collision calculation interface is called with the mouse endpoint as the region center point. It reads the collision data of the elements and determines if a collision occurred. If no collision occurred, it reads the new position data and draws the graphic. If a collision occurred, it reads the original element data, draws the graphic, and updates the model diagram and related information display.

[0129] As can be seen, the modeling application primitive collision processing method described in the above embodiments can adapt to the actual design and requirements of current nuclear power plant DCS systems. Combining the high security and reliability requirements of applications running in the DCS system, and the high-frequency editing characteristics of the operational logic model, it addresses the need for nuclear power plant DCS systems to design model diagrams that are highly valuable, have low design costs, are accurate, concise, and easy to maintain. The method can use the "three simultaneous" principle (simultaneous operation, simultaneous processing, and simultaneous execution) to customize the format for organizing and storing collision data when model primitives are generated. It accurately calculates the operational range based on the scope, calculates the collision base point, performs automatic collision calculation based on finding the optimal position, and updates the model diagram drawing synchronously with the collision. This completes the automatic collision layout of primitives in the complex model diagram editing process, ensuring that the output model diagram is concise, intuitive, and accurate. Through computer-automated calculation and drawing technology, it reduces human error from manual operation, improves the efficiency of model design, and thus realizes an automatic collision method for modeling application primitives, bringing significant economic value to DCS system design.

[0130] By applying the technical solutions of the above embodiments, this method has been adopted in a supply project of a safety-grade DCS system. By controlling the algorithm model design and using automatic collision detection software for primitives, the model design of the DCS system engineering is realized. This improves the design quality of the DCS system, reduces system design costs, and increases the economic value of the system design.

[0131] By employing the above technical solutions, embodiments of this application provide a method and system for processing collision data of modeling application primitives. The method, after establishing collision data for target primitives, calculates the operational range during model editing based on the collision data, updates the collision data of the colliding primitives according to the operational range, performs a return-based automatic collision calculation based on the colliding primitives, finds the optimal position based on real-time collision data from the automatic collision calculation, and then updates the target primitive's graphics according to the optimal position. The automatic collision calculation includes boundary collision calculation aimed at model display integrity and inter-primary collision calculation aimed at model display accuracy. This method can automatically calculate the primitive editing range, automatically perform collision calculations, find the optimal position, and thus complete the graphics update, alleviating the problem of low modeling efficiency caused by primitive overlap in modeling applications.

[0132] In some embodiments, as a specific implementation of the modeling application primitive collision data processing method described in the above embodiments, some embodiments of this application also provide a modeling application primitive collision data processing system, such as... Figure 10 As shown, the system includes:

[0133] The collision data establishment module is used to establish collision data for target primitives, wherein the target primitives are primitives whose positions change in the modeling space of the modeling application; the collision data are a combination of parameters that are associated with the target primitives; the parameter combination includes the identifier ID, position information, and primitive type of the target primitives;

[0134] The operation range calculation module is used to calculate the operation range during model editing based on the collision data. The operation range is an effective model operation range determined based on the scope. The scope is determined according to the model editing instructions corresponding to the primitive type and position change.

[0135] The collision data update module is used to update the collision data of the collision elements according to the operation range. The collision elements are elements that overlap with the target element at the docking point position specified by the model editing instruction.

[0136] The collision execution module is used to perform return-type automatic collision calculation based on the collision primitives, and to find the optimal position based on the real-time collision data in the automatic collision calculation. The automatic collision calculation includes boundary collision calculation with the goal of model display integrity and inter-primary collision calculation with the goal of model display accuracy. The real-time collision data includes collision points and collision directions.

[0137] The graphics update module is used to perform graphics update on the target primitive according to the optimal position.

[0138] It should be noted that other corresponding descriptions of the functional units involved in the modeling application primitive collision data processing system provided in this application embodiment can be found in the corresponding descriptions in the modeling application primitive collision data processing method provided in the above embodiment, and will not be repeated here.

[0139] This application also provides a computer device, specifically a personal computer, server, network device, etc. The computer device includes a bus, processor, memory, and communication interface, and may also include input / output interfaces and a display device. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores location information. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0140] Those skilled in the art will understand that the structure of the computer device described above is only a partial structure related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. A specific computer device may include more or fewer components, or combine certain components, or have different component arrangements.

[0141] In one embodiment, a computer-readable storage medium is also provided, which may be non-volatile or volatile, and a computer program is stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0142] In one embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0144] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.

[0145] Any references to memory, database, or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc.

[0146] Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can take many forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0147] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchain. The processors involved in the embodiments provided in this application may be, but are not limited to, general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc.

[0148] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0149] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.< / qpoint> < / qpoint>

Claims

1. A method for processing primitive collision data in modeling applications, characterized in that, The method includes: Collision data for target primitives is established, wherein the target primitives are primitives whose positions change in the modeling space of the modeling application; the collision data are a combination of parameters that are associated with the target primitives; the parameter combination includes the identifier ID, position information, and primitive type of the target primitive; The operational range during model editing is calculated based on the collision data. The operational range is an effective model operational range determined based on the scope. The scope is determined according to the model editing instructions corresponding to the primitive type and position change. The collision data of the collision elements is updated according to the operation range, wherein the collision elements are elements whose range overlaps with the target element at the docking point position specified by the model editing instruction; updating the collision data of the collision elements according to the operation range includes: determining the base point of the operation object according to the operation type of the model editing instruction, wherein if the operation type is a copy operation, the base point of the operation object is the center point determined according to the operation range; if the operation type is a new operation or a move operation, the base point of the operation object is the operation point of the model editing instruction; determining the docking point of the operation object using the straight-line distance method; calculating the position information of the target element according to the base point of the operation object and the docking point of the operation object; and updating the collision data according to the position information and the data format corresponding to the parameter combination. The automatic collision calculation is performed based on the collision primitives, and the optimal position is found based on the real-time collision data in the automatic collision calculation. The automatic collision calculation includes boundary collision calculation with the goal of model display integrity and inter-primary collision calculation with the goal of model display accuracy. The real-time collision data includes collision points and collision directions. The automatic collision calculation is performed based on the collision primitives, and the optimal position is found based on the real-time collision data in the automatic collision calculation. This includes: obtaining the collision point of the target primitive and the collision direction corresponding to the collision point; recording the direction axis corresponding to the collision direction; moving the collision point in the opposite direction along the direction axis by a preset number of pixels to obtain a collision return base point; moving the return distance in the opposite direction along the direction axis based on the collision return base point to obtain a new docking point. The return distance is 1 / 2 of the target primitive's operating range in the direction axis dimension; re-performing the automatic collision calculation based on the new docking point, and finding the optimal position based on the real-time collision data after re-performing the automatic collision calculation. Perform a graphical update on the target primitive according to the optimal position.

2. The method according to claim 1, characterized in that, The scope of operations during model editing is calculated based on the collision data, including: In response to a model editing command, the operation type of the model editing command and the target primitive selected by the model editing command are obtained; The target scope of the target graphic element is determined according to the graphic element type of the target graphic element. The target scope includes at least one of the page scope, condition block scope, and state machine scope. Determine the effective model operation range based on the target scope; Read the graph data within the target scope, and update the collision data according to the data format corresponding to the parameter combination based on the graph data.

3. The method according to claim 1, characterized in that, The straight-line distance method is used to determine the docking point of the operation object, including: Obtain the operation release point of the model editing command; Set the docking point of the operation model area according to the operation release point; Calculate the movement distance of the manipulated object, where the movement distance is the coordinate difference between the base point of the manipulated object and the docking point of the operation model area; Traverse multiple operation objects within the operation range; Calculate the difference between the vertex position of the manipulated object and the moving distance to obtain the new stopping point of the manipulated object.

4. The method according to claim 1, characterized in that, Performing a return-based automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes: Obtain the constituent elements of the target graphic element, the constituent elements including connections, pins and core graphic elements; Based on the principle of graphic integrity, boundary collision calculations are performed on each of the constituent elements to obtain collision results; the boundary collision calculations include pin boundary collision calculations, connection boundary collision calculations, and primitive boundary collision calculations. If the collision result represents the collision boundary of the constituent element, the collision data is updated according to the collision result to obtain the real-time collision data, and the optimal position is found according to the real-time collision data; If the collision result indicates that the constituent element did not collide with the boundary, the model editing operation corresponding to the model editing instruction is executed.

5. The method according to claim 1, characterized in that, Performing a return-based automatic collision calculation based on the colliding primitives, and finding the optimal position based on real-time collision data from the automatic collision calculation, includes: Select the reference points within the corresponding operation range of the target graphic element and the collision graphic element; The collision point is determined by comparing the reference point coordinates of the target graphic element and the collision graphic element. The collision point is the reference point of the target graphic element that is located within the operation range of the collision graphic element. The collision edge is determined based on the collision point.

6. The method according to claim 1, characterized in that, After obtaining the collision point of the target primitive and the collision direction corresponding to the collision point, the method further includes: Obtain the collision history data of the target primitive; The collision order is determined by extracting collision records in the collision direction from the collision history data. If the collision sequence is the first collision, execute the step of recording the direction axis corresponding to the collision direction; If the collision sequence is not the first collision, the optimal position is found using a quadratic search closed-loop algorithm in the same direction.

7. The method according to claim 6, characterized in that, The optimal position is found using a quadratic search closed-loop algorithm in the same direction, including: Position type data is defined based on the collision direction; Acquire the recorded data of the previous collision, the recorded data including the recording direction, the recording direction being used to characterize the collision direction of the previous collision; If the collision direction is consistent with the recording direction, the target primitive is restored to its original position according to the position information; If the collision direction is inconsistent with the recording direction, the optimal position is searched by initializing the recording data.

8. A modeling application primitive collision data processing system, characterized in that, The system includes: The collision data establishment module is used to establish collision data for target primitives, wherein the target primitives are primitives whose positions change in the modeling space of the modeling application; the collision data are a combination of parameters that are associated with the target primitives; the parameter combination includes the identifier ID, position information, and primitive type of the target primitives; The operation range calculation module is used to calculate the operation range during model editing based on the collision data. The operation range is an effective model operation range determined based on the scope. The scope is determined according to the model editing instructions corresponding to the primitive type and position change. A collision data update module is used to update the collision data of collision elements according to the operation range. The collision elements are elements that overlap with the target element at the docking point specified by the model editing instruction. Updating the collision data of collision elements according to the operation range includes: determining the base point of the operation object according to the operation type of the model editing instruction, wherein if the operation type is a copy operation, the base point of the operation object is the center point determined according to the operation range; if the operation type is a new operation or a move operation, the base point of the operation object is the operation point of the model editing instruction; determining the docking point of the operation object using the straight-line distance method; calculating the position information of the target element based on the base point of the operation object and the docking point of the operation object; and updating the collision data according to the data format corresponding to the parameter combination based on the position information. The collision execution module is used to perform a return-type automatic collision calculation based on the collision primitives, and to find the optimal position based on the real-time collision data in the automatic collision calculation. The automatic collision calculation includes boundary collision calculation with the goal of model display integrity and inter-primary collision calculation with the goal of model display accuracy. The real-time collision data includes collision points and collision directions. The process of performing a return-type automatic collision calculation based on the collision primitives and finding the optimal position based on the real-time collision data includes: obtaining the collision point of the target primitive and the collision direction corresponding to the collision point; recording the direction axis corresponding to the collision direction; moving the collision point in the opposite direction along the direction axis by a preset number of pixels to obtain a collision return base point; moving the return distance in the opposite direction along the direction axis based on the collision return base point to obtain a new docking point, wherein the return distance is 1 / 2 of the target primitive's operating range in the direction axis; re-executing the return-type automatic collision calculation according to the new docking point, and finding the optimal position based on the real-time collision data after re-executing the return-type automatic collision calculation. The graphics update module is used to perform graphics update on the target primitive according to the optimal position.

Citation Information

Patent Citations

  • Collision detection method and device, electronic equipment and storage medium

    CN118873941A

  • Apparatus and method for sensing collision

    KR100718157B1