Representing a 3D Realistic Virtual Cables in a 2D Environment Representing a 3D Virtual Reality

— A new method for the realistic visualization of virtual cables in a 2D environment, which is representing a 3D virtual reality, is presented in this paper. They are described with two consecutive cubic Bezier curves, whose common point is movable. Experiment was carried out and the optimal propor-tions for the parameters of the curves were obtained in order to achieve a realistic representation of cables. The suggested method has been developed for and implemented in the Engine for Virtual Electrical Engineering Equipment. The obtained results show that it is easy to manipulate the route of the virtual cables in 2D space and that they look realistic for any position of the control point.


Introduction
The development of virtual laboratories for engineering specialties is a major task in the contemporary education. It is enforced by many factors, such as improving the understanding of the material, substitution of expensive equipment, covering the basic requirements to provide distance learning, preparing of the trainees for Industry 4.0, etc.
One of the problems with laboratories in electrical engineering is the realistic representation of the virtual cables. Previous studies have used different approaches to achieve this and their success largely depends on the types of the virtual laboratory. The easiest way to implement virtual cables is with a straight line, connecting the two sockets (jacks) together; such approach is used in Autodesk circuits [1]. The results are quite satisfactory because this is a 2DR2D type of environment (Figure 1a). A similar approach is used in the eLab3d environment [2], however this is a 2DR3D platform, which makes the results less satisfactory and the VR unrealistic ( Figure 1b A more advanced solution has been used in the VISIR platform, which has been reused as a basis for many virtual labs [3,4,5]. The cables are represented with three nodes, two of which are "plugged" in the sockets. The third node is used to manipulate the route of the cable ( Figure 2). This approach offers a very realistic representation of the cable in a 2DR2D environment, however it would still be inappropriate for a 2DR3D one, as there are more than one planes available, to which the cable should be connected. A significantly different approach has been used in 3DLab [6]. This is a 2DR3D environment, where the cables are freehand drawn during connection ( Figure 3). This method is definitely better for an imitation of the 3D environment; however, the cables look unrealistic and curvier than they are expected to be. With this approach, the look of the cable would much depend on the expertise of the user.
In pure 3D environments, mainly cables based on complex multi-node models are used. In Ref. [7] is presented a kinematic model, which uses several mass points (segments) for the cable. The results showed that with the increase of the number of nodes, the required memory increased exponentially. In Ref. [8] has also been used a model with multiple mass points, and in Ref. [9] has been simulated a realistic 3D cable by dividing it into numerous sections. In Ref. [10] flexible cables were implemented with a mechanical model using their sagittal diameter, pitch angle, and deflection angle. In all cases was achieved a very realistic visualization of the 3D cables. The available approaches for visualizing virtual cables in 2DR3D environments do not look realistic enough. On the other hand, the models used in pure 3D environments are unnecessarily complicated for a 2D one. The goal of this study is to present a simple method for realistic visualization of virtual cables in a 2D environment, which is representing a 3D virtual reality.

MATERIALS AND METHODS
The main problem with the available methods for visualization of virtual cables in a 2D environment is that they are designed for a single plane. However, in a 3D reality, multiple planes are available and as a result, the cables could be plugged into (coming out of) more than one 3D surface. This implies the need for their ends to be oriented towards the corresponding plane in order to look realistic. They should also have at least one degree of freedom.
The proposed method for visualization of virtual cables is based on Bezier curves. A cubic Bezier curve is described with four points P 0 , P 1 , P 2 and P 3 , according to [11]: (1) P i is the i th vector (point) of the control path and the base functions B i 3 (t) are estimated with the Bernstein polynomial: (2) In the present study is suggested that each virtual cable can be implemented with two connected cubic Bezier curves, respectively marked as abcd and defg. Two situations are presented in Figure 4. In the first case, a cable connects two surfaces, which are located in the XY and XZ planes and the 2D distance between the two sockets is ag. The virtual cable is represented with two cubic Bezier curves defined between the points a-d and d-g. The sections ab and fg are perpendicular to the two planes and their lengths are: ( The divider m is a constant. Another important rule is that the sections cd and de are equal in length and are in parallel to the section bf: In equation (4) n is also a constant. In the second situation presented in Figure 4, the virtual lead connects two surfaces in the XY and YZ planes. The same rules apply to the sections of the cubic Bezier curves and the same constants m and n are used.
This study suggests that in order to have a realistic representation of the virtual cable, the constants m and n should be carefully chosen. The cables will also have one degree of freedom, provided by the common point of the two curves -d.

Results and discussion
In order to choose the optimal values of the constants m and n, four test scenarios have been used ( Figure 5 An experiment has been carried out in CorelDraw X5. The suggested cable model with two cubic Bezier curves has been implemented as a curve with three nodes where for the middle one is selected the "Symmetrical" option. Different values for the constants m and n have been used in numerous experiments. The following values of the constants were chosen as optimal in order to provide realistic visualization of the virtual cables: m=7 and n=3.5 (5) The results of the four scenarios with the chosen constants are presented in Figure  6, Figure 7, Figure 8 and Figure 9. In order to test the degree of freedom of the cables, different locations of the common point d (the middle node) are presented for each scenario. From the obtained results can be seen that the proposed method ensures a very realistic representation of the virtual cables in a 2DR3D environment. The change in the position of the common point d does not spoil the sense of 3D reality, because even though the cables go through different parts of the 2D space, they keep their orientation near the sockets perpendicular to the corresponding 3D planes.
The presented method for visualization of virtual cables has been implemented in the Engine for Virtual Electrical Engineering Equipment (EVEEE), which is currently being developed and tested. A sample virtual lab is shown in figure 10. As can be seen, the suggested model is very powerful in terms of controlling the route of the cables and offers easy manipulation via their common point d. This does not affect the sense of reality and allows to avoid cable overlapping.

Conclusion
In the present study, a new model for visualization of virtual cables has been presented. It is applicable in 2D environments, which represent 3D virtual reality. Two consecutive cubic Bezier curves abcd and defg represent the cables. The starting section ab and the ending section fg are perpendicular to the two planes, to which they are attached and the sections cd and de are parallel to the section bf.
An experiment was carried out in CorelDraw in order to determine the appropriate parameters of the Bezier curves. The optimal lengths of the sections were obtained to be ab=fg=ag/7 and cd=de=ag/3.5. The performed experiments and the obtained results showed that the change in the position of the common point d does not spoil the sense of reality of the virtual cables. The model has been implemented in the EVEEE platform.