Flexible wire model generation method and device, electronic equipment and medium

By splitting the flexible wire into ends and connection sections, performing three-dimensional modeling and point filling, and dynamically generating a flexible connection model, the problem of poor flexibility in display of flexible wires is solved, and the production efficiency and accuracy of training courseware is improved.

CN119006716APending Publication Date: 2024-11-22CRRC TANGSHAN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411186380.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

When making three-dimensional interactive training courseware, the connection action display of flexible cables and other materials requires frequent adjustment of the model, resulting in long production time and poor flexibility, making it difficult to achieve accurate and realistic action effects.

Method used

Split the flexible wire into ends, connection segments and intermediate segments, generate intermediate control points through three-dimensional modeling and marking points, use Bezier curves to fill points, and dynamically generate flexible connection models to adapt to scene position changes.

Benefits of technology

It improves the flexibility of flexible wire connection and the efficiency of making courseware, reduces animation production time, and achieves more accurate and flexible model display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006716A_ABST
    Figure CN119006716A_ABST
Patent Text Reader

Abstract

The invention provides a flexible wire model generation method and device, electronic equipment and a medium. The method comprises the following steps: splitting a flexible wire; carrying out three-dimensional modeling on the end part of the flexible wire rod, and setting a model orientation; selecting mark points according to the model orientation; generating an intermediate control point according to the mark point; point filling is carried out through the mark points and the middle control points; and generating a connecting line, and obtaining a flexible connection model of the flexible wire rod. According to the method and the device, the flexible connecting lines in the flexible wires can be generated in a dynamic manner, so that a lot of time is not needed to make animations, the method and the device are not limited by position adjustment of a model, the connection flexibility of the flexible wires is improved, and the courseware making efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of education and training, and in particular to a method, device, electronic device and medium for generating a flexible wire model. Background Art

[0002] As one of the important means of transportation, the safety and reliability of rail vehicles are of vital importance. With the rapid development of society, people have more and more demands on rail vehicles and passenger cars, and the quality requirements are getting higher and higher. The application of modern technology in rail vehicle products is becoming more and more common, and the technical level requirements are getting higher and higher. With the rapid development of high-speed rail, in order to meet the demand for talents in various EMU sections, more and more vocational colleges have established EMU majors. In order to improve the professional knowledge and skills of vocational college students, they can have a clear understanding of the commissioning and manufacturing process of EMUs, and master the key manufacturing technologies of EMUs through training and learning, cultivate technical talents that meet the development of the times and professional needs, and lay a solid foundation for future work.

[0003] When making 3D interactive training courseware, the actions of flexible cables, air ducts and other flexible materials such as materials, tooling, tools and equipment are often involved. For example, the two ends of a cable need to be plugged into or unplugged from a socket, and the two ends of the air duct need to be connected to different interfaces. The traditional way is to customize the connection actions of the flexible materials, tooling, tools and equipment into an animation that comes with the 3D model, and call the animation to play when the action needs to be displayed. In order to accurately and realistically display the action effects, the technical development team needs to model and develop codes according to the course content requirements, and the production cycle is relatively long. In addition, if the position of the model in the scene changes, it is very likely that the positions of the two ends of the flexible materials, tooling, tools and equipment will change, and the model and animation have to be remade, so it is more time-consuming overall. Summary of the invention

[0004] In order to solve one of the above-mentioned technical defects, a flexible wire model generation method, device, electronic device and medium are provided in the embodiments of the present application.

[0005] A first aspect of an embodiment of the present application provides a method for generating a flexible wire model, the method comprising:

[0006] The flexible wire is divided into an end portion A, an end portion B, a middle section C, a connecting section CA between the end portion A and the middle section C, and a connecting section CB between the end portion B and the middle section C;

[0007] Three-dimensional models are respectively constructed for the end portion A and the end portion B, and the orientation of the models is set;

[0008] Selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model;

[0009] Generate intermediate control points of the connecting segment CA and the connecting segment CB according to the marking points, and fill the connecting segment CA, the connecting segment CB and the intermediate segment C respectively with the marking points and the intermediate control points;

