A hinge structure simulation method and system based on physical engine

By obtaining hinge structure parameters and creating thin instances and physical collision constraint relationships, we solve the problems of complex hinge structure design and difficult performance optimization in the existing technology, achieve low-threshold and efficient hinge structure simulation, and improve design efficiency and reuse. sex.

CN118378389BActive Publication Date: 2024-09-17YANTAI JIERUI NETWORK TRADING
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410821982.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-17
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

Existing physics engines have complex calculations when simulating hinge structures, high design thresholds, difficulty in reuse and secondary modification, and performance optimization relies on professional technology and is inefficient.

Method used

By obtaining the parameters of the hinge structure, creating thin instances and physical collision constraints, providing a visual configuration method, abstracting the common characteristics of the hinge rigid body structure, using the OBB algorithm and the midpoint circle algorithm to determine the mesh position, using the box or convex hull Calculate collisions, add angular damping and ball and socket constraints to simulate hinge behavior and achieve interactive effects.

Benefits of technology

It lowers the design threshold, improves the reusability and design efficiency of the hinge structure, and optimizes performance. Users can generate complex-shaped hinge structures by simply adjusting parameters, reducing dependence on professional technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378389B
    Figure CN118378389B
Patent Text Reader

Abstract

The present invention relates to a hinge structure simulation method and system based on a physical engine, and belongs to the field of virtual reality technology. The method comprises the following steps: S1: obtaining the parameters of the hinge structure; S2: creating a thin instance for the mesh body of the hinge structure based on the obtained parameters; S3: creating physical collision and constraint relationships of different hinge structures; S4: creating the interaction of hinges. The present invention generates hinges based on the thin instance characteristics, and adopts a collision algorithm according to the hinge parameters, so as to efficiently optimize the performance. Users do not need to consider the learning of the physical engine and complex three-dimensional calculations, but only need to adjust the simple and easy-to-understand parameters such as the hinge unit and the hinge length to freely adjust the effect, with a low entry threshold and strong reusability. A method for generating hinges on a curved path is provided. As long as various spatial curve templates are provided, various closed hinges of specific shapes can be quickly generated, with good functional scalability, easy to improve design efficiency, and strong reusability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtual reality technology, and in particular to a hinge structure simulation method and system based on a physical engine. Background Art

[0002] Physics engine is an indispensable technology for computers to simulate real physical laws in virtual space, and its application in virtual simulation, simulation verification, film and television games and other fields is growing.

[0003] In recent years, many professional physics engines have emerged on the market, providing efficient physical simulation calculations to meet the needs of virtual simulation. Among them, rigid body dynamics is one of the most commonly used calculations provided by physics engines. It can be used to simulate various widely used rigid body structures including hinge structures, and can provide more realistic and flexible effects than hinges and other structures implemented by traditional models and skeletal animation. However, the calculation of physics engines is complex. Most three-dimensional applications using physics engines provide complex and numerous physical parameters and general constraint components. Designers need to cooperate with three-dimensional models and various rendering technologies to design the required rigid body structures by themselves. This implementation process usually requires rich support for three-dimensional rendering and physics engine knowledge, and the technical threshold is high. And when implementing different structures such as tracks and chains, the degree of customization is high, so it is difficult to reuse and difficult to modify twice. In addition, most hinge rigid body structures on the market require a large number of mesh units and physical collision calculations. Performance optimization depends on professional technicians, which has a certain threshold and is not efficient. Summary of the invention

[0004] To solve the above problems, the present invention provides a hinge structure simulation method and system based on a physical engine. The method and system can abstract the common characteristics of various hinge rigid body structures and provide a visual configuration method, thereby helping users to understand the operation with a low threshold and achieve the design goals efficiently and conveniently. Furthermore, a performance optimization plan is formulated based on the characteristics of the hinge structure and the physical engine, eliminating the designer's work in this regard.

[0005] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical scheme:

[0006] In a first aspect, the present invention provides a hinge structure simulation method based on a physical engine, comprising the following steps:

[0007] S1: Obtain the parameters of the hinge structure;

[0008] S2: creating a thin instance for the mesh of the hinge structure based on the acquired parameters;

[0009] S3: Create physical collision and constraint relationships of different hinge structures;

[0010] S4: Create the interaction of the hinge.

