Process automatization of creating shape of anti-aircraft missile nose in AutoCAD software

The proper use of a large amount of energy from a rocket engine, transformed in a relatively short time, requires ensuring the most favorable movement conditions. Rocket armament designers therefore use optimization methods as widely as possible. Two issues play a major role in the search for optimal flight conditions. First of all, optimal control programs should be selected, including propulsion programs and rocket direction control programs, and secondly rocket shapes with the lowest aerodynamic resistance [6]. Basic criteria in rocket flight dynamics are the minimum time to reach the target and the minimum energy needed to travel the route to the target. When considering the motion of the projectile in the atmosphere, the minimum-time criterion does not take into account energy losses, which are the greater the faster the rocket's flight speed. Increasing the speed should result in a shorter flight time. This does not mean, however, that in the case of missiles controlled by a minimaltime program, energy losses play no role. However, the only way to reduce them is to reduce aerodynamic resistance. Therefore, searching for the shape of the body with the least aerodynamic resistance is one of the most important problems. The most favorable rocket hull contour can be sought for various ranges of flight speed. Different speed ranges correspond to different air reflection hypotheses. The search for the optimal nose contour can be reduced to minimizing pressure resistance without taking into account friction. However, friction resistance can only be considered when determining the most favorable nose extension. This approach is justified, because frictional forces as tangent to the stroke slightly affect its shape, but are important in determining the slenderness of the nose. The function describing the nature of the anti-aircraft rocket nose curve can be determined using a variation calculus. The task is to determine the contour resistance of the expanding part of the hull defined as the rotary body (fig. 1).


Introduction
The proper use of a large amount of energy from a rocket engine, transformed in a relatively short time, requires ensuring the most favorable movement conditions. Rocket armament designers therefore use optimization methods as widely as possible. Two issues play a major role in the search for optimal flight conditions. First of all, optimal control programs should be selected, including propulsion programs and rocket direction control programs, and secondly -rocket shapes with the lowest aerodynamic resistance [6].
Basic criteria in rocket flight dynamics are the minimum time to reach the target and the minimum energy needed to travel the route to the target. When considering the motion of the projectile in the atmosphere, the minimum-time criterion does not take into account energy losses, which are the greater the faster the rocket's flight speed. Increasing the speed should result in a shorter flight time. This does not mean, however, that in the case of missiles controlled by a minimaltime program, energy losses play no role. However, the only way to reduce them is to reduce aerodynamic resistance. Therefore, searching for the shape of the body with the least aerodynamic resistance is one of the most important problems. The most favorable rocket hull contour can be sought for various ranges of flight speed. Different speed ranges correspond to different air reflection hypotheses. The search for the optimal nose contour can be reduced to minimizing pressure resistance without taking into account friction. However, friction resistance can only be considered when determining the most favorable nose extension. This approach is justified, because frictional forces as tangent to the stroke slightly affect its shape, but are important in determining the slenderness of the nose. The function describing the nature of the anti-aircraft rocket nose curve can be determined using a variation calculus. The task is to determine the contour resistance of the expanding part of the hull defined as the rotary body ( fig. 1).
For the function defined in this way and for the shape of the cylindrical part of the hull ( fig. 2), the total resistance coefficient of the anti-aircraft rocket is the sum of the pressure resistance coefficient Cxc and friction resistance Cxt [6]: where: λn -extension of the nose, λc -extension of the cylindrical part.

Access to AutoCAD objects
Free modeling systems do not contain functions that automatically generate the coordinates of nodal points of polylines or regions, which are in turn used to create solid objects. For these reasons, it was decided to develop an application that would generate the geometry of the spatial model of the nose of the anti-aircraft rocket using AutoCAD and a free programming environment.
Programming of graphics tasks is possible using the automation interface and programming languages built into the CAx systems [1][2][3]. The requirements set in the process of generating the anti-aircraft rocket model are fulfilled by the client-server interface, with the role of the automation client being played in Delphi using the Embarcadero RAD Studio programming environment, while the role of the automation server -AutoCAD 2018. OLE automation includes the ability to programmatically control the objects of another program and the protocol, by which a program can access an object in another program. Connecting OLE server to the AutoCAD is possible due to the CreateOleObject function, which when invoked, creates an object sharing AutoCAD objects. However, to gain access to the currently open drawing, the GetActiveOLEObject function is used, which provides objects of the active external program. Connection to the OLE server for programs created in the Delphi language is provided by the PolaczAutoCAD module ( fig. 3). The PolaczZACAD procedure in this module allows for access to the space of the model of the CAx system running. {koniec zewnętrznego bloku chronionego} initialization finalization AcadApp:=Unassigned; AcadDoc:=Unassigned; AcadDwg:=Unassigned; end.

Example of automating the introduction of spatial objects
The RAD Studio 10.2 Tokyo Starter programming environment and Delphi programming language were used to develop the computer program Nosek.exe [4], enabling the introduction in the AutoCAD model area of a uniform solid nose of the anti-aircraft rocket. A rocket nose block can be created using standard spatial drawing commands, based on profiles defining a given block (both polyline and region objects can be used). To automate this process, one must define selected methods of the AutoCAD 2018 OLE interface (see table) for entering flat and spatial objects [5].
Function describing the shape of the nose was used to create a closed profile of the region type, on the basis of which a solid object was created using the AddRevolvedSolid command. A fragment of the code of the main module Nosek.pas, which allows for defining a solid by twisting the region and removing the twisting envelope, is shown in fig. 4. The operation of the Nosek.exe program is shown in fig. 5.

Summary
Users can automate repetitive design tasks with computer-aided design programs. For this purpose, special, newly developed programs can be used, which are not standard attached to CAD programs [7][8][9][10][11].
Automatic definition of AutoCAD drawing components can have a wide practical use. The example of using the Delphi language presented in the paper confirms that the use of programming languages allows for the automation of modeling of flat and spatial objects in computer-aided systems, which indirectly also leads to a more productive use of given CAx systems.