[0010] All points are connected to generate connection lines according to a preset diameter of the flexible wire, so as to obtain a flexible connection model of the flexible wire.

[0011] A second aspect of an embodiment of the present application provides a flexible wire model generation device, the device comprising:

[0012] A splitting module, used for splitting the flexible wire into an end portion A, an end portion B, a middle section C, a connecting section CA between the end portion A and the middle section C, and a connecting section CB between the end portion B and the middle section C;

[0013] A modeling module, used to perform three-dimensional modeling on the end A and the end B respectively, and set the model orientation;

[0014] A marking module, used for selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model;

[0015] A filling module, used to generate the intermediate control points of the connection segment CA and the connection segment CB according to the marking points, and to fill the connection segment CA, the connection segment CB and the intermediate segment C respectively through the marking points and the intermediate control points;

[0016] The connection module is used to connect all points according to the preset diameter of the flexible wire to generate a connection line and obtain a flexible connection model of the flexible wire.

[0017] A third aspect of the embodiments of the present application provides an electronic device, including: a processor and a memory;

[0018] Among them, one or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device executes the method described in the first aspect of the embodiment of the present application.

[0019] A fourth aspect of an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect of the embodiment of the present application.

[0020] By adopting the flexible wire model generation method provided in the embodiment of the present application, the flexible connecting line in the middle of the flexible wire can be generated in a dynamic manner, thereby eliminating the need to spend a lot of time on animation production and no longer being limited by the position adjustment of the model. This improves the flexibility of the flexible wire connection and improves the efficiency and accuracy of courseware production. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0022] Figure 1 A flowchart of a method for generating a flexible wire model provided in Example 1 of the present application;

[0023] Figure 2 This is a schematic diagram of the splitting and marking point locations of the flexible wire;

[0024] Figure 3 It is a schematic diagram of point filling of flexible wire;

[0025] Figure 4 Schematic diagram of the flexible wire model generation device. DETAILED DESCRIPTION

[0026] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0027] Example 1

[0028] like Figure 1 As shown, this embodiment provides a method for generating a flexible wire model, the method comprising:

[0029] S101, splitting the flexible wire.

[0030] Specifically, before generating the flexible wire model, this embodiment first "breaks the flexible wire into parts", and then processes each part of the flexible wire one by one. In this embodiment, according to the position or function of the flexible wire, the flexible wire is logically divided into five parts, mainly including end A, end B, middle section C, connecting section CA and connecting section CB. The above five parts are described in detail below.

[0031] The two ends of the flexible wire are usually made of hard materials, such as common cables, which usually have plugs at both ends and a flexible connection part in the middle. Therefore, in this embodiment, the two ends of the flexible wire are first separated into end A and end B, respectively, and the middle flexible connection part is recorded as middle section C.

[0032] When displayed in a three-dimensional scene, due to the fixed constraint of the end of the flexible wire, there is a part between the end of the flexible wire and the middle flexible connection with obvious deformation, which is named as the connection segment in this embodiment. Since the connection segment is located in the area between the end of the flexible wire and the middle segment, its change is subject to the fixed constraint of the end on the one hand and the flexible constraint of the middle segment on the other hand. Therefore, the connection segment needs to be specially processed. In this embodiment, the connection segment between the end A and the middle segment C is recorded as the connection segment CA, and the connection segment between the end B and the middle segment C is recorded as the connection segment CB.

[0033] S102, creating a three-dimensional model of the end of the flexible wire and setting the orientation of the model.

[0034] Specifically, in this embodiment, since the ends of the flexible wire are usually fixedly connected, the ends A and B of the flexible wire can be three-dimensionally modeled to generate a three-dimensional model MA corresponding to the end A and a three-dimensional model MB corresponding to the end B, such as Figure 2 After generating the three-dimensional model of the end A and the end B, the orientation of the model is set. The orientation of the model can be determined according to the specific situation. In this embodiment, the Z-axis direction of MA and MB is used as the orientation of the model.

[0035] S103: Select a marking point according to the orientation of the model.