[0011] Furthermore, in step 1, the parameters include but are not limited to fixed points, fixed point world coordinates / center point world coordinates, number of units, mesh body and hinge length.

[0012] Furthermore, in step 1, the parameters are provided to the system by the user based on the created front-end adjustment panel and visual indicators.

[0013] Furthermore, in step 1, the hinge structure is composed of a certain number of units, each unit may include one or more grid bodies; the hinge structure may also include fixed points for representing constraint relationships in the hinge.

[0014] Furthermore, the S2 specifically includes:

[0015] S21: Reconstruction of local coordinate system

[0016] The OBB algorithm is used to calculate the bounding box of the mesh and its geometric center. The origin is recreated for the mesh at the geometric center, and the local coordinate system is reestablished through the bounding box tangent space.

[0017] S22: Based on the number of units, the world coordinates of the fixed point and the hinge length, create a thin instance for each mesh body in each unit in the hinge structure, and the number of thin instances created for each mesh body is equal to the number of units in the hinge structure.

[0018] Furthermore, in S22, for a hinge structure having only a single fixed point, the mesh thin instance creation position is determined by the following method: starting from the fixed point position, a thin instance is created along a single axis direction of the world coordinate axis, and a rotation matrix is ​​used to correct the thin instance creation position.

[0019] Furthermore, in S22, for a hinge structure that is connected end to end and has no fixed point, the thin instance creation position of the mesh body is determined by the following method: taking the input center point world coordinate as the center point and the hinge length as the circumference, using the midpoint circle algorithm to find a curve on the coordinate system established by XZ or YZ or XY, and solving the uniformly selected points on the curve through the number of units to find the creation position of the thin instance.

[0020] Furthermore, in S22, for a hinge structure with multiple fixed points, the thin instance creation position of the grid body is determined by the following method: the ratio of the distance between every two fixed points to the hinge length is calculated and the number of units is allocated by rounding up or down, and then the size of the grid body is calculated by OBB method to obtain the thin instance spacing.

[0021] Furthermore, in S22, when the unit of the hinge structure includes multiple mesh bodies, the size of each mesh body included in the composite mesh body and the length of the intersection area in the hinge creation direction are calculated in OBB mode to solve the spacing of the thin instance and create the thin instance.

[0022] The specific steps in S3 include:

[0023] S31: Creating different types of physical collisions for hinge structures

[0024] For hinge structures with no structural interpenetration and collision between meshes, the collision is calculated using the box BOX or convex hull CONVEX_HULL method;

[0025] For hinge structures with interpenetrating collisions between meshes, the mesh triangles are used to calculate collisions.

[0026] S32: Create constraint relationships for hinge structures

[0027] For hinges with fixed points, create distance constraints for the mesh bodies at both ends of the hinge with the fixed point as the pivot of the constraint relationship, and add angular damping;

[0028] For hinge structures that rotate only in one axis and have no elasticity, use hinge constraints to calculate the constraint relationship between the mesh and the thin instance. Take a point between the geometric centers of every two units as the fulcrum of the hinge constraint, and then add angular damping in a single direction to simulate the "sluggish feeling" of hinge rotation caused by material friction in reality. Add an axis to limit the rotation range of the hinge. The axis is the same as the axis of the thin instance generation.

[0029] For hinge structures that can rotate in two perpendicular directions or have more degrees of freedom, take the midpoint between the geometric centers of every two units as the fulcrum to establish a ball-and-socket constraint relationship, and modify the inertia tensor of the mesh body and thin instance (some physics engines use similar parameters such as moment of inertia) to control the rotation limit of the hinge unit.

[0030] S4: Interactions that create hinges;

[0031] S41: Pick a point on the surface of the mesh or thin instance through ray detection of the physical engine, create a cube at the position of the surface point and create a ball-and-socket constraint with the position of the point as the fulcrum;

[0032] S42: converting the screen space position into a three-dimensional space world coordinate, and assigning the world coordinate to the cube world coordinate position in real time;

[0033] S43: The dragging effect of the hinge is completed by modifying the world coordinate position of the cube and the ball-and-socket constraint.

[0034] In a second aspect, the present invention provides a hinge structure simulation system based on a physical engine, comprising:

[0035] A parameter acquisition module, used to acquire the parameters of the hinge structure;

