How to create own part

Adding of own part consist from next steps:


  1. editing of file parts.dta

  2. creating of datafile (*.dta)

  3. creating of program for part generating.


Best aid is study of existing part files.


1)

Structure of file parts.dta:



row type

c

name of part group , splash picture is displayed


p

part


e

end of file



name of program, picture and datafile.

(exe,png,dta)


in program is used one name for program


that generates part, part picture,


and datafile with sizes.



short name of part

is displayed in listbox heading.



long name of part

is displayed in window under picture


Separator between items is semicolon
In case that row type is group (c;), is second value short name of part.


2)

Structure of datafile:


standard identification

must be without gaps, as word separator can be used underscore



sizes




structure of data

0: submenu

to particular size

1: data (only once and at the end)



names of values

they are displayed in window under the picture one step before part is generated



data to particular size

as ending character (bumper) is used character "#"




3)

At first is necessary to draw in some CAD system picture of part,
which will be displayed and picture with numbers of points that will be calculated and help
for part drawing.





Creating of picture *.png


Under windows is possible to create hardcopy of screen by pressing keys Shift+PtrScr
Then in program Paintbrush resize picture at dimensions 500x350 points
and convert to format png in Linux using program convert (ImageMagic).

In Linux is possible to create hardcopy of screen using program xv. Save it in format xpm.
To resize of picture use program xpaint and convert to format png using program convert.

Format png is suitable for vector graphic. Formats xpm, bmp create files with big sizes.
Format jpg blurs edges.
Total size of pictures used in program parts is about 200 kB.


Creating of program for part generation:


As template is possible to use existing file.
The structure of program is very simple. Consist from checking of number
input parameters, reading of configuration file parts.cfg, reading of input parameters,
calculating of points coordinates and own generating.
The generating consist from generating of header, generating of lines
circles and arcs and generating of footer. How exactly program works you can see
in file write.c.
Mathematical routines are in file dr2D.c
Common routines are in file common_csn.inc.