[0036] Specifically, after the three-dimensional modeling of the end A and the end B, the connection segment CA, the connection segment CB and the middle segment C in the flexible wire need to be processed. First, in this embodiment, marking points are selected on the connection segment CA, the connection segment CB and the middle segment C according to the orientation of the model to be used as control points for subsequent processing.

[0037] When dynamically generating the model shape of the flexible wire, it is necessary to know the starting and ending points of the flexible wire. To this end, the present embodiment generates a marking point SA at the connection between the three-dimensional model MA corresponding to the end A and the connecting segment CA, and the three-dimensional space coordinates of the marking point SA are marked as PosA. Correspondingly, a marking point SB is generated at the connection between the three-dimensional model MB corresponding to the end B and the connecting segment CB, and the three-dimensional space coordinates of the marking point SB are marked as PosB. It should be noted that in order not to affect the overall size parameters and flexible appearance of the flexible wire, the volume of the marking points SA and SB is very small, and their purpose is only to be used as a mark. After determining the starting point SA and the ending point SB, the marking points can be selected on the connecting segment CA, the connecting segment CB and the middle segment C according to the model orientation.

[0038] For the connection segment CA, this embodiment takes PosA as the starting point and extends a predetermined distance in the negative direction of the model orientation to obtain PosCA, such as Figure 2 shown.

[0039] For the connection segment CB, this embodiment takes PosB as the starting point and extends a predetermined distance in the negative direction of the model orientation to obtain PosCA, such as Figure 2 shown.

[0040] For the middle segment C, this embodiment takes the midpoint of PosCA and PosCB to obtain PosC, such as Figure 2 shown.

[0041] S104: Generate intermediate control points according to the marking points.

[0042] Specifically, since the models of the ends A and B of the flexible wire have been generated through three-dimensional modeling, the point filling involved in this embodiment is limited to the middle section C, the connecting section CA and the connecting section CB. First, there are only two endpoints for the connecting section CA and the connecting section CB, respectively. For the connecting section CA, two endpoints PosCA and PosC are known, and for the connecting section CB, two endpoints PosCB and PosC are known. In the modeling process, only two endpoints are not enough to generate a three-dimensional model of the flexible connection form. Therefore, this embodiment also needs to add at least one intermediate control point in the connecting section CA and the connecting section CB.

[0043] For the connection segment CA, two endpoints PosCA and PosC are known, and at least one intermediate control point PosCA1 can be taken between PosCA and PosC through the Bezier curve. That is, the intermediate control point PosCA1 is a point selected from PosCA as the starting point and extending a certain distance in the direction of PosC.

[0044] For the connecting segment CB, two endpoints PosCB and PosC are known, and at least one intermediate control point PosCB1 can be taken between PosCB and PosC through the Bezier curve. That is, the intermediate control point PosCB1 is a point selected from PosCB as the starting point and extending a certain distance in the direction of PosC.

[0045] S105: performing point filling using the marking points and the intermediate control points.

[0046] Specifically, after determining the above-mentioned marking points and the middle control points, the middle points of the connecting segment CA, the connecting segment CB and the middle segment C can be calculated by the Bezier curve, that is, the connecting segment CA, the connecting segment CB and the middle segment C are point filled, such as Figure 3 shown.

[0047] For the connecting segment CA, the curve segment formed by PosA, PosCA and PosCA1 is point-filled using the Bezier curve.

[0048] For the connecting segment CB, the curve segment composed of PosB, PosCB and PosCB1 is point filled using the Bezier curve.

[0049] For the middle segment C, the curve segment composed of PosCA1, PosC and PosCB1 is point filled using the Bezier curve.

[0050] When performing point filling, you need to set the point spacing F first. The point spacing F is proportional to the smoothness of the 3D model finally generated by the flexible wire, that is, the smaller the point spacing F, the smoother the 3D model of the flexible wire, and the more natural the 3D model of the flexible wire can be. However, since the smaller the point spacing F, the larger the number of corresponding point fillings, the greater the amount of calculation, and the more actual needs, it is necessary to select a suitable point spacing based on the actual situation.