[0036] A thin instance creation module, used to create a thin instance for the mesh body of the hinge structure based on the acquired parameters;

[0037] Collision constraint creation module, used to create physical collision and constraint relationships of different hinge structures;

[0038] Interaction creation module, used to create hinge interactions.

[0039] Compared with the prior art, the present invention has the following beneficial effects:

[0040] 1. This method generates hinges based on thin instance characteristics and uses a collision algorithm according to hinge parameters, which can efficiently optimize performance, especially when there are many hinge structure units.

[0041] 2. This method simulates the situation of common hinge structures and abstracts key parameters. Users do not need to consider the learning of physical engines and complex three-dimensional calculations. They only need to adjust simple and easy-to-understand parameters such as hinge units and hinge lengths to freely adjust the effects. The entry threshold is low and the reusability is strong.

[0042] 3. This method provides a way to generate hinges on a curved path. As long as various spatial curve templates are provided, various closed hinges of specific shapes can be quickly generated. It has good functional scalability, is easy to improve design efficiency, and has strong reusability. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of a hinge structure simulation method based on a physical engine provided in the first embodiment of the present invention.

[0044] Figure 2 It is a structural schematic diagram of a hinge structure simulation system based on a physical engine provided in the second embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to clearly illustrate the technical features of the present invention, the present invention will be described in detail below through specific implementation methods and in conjunction with the accompanying drawings. The disclosure below provides many different embodiments for realizing different structures of the present invention. In order to simplify the disclosure of the present invention, the components and settings of specific examples are described below. In addition, the present invention may repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplicity and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed. It should be noted that the components illustrated in the accompanying drawings are not necessarily drawn to scale. The present invention omits the description of known components and processing techniques and processes to avoid unnecessary limitations on the present invention.

[0046] Embodiment 1

[0047] This embodiment provides a hinge structure simulation method based on a physical engine, the process steps are as follows: Figure 1 As shown, the following steps are included:

[0048] S1. Input parameters:

[0049] The user provides the system with basic parameters of the hinge structure through the created front-end adjustment panel and visual indicators, including fixed points, fixed point world coordinates / center point world coordinates, number of units, mesh bodies, hinge length, etc. Among them, the visual indicators are multiple three-dimensional mesh bodies with indexes created in three-dimensional space. By calling the position control lever, the position value of the indicator is passed to the fixed point. Through visual operations, users can easily and efficiently generate hinge effects.

[0050] The hinge structure is composed of a certain number of units, each of which may contain one or more mesh bodies; the hinge structure also includes a fixed point for representing the constraint relationship in the hinge; therefore, at the world coordinates of the fixed point of the hinge, its constraint relationship needs to be calculated separately in subsequent steps, and if there is a mesh body at the fixed point, the mesh body needs to be processed as a model rather than a thin instance.

[0051] S2. After the system obtains the parameters input by the user, it will create a thin instance for the mesh of the hinge structure by the following method:

[0052] S21: Reconstruction of local coordinate system

[0053] The mesh's bounding box is calculated using the OBB algorithm, and its geometric center is calculated. The origin is recreated for the mesh at the geometric center of the bounding box, and the local coordinate system is reestablished using the bounding box's tangent space.

[0054] S22: Create a thin instance

[0055] Based on the number of cells, fixed point world coordinates, and hinge lengths entered by the user, thin instances are created for each mesh volume within each cell in the hinge structure. The number of thin instances created for each mesh volume is equal to the number of cells in the hinge structure, where:

[0056] For hinge structures with only a single fixed point, create a thin instance of the mesh along a single axis direction of the world coordinate system starting from the fixed point position, and use the rotation matrix to correct the thin instance creation position.

[0057] For hinged structures that are connected end to end and have no fixed points, the input center point world coordinates are used as the center point and the hinge length is used as the circumference. The midpoint circle algorithm is used to find the curve on the coordinate system established by XZ (or YZ, XY, according to the required hinge direction), and the number of units is used to solve the uniform points on the curve to find the creation position of the thin instance.

[0058] For hinge structures with multiple fixed points, the ratio of the distance between every two fixed points to the hinge length is calculated and rounded up or down to allocate the number of units. The mesh size is then calculated using the OBB method to find the thin instance spacing.

