{'fraction_non_alphanumeric': 0.02342404409231829, 'fraction_numerical': 0.0028246641405442648, 'mean_word_length': 4.683633516053249, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Effective method used to create the analytical models of large sets of curves – application for the ship hull body plan

Information presented graphically as diagrams may be expressed analytically in order to be used in computer based analytical models. The paper presents several methods to extract the coordinates of the points which define a curve whose drawing is stored as a pdf or as an image file. The output information is expressed as text files in CSV format which may be easily accessed by other applications. If the data extraction methods are used for a complex pattern of curves, such as the sectional lines of a ship hull body plane, there must be conceived a hierarchy of data structures which makes the information readily accessible from upper level models. The analytically expressed sectional lines are useful to model the buoyancy forces, which are a part of the loads’ submodel and of the buoyancy centre’s location, necessary to solve the ship equilibrium problems. After we convert the coordinates of the drawing in units of length by using scaling and translation, we analyse a sectional line and we conclude that its complex shape may be expressed as a piecewise-defined function of the breadth with respect of the draft. The necessary data used to structure the information of the body plan is also presented in the paper.


Introduction
Computer aided methods in engineering use input data expressed in various ways, such as values stored in files and values provided by the data acquisition equipment used in experiments. A particular way to express the data is in visual format, an analyst being able to readily interpret the phenomenon under investigation, to evaluate the influences of various parameters and to identify the trends. However, once the data is expressed and stored in a visual format, i.e. as diagrams, it becomes difficult to reuse it in computer aided models without to convert it to become analytical information. The conversion process consists of two stages: digitization of the curve, [1], and interpolation [2]. In this way, experimental data may be expressed as a piecewise-defined function, on each interval being used a (cubic spline) function, [3]. Moreover, using this method, the experimental data may be processed in order to have functions of the isostatics, by replacing the graphic methods with computer aided analytic geometry methods, [4]. A most important aspect regards the mathematical form of the function which approximates a curve, in this way being possible to use the analytical approximation in upper level mathematical operations, such as integration of functions on a domain whose boundaries are approximated using spline functions, [5]. The best idea is to have both: information expressed as diagrams in order to have relevant visual representation and its analytical form in order to use it in upper level sophisticated calculi, especially in domains where visual information is abundant.

Motivation
In naval architecture, the ship hull strength problems use the equilibrium conditions in order to assess the trim of the ship, i.e. its possible rotated position with respect to the centre of flotation, because in most of the practical situations there is no even keel. To accomplish this task there must be used the submodel of the weighting forces and the submodel of the buoyancy forces.
The weighting forces may be evaluated using simple principles which employ direct laborious calculi for the ship hull discretization.
Let us imagine a minimum volume rectangular box which includes the ship hull. We also consider some intersection planes parallel to the fore and the aft, which are designated stations. There are usually considered 21 stations, the most important ones being the Forward Perpendicular (FP) section, the Aft Perpendicular (AP) section and the mid ship section. Some of the sections may not include transverse frames.
The buoyancy forces may be evaluated using the Bonjean curves that are the curves of the cross sectional area for the stations, i.e. the series of transversal intersection planes. A Bonjean curve uses a curve of the transverse shape, i.e. a section line, in order to compute the immersed area and its centroid, designated centre of buoyancy, with respect to several waterlines. In ship design problems the minimum requirement is to consider the Bonjean curves of the stations. However, an accurate design of the buoyancy forces submodel must consider several cross sections where the Bonjean curves are defined. Each Bonjean curve is drawn using several points and for each curve the immersed area and the buoyancy centre coordinate are computed for several waterlines. For this reason, an accurate design should start from the body plan which presents the section lines for each transverse frame along the ship hull.

Original solutions for the hull lines plan conversion into analytical data
The basic idea is to analyse right from the beginning the most general concepts which are helpful for a general definition of the problem and the methods to divide the initial problem in several smaller and simpler problems. Moreover, if the subsequent smaller problems may be solved using simple solutions, such as the direct calculus method, the most accurate and the simplest methods should be chosen.
The analytical definition of each section line allows us to accurately compute the immersed area and the buoyancy centre for any value of the draft. For simplicity purposes of the analytical approach, it is easier to consider as main variable the draft, to be represented along the horizontal axis, and to define the immersed area and the buoyancy centre elevation as functions of the draft for a so-called 'rotated Bonjean curve'.
In order to analytically define the hull line, the first stage is to digitize the curves. There are several methods to solve this problem.

Direct measuring method
This method is presented in reference [1]. It consists of the direct measurement of the coordinates of the points used to define the current curve. A system of axes must be defined, using the units of the original data. Once the axes are defined by points, the method automatically corrects the errors due to the rotation of the diagrams.
The method was extensively used so far, because the volume of the input data was not very large. However, for the hull lines plan presented in figure 1 this method is ineffective because:  There is a huge volume of data to be processed, therefore a lot of time should be dedicated for the operation;  The measurement of the coordinates along the curves may be imprecise due to the human errors;  If we magnify the curves in order to have a higher accuracy, the thickness of the line is larger, the selection of a point inside the curve being possible to become less accurate.
This method may be useful only for survey sampling purposes using a small number of points, or for data calibration, when the scale of the drawings must be deduced. Because the human operator may cause errors, there should be conceived a more general an objective method to convert a given curve expressed as a set of pixels into a geometrical entity defined by points.

Data extraction using an original method
The selection process of the points along a curve would be easier if the curve is already converted from a set of pixels into a geometrical entity. Searching for solutions we found several ideas.
A most effective idea was to convert the pattern of curves into an AutoCAD drawing. This solution was useful because each curve is now a polyline which may be individually selected, as it is presented in the following figure.
The new problem we have to solve is to extract the information regarding each polyline. We use the AutoCAD command 'LOGFILEON'. This command is redirecting the display output to a text file known as the 'log' file. This means that any command we input in AutoCAD, the information printed on the screen is also written in the 'log' text file. The 'log' file has the same name as the currently opened AutoCAD drawing file, i.e. '2017_10_18_Body_line_on_frames.dwg', but the extension is 'log'.
The 'LOGFILENAME' command returns the name of the folder where the 'log' file is stored, i.e. 'C:\Users\CurrentUser\AppData\Local\Autodesk\AutoCAD 2018\R22.0\enu'. By 'CurrentUser' we mean the name of the current user in the Windows 10 operating systems. It should be mentioned that the AutoCAD "AppData" folder is hidden so we should make it visible if we want to check its contents.
In figure 3 is presented an example regarding the structure of the data stored in the 'log' file after the 'LIST' command was inputted.  In order to read the coordinates, an original C++ application was developed which loads a 'txt' version of the current 'log' file, as it is presented in the following figure. After the file is processed, it results a CSV file which stores the coordinates of the current curve. In the following figure is presenting an example regarding the output data and a graphical interpretation of the output coordinates. The next stage is to convert the data from drawing units to real distance units. This is done by multiplying the coordinates with the appropriate scale factors and by performing a translation.
The hull lines plan data processing technique is a long run concern, so we found other methods that are more straightforward than the one previously presented where the data is checked, double checked and over checked.

Data extraction using an AutoLISP method
As soon as we have the body plan as an AutoCAD drawing, we are able to individually access each curve whose points' coordinates are important for us.
Each computer aided design application has at least a programming language that may be used to automatize some operations. AutoCAD is a mature CAD solution, lot of experience being acquired in the development of this software, so we tried to learn from the experience of the experts who use AutoCAD. An appropriate software solution of our problem was found in reference [6]. The 'plist.lsp' application was loaded using the commands 'Manage'  'Load Application', as it is presented in the previous figure, or by typing 'APPLOAD'.
The next stage is to run the application, so the user must type 'PTS', then he is asked to select a geometrical entity. After the selection process is ended, the operator is asked to type a filename of the text file where the coordinates of the points are saved, as is presented in the following figure.
The text file may be opened using an appropriate application, for instance NotePad++, in order to verify its contents. As it can be seen in figure 8, the coordinates are separated by commas, so the file may be also accessed using a spreadsheet application. We copied the text file into a new version having the 'csv' extension and we opened it using Excel. The results may be noticed in figure 8.
If we compare figure 3 with figure 8, one can notice that we have the same coordinates, because the same polyline was selected.
We remove from the 'csv' file the lines in which there are no coordinates and we save the results, again as a 'csv' file, to scale the data and to use it in the upper level computations of the rotated Bonjean curves, as mentioned before.

Other solutions
Other solution was also considered, by directly digitizing the curves. The points may be selected from the curve using a dedicated application, [7]. Because we already solved the problem, we will consider this solution in a follow up study.

Discussion
One can notice the various shapes of the ship hull lines presented in figure 1. The problem regarding the gathering of the points' coordinates located on a curve is solved, but the problem now is to conceive a flexible definition of a hull line, because this definition will be used at a later stage to compute some integrals in order to find the immersed area (rotated Bonjean curves) and the buoyancy centre's location for various waterline levels.
Let us consider the hull line presented in the following figure. As it can be noticed, at the fore and the aft of the hull the cross sections may have a complex shape, the boundary being defined by several lines and curves. In order to express in an analytical way a function whose graph consists of line segments and curves we have to employ a piecewise-defined function. In the previous figure are presented the data used to define a piecewise function staring from the graph presented in figure 9. In this way each component of the piecewise function is active for a given range of values of the draft. The piecewise function may be used as a linear function as it is, without any modifications. However, the curved regions may be approximated using spline functions, [2], if the analyst considers that the real curves are more accurately modelled in this way.

Conclusions
An analytic model of a ship hull requires an analytic model of the loads, which uses an analytic model of the buoyancy forces. The most accurate method to compute the buoyancy forces is to use as input data the sectional lines of the ship hull body plan.
Once the body plan is available, there may be used several methods to express in an analytical way the pattern of curves, i.e. the sectional lines. In this way, there are presented several methods to extract the coordinates of the set of points which defines each hull line. The analyst may select one of the digitization methods, according to a set of criteria, such as: maximum accuracy of the output information, minimum volume of work of the human operator and others.
The hull line expressed by a set of points may have various shapes. However, we need a unique analytical form of the graphs which must express the variation of the hull's breadth with respect of the draft. In this way, we use piecewise-defined functions which may be used in the upper-level operations: calculus of the immersed area in order to define the rotated Bonjean curves, the elevation of the buoyancy centre in order to consider the ship equilibrium conditions. The method is appropriate from simple empirical models' functions, [], up to the upper level of complexity which is the automatic shape recognition of the hull line components, [9]. The paper is an example regarding the strategy to create computer based models, whose analytical components may be an important strength and it is included in the trend regarding the creation of original models in marine engineering, [10,11].