[0051] S106: Generate a connection line to obtain a flexible connection model of the flexible wire.

[0052] Specifically, after calculating the positions of all the middle points and completing the point filling, a Unity capsule object is dynamically generated as a filling object. Its shape is similar to a capsule, with a cylindrical middle and hemispherical ends. Its diameter is set to the diameter D of the flexible wire, and its length is the spacing distance F of the middle points. When F is small, the cable appears relatively smooth.

[0053] When using the model in 3D interactive training courseware, you only need to drag the models MA and MB at both ends to the corresponding positions, and the flexible connection line in the middle can be dynamically displayed through the above method. When the position moves, you only need to call the calculation method again. In this way, you can avoid manually generating model animations and flexibly adapt to the model position adjustment in the scene.

[0054] In some optional embodiments, the flexible wire model generation method further includes:

[0055] Get the appearance properties of the flexible wire;

[0056] The display effect of the flexible connection model of the flexible wire is changed according to the appearance attribute.

[0057] Specifically, when writing software, the technicians can provide an input interface for the courseware writers. The courseware writers can input the appearance attributes of the flexible wires in the input interface according to the attributes of the actual wires, including but not limited to material, roughness, metallicity, etc. The display effect of the flexible connection model of the flexible wire can be changed according to the appearance attributes to achieve a more realistic display effect.

[0058] This embodiment can dynamically generate flexible connecting lines in the middle of the flexible wires, thereby eliminating the need to spend a lot of time making animations and no longer being limited by the position adjustment of the model. This improves the flexibility of the flexible wire connection and improves the efficiency and accuracy of making courseware.

[0059] Example 2

[0060] Corresponding to Example 1, Figure 4 As shown, this embodiment provides a flexible wire model generation device, the device comprising:

[0061] A splitting module, used for splitting the flexible wire into an end portion A, an end portion B, a middle section C, a connecting section CA between the end portion A and the middle section C, and a connecting section CB between the end portion B and the middle section C;

[0062] A modeling module, used to perform three-dimensional modeling on the end A and the end B respectively, and set the model orientation;

[0063] A marking module, used for selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model;

[0064] A filling module, used to generate the intermediate control points of the connection segment CA and the connection segment CB according to the marking points, and to fill the connection segment CA, the connection segment CB and the intermediate segment C respectively through the marking points and the intermediate control points;

[0065] The connection module is used to connect all points according to the preset diameter of the flexible wire to generate a connection line and obtain a flexible connection model of the flexible wire.

[0066] The flexible wire model generation device proposed in this embodiment can be used in Unity 3D. Of course, any software that can realize the editing and display of three-dimensional models can also be used. This embodiment does not make any special restrictions. The specific working principle of the flexible wire model generation device proposed in this embodiment can refer to the content recorded in Example 1, and this embodiment will not be repeated here.

[0067] Example 3

[0068] This embodiment provides an electronic device, including: a processor and a memory;

[0069] Wherein, one or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device performs the following method:

[0070] The flexible wire is divided into an end portion A, an end portion B, a middle section C, a connecting section CA between the end portion A and the middle section C, and a connecting section CB between the end portion B and the middle section C;

[0071] Three-dimensional models are respectively constructed for the end portion A and the end portion B, and the orientation of the models is set;

[0072] Selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model;

[0073] Generate intermediate control points of the connecting segment CA and the connecting segment CB according to the marking points, and fill the connecting segment CA, the connecting segment CB and the intermediate segment C respectively with the marking points and the intermediate control points;

[0074] All points are connected to generate connection lines according to a preset diameter of the flexible wire, so as to obtain a flexible connection model of the flexible wire.

[0075] Example 4

[0076] This embodiment provides a computer storage medium including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the following method:

[0077] The flexible wire is divided into an end portion A, an end portion B, a middle section C, a connecting section CA between the end portion A and the middle section C, and a connecting section CB between the end portion B and the middle section C;

[0078] Three-dimensional models are respectively constructed for the end portion A and the end portion B, and the orientation of the models is set;

[0079] Selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model;