[0059] When the unit of the hinge structure contains multiple mesh bodies, the size of each mesh body contained in the composite mesh body and the length of the intersection area in the hinge creation direction are calculated in OBB mode to solve the spacing of the thin instance and create the thin instance.

[0060] S3. Create physical collision and constraint relationships of different hinge structures. The specific steps include:

[0061] S31. Create different types of physical collisions for hinge structures:

[0062] For hinge structures with no structural interpenetration and collision between meshes, collision is calculated using the box body BOX or convex hull CONVEX_HULL method. The box body calculation consumes the least performance but loses details. The external parameters that need to be obtained include the length, width, and height of the hinge structure unit; the convex hull calculation is more accurate.

[0063] For hinge structures with interlaced collisions between meshes, precise collisions calculated based on the mesh triangles are used, which increases performance consumption.

[0064] For physical collision at fixed points, it depends on whether a mesh is placed at the fixed point. If so, the calculation follows the above two methods.

[0065] S32. Create the constraint relationship of the hinge structure:

[0066] For hinges with fixed points, create distance constraints for the mesh bodies at both ends of the hinge with the fixed point as the pivot of the constraint relationship, and add angular damping;

[0067] For hinges without fixed points, there is no need to create this constraint;

[0068] For hinge structures that can rotate only in one axis and have no elasticity, hinge constraints are used to calculate the constraint relationship between the mesh body and the thin instance. In order to correctly simulate the constraint relationship between the hinge units, it is necessary to take a point between the geometric centers of every two units as the fulcrum (Pivot) required by the hinge constraint. The point here can be directly based on the center between the geometric center points of every two thin instances as the fulcrum, and then add angular damping in a single direction to simulate the "sluggish feeling" of hinge rotation caused by material friction in reality. Add an axis (Axis) to limit the rotation range of the hinge. The axis is the same as the axis generated by the thin instance.

[0069] For structures that can rotate in two vertical directions or have more degrees of freedom, take the midpoint between the geometric centers of every two units as the pivot to establish a ball-and-socket constraint relationship, and modify the inertia tensor of the mesh and thin instance (some physics engines use similar parameters such as moment of inertia) to control the rotation limit of the hinge unit.

[0070] S4. Create the interaction of the hinge. The specific steps are as follows:

[0071] S41. Take a point on the surface of the mesh or thin instance through the raycast of the physical engine, create a cube at the position of the point on the surface, and create a ball-and-socket constraint with the point as the pivot.

[0072] S42, converting the screen space position into a three-dimensional space world coordinate, and assigning the world coordinate to the cube world coordinate position in real time;

[0073] S43. Complete the dragging effect of the hinge by modifying the position of the cube and the ball-and-socket constraint.

[0074] Embodiment 2

[0075] This embodiment relates to a hinge structure simulation system based on a physical engine. The system structure is as follows: Figure 2 As shown, including:

[0076] A parameter acquisition module, used to acquire the parameters of the hinge structure;

[0077] A thin instance creation module, used to create a thin instance for the mesh body of the hinge structure based on the acquired parameters;

[0078] Collision constraint creation module, used to create physical collision and constraint relationships of different hinge structures;

[0079] Interaction creation module, used to create hinge interactions.

[0080] The above embodiments are only technical solutions of the present invention rather than limitations thereof. It should be pointed out that, for those skilled in the art, the specific implementation modes of the present invention may be modified or replaced by equivalents without departing from the technical principles of the present invention. Any modification or equivalent replacement without departing from the spirit and scope of the present invention shall be included in the protection scope of the present invention.

Claims

1. A hinge structure simulation method based on a physical engine, characterized in that it includes the following steps: S1: Obtain the parameters of the hinge structure; S2: Based on the obtained parameters, create a thin instance for the mesh of the hinge structure; specifically, it includes: S21: Calculate the bounding box of the mesh body through the OBB algorithm, calculate its geometric center, recreate the origin for the mesh body at the geometric center, and re-establish the local coordinate system through the bounding box tangent space; S22: based on the number of units, the world coordinates of the fixed point and the hinge length, create a thin instance for each mesh body in each unit of the hinge structure, and the number of thin instances created for each mesh body is equal to the number of units of the hinge structure; In S22, for a hinge structure having only a single fixed point, the thin instance creation position of the mesh body is determined by the following method: starting from the fixed point position, a thin instance is created along a single axis direction of the world coordinate axis, and a rotation matrix is ​​used to correct the thin instance creation position; For hinge structures that are connected end to end and have no fixed points, the thin instance creation position of the mesh body is determined by the following method: take the input center point world coordinate as the center point and the hinge length as the perimeter, use the midpoint circle algorithm to find the curve on the coordinate system established by XZ, YZ or XY, and use the number of units to solve the uniform points on the curve to find the creation position of the thin instance; For hinge structures with multiple fixed points, the thin instance creation position of the mesh body is determined by the following method: calculate the ratio of the distance between every two fixed points to the hinge length and round it up or down to allocate the number of units, then calculate the mesh body size through the OBB method to find the thin instance spacing; When the unit of the hinge structure contains multiple mesh bodies, the size of each mesh body contained in the composite mesh body and the length of the intersection area in the hinge creation direction are calculated in the OBB manner to solve the spacing of the thin instance and create the thin instance; S3: Create physical collision and constraint relationships for different hinge structures, including: S31: Creating different types of physical collisions for hinge structures For hinge structures with no structural interpenetration and collision between meshes, collision is calculated using a box or convex hull approach. For hinge structures with interlaced collisions between meshes, the mesh triangles are used to calculate collisions. S32: Create constraint relationships for hinge structures For hinges with fixed points, establish distance constraints for the mesh bodies at both ends of the hinge with the fixed points as the fulcrums of the constraint relationship, and add angular damping; For hinge structures that rotate only in one axis and have no elasticity, use hinge constraints to calculate the constraint relationship between the mesh and the thin instance. Take a point between the geometric centers of every two units as the fulcrum of the hinge constraint, and then add angular damping in a single direction to simulate the "sluggish feeling" of hinge rotation caused by material friction in reality. Add an axis to limit the rotation range of the hinge. The axis is the same as the axis of the thin instance generation. For hinge structures that can rotate in two perpendicular directions or have more degrees of freedom, a ball-and-socket constraint relationship is established by taking the midpoint between the geometric centers of every two units as the fulcrum, and the inertia tensors of the mesh body and thin instances are modified to control the rotation limit of the hinge unit; S4: Create the hinge interaction, including: S41: Pick a point on the surface of the mesh or thin instance through ray detection of the physical engine, create a cube at the position of the surface point and create a ball-and-socket constraint with the position of the point as the fulcrum; S42: converting the screen space position into a three-dimensional space world coordinate, and assigning the world coordinate to the cube world coordinate position in real time; S43: The dragging effect of the hinge is completed by modifying the world coordinate position of the cube and the ball-and-socket constraint.

2. A hinge structure simulation method based on a physical engine as claimed in claim 1, characterized in that: In S1, the parameters include but are not limited to fixed points, fixed point world coordinates / center point world coordinates, number of units, mesh body and hinge length.

3. A hinge structure simulation method based on a physical engine as claimed in claim 1, characterized in that: In S1, the parameters are provided to the system by the user based on the created front-end adjustment panel and visual indicators.

4. A hinge structure simulation method based on a physical engine as claimed in claim 1, characterized in that: The hinge structure is composed of a certain number of units, each unit includes one or more grid bodies; the hinge structure also includes fixed points for expressing constraint relationships in the hinge.

5. A hinge structure simulation system based on a physical engine, used to implement the hinge structure simulation method according to any one of claims 1 to 4, characterized in that: include: A parameter acquisition module, used to acquire the parameters of the hinge structure; A thin instance creation module, used to create a thin instance for the mesh body of the hinge structure based on the acquired parameters; Collision constraint creation module, used to create physical collision and constraint relationships of different hinge structures; Interaction creation module, used to create hinge interactions.

Citation Information

Patent Citations

  • Virtual reality physical engine-based collaborative propulsion simulation method for fully mechanized mining equipment

    CN109783962A

  • Engineering equipment real-time interaction system based on mixed reality and motion simulation method

    CN116310231A

  • Modeling simulation method and system for digital factory system and storage medium

    CN117203592A

  • Simulation model generation method, system and equipment and storage medium

    CN117350078A

  • Assembling physical simulations in a 3D graphical editor

    US20080010041A1