[0080] Generate intermediate control points of the connecting segment CA and the connecting segment CB according to the marking points, and fill the connecting segment CA, the connecting segment CB and the intermediate segment C respectively with the marking points and the intermediate control points;

[0081] All points are connected to generate connection lines according to a preset diameter of the flexible wire, so as to obtain a flexible connection model of the flexible wire.

[0082] In this application, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or can communicate with each other; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0083] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0084] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for generating a flexible wire model, It is characterized in that The method comprises: The flexible wire is divided into an end portion A, an end portion B, a middle section C, a connecting section CA between the end portion A and the middle section C, and a connecting section CB between the end portion B and the middle section C; Three-dimensional models are respectively constructed for the end portion A and the end portion B, and the orientation of the models is set; Selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model; Generate intermediate control points of the connecting segment CA and the connecting segment CB according to the marking points, and fill the connecting segment CA, the connecting segment CB and the intermediate segment C respectively with the marking points and the intermediate control points; All points are connected to generate connection lines according to a preset diameter of the flexible wire, so as to obtain a flexible connection model of the flexible wire.

2. The method according to claim 1, It is characterized in that The method further comprises: Generate a marking point SA at the connection position between the three-dimensional model MA corresponding to the end A and the connection segment CA, and the three-dimensional space coordinate of the marking point SA is marked as PosA; A marking point SB is generated at a connection position between the three-dimensional model MB corresponding to the end B and the connection segment CB, and the three-dimensional space coordinate of the marking point SB is marked as PosB.

3. The method according to claim 2, It is characterized in that The process of selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model includes: Taking PosA as the starting point, extending a predetermined distance along the negative direction of the model orientation to obtain PosCA; Taking PosB as the starting point, extending a predetermined distance along the negative direction of the model orientation to obtain PosCB; Take the midpoint of PosCA and PosCB to obtain PosC.

4. The method according to claim 3, It is characterized in that The process of generating the intermediate control points of the connection segment CA according to the marking points, and performing point filling on the connection segment CA by using the marking points and the intermediate control points comprises: Take at least one intermediate control point PosCA1 between PosCA and PosC through the Bezier curve; Set the point spacing and use the Bezier curve to fill the curve segment composed of PosA, PosCA and PosCA1.

5. The method according to claim 4, It is characterized in that The process of generating the intermediate control points of the connection segment CB according to the marking points, and performing point filling on the connection segment CB by using the marking points and the intermediate control points comprises: Take at least one intermediate control point PosCB1 between PosCB and PosC through the Bezier curve; Set the point spacing and use the Bezier curve to fill the curve segment composed of PosB, PosCB and PosCB1.

6. The method according to claim 5, It is characterized in that The process of filling the middle segment C with points according to the marking points and the middle control points comprises: Set the point spacing and use the Bezier curve to fill the curve segment composed of PosCA1, PosC and PosCB1.

7. The method according to claim 1, It is characterized in that The method further comprises: Get the appearance properties of the flexible wire; The display effect of the flexible connection model of the flexible wire is changed according to the appearance attribute.

8. A flexible wire model generating device, It is characterized in that The device comprises: A splitting module, used for splitting the flexible wire into an end portion A, an end portion B, a middle section C, a connecting section CA between the end portion A and the middle section C, and a connecting section CB between the end portion B and the middle section C; A modeling module, used to perform three-dimensional modeling on the end A and the end B respectively, and set the model orientation; A marking module, used for selecting marking points on the connecting segment CA, the connecting segment CB and the middle segment C respectively according to the orientation of the model; A filling module, used to generate the intermediate control points of the connection segment CA and the connection segment CB according to the marking points, and to fill the connection segment CA, the connection segment CB and the intermediate segment C respectively through the marking points and the intermediate control points; The connection module is used to connect all points according to the preset diameter of the flexible wire to generate a connection line and obtain a flexible connection model of the flexible wire.

9. An electronic device, It is characterized in that include: Processor and memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device executes the method as claimed in any one of claims 1 to 7.

10. A computer storage medium, It is characterized in that The method comprises computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 7.