Kitchen Pages, computer software
Go Back | KP2/KPD Description | KP2/KPD Syntax | Configure

Shape Templates for KitCAD2:

Shapes.exeShapes.exe 1.00.

Shapes Editor #.#6 is started from KitCAD2.exe for creating and basic editing of shape template files for KitCAD2



User created shape templates for KitCAD2 using the KP.BPL for Plan Views and KP2GLU32.EXE for 3D previews can be created with the added use of KPT or KPTG file types, as discribed below.

All KitCAD2 file types conform to us-ascii Win32/16 application types. All information is kept in a user editable form like simple text, etc.

A wizard is provided to compile advanced user created templates from Shapes.exe - See mkkpti wizard help for more information.

Notice for ALL Shapes.exe users:

All Users are advised to Delete or Remove all KPT and KPTG shape template files before rendering 3D or using KitCAD2.
It is recomended that Advanced users only operate shapes.exe until it is completed before 8/2004. Please download updates below for KPT/KPTG scripts.




Shape.exe File Type Information



*.KPT - Shape Template File type:

KPT files store the instructions used to draw on the canvas component control of KP.BPL.
The file name is gathered from any KPD file under the key of Addons. This has the affect of allowing simmilar friendly names to be used, with a change of file extension.

An example:
bc2di.kpt would be searched for while (and loaded if found) in drawing of bc2di.kpd, or bc2di.dat.

*.KPTG - Shape Template File type:

KPTG files store the instructions used to draw on the canvas control of KP2GLU32.EXE.
The file name is gathered from any KPD file under the key of Addons. This has the affect of allowing simmilar friendly names to be used, with a change of file extension.

An example:
door.kptg would be searched for while (and loaded if found) in drawing of bc2di.kpd, or bc2di.dat.

KPT files are used to define overall lines shown on plan while KPTG files are used to define Object Item shapes rendered by OpenGL. KPT files can be used for whole objects like bc2di while KPTG files are designed for the parts within like doors, benchtops, etc.

A nested structure can also be employed having the affect on all object items within.


*.KPTS - Template Storage File type:

KPTS files store the instructions that can be used to create KPT and KPTG file types.

*.KPTI - Template Indicator File type:

KPTI files store the instructions that can be used to create KPT and KPTG file types using data from the KPTS file types.

The KPTI file types are created for KPD files when a user selects User Created Shapes from the Advanced section of the Edit Shape tab of Shapes.exe.

Currently the User Created Shapes system (known as UCS) is only enabled for default UCS KPD formats at the present time.



KPT / KPTG file example




;//---------------------------------------------------------------------------
;//---------------------------------------------------------------------------
;//- Default Shape Editor for KitCAD2 KP.BPL $Version 1.0
;//- Default Shape Template for KitCAD2 KP.BPL $version #.25 - #.#6
;//- Default Shape Template for KitCAD2 KP2GLU32.exe $version #.25 - #.#6
;//Created for http://www.kitcad.com/
;//kp.bpl 15 x glu32.dll 120 template
;//By Jason Robinson, 6/2004 - (C) Copyright 2004, all rights reserved.
;//- Updated 11/2005 - corrected GL script and kp2glu32.exe
;//---------------------------------------------------------------------------
;//---------------------------------------------------------------------------
;The kpt_version section below is for Shapes.exe to read files
;
[kpt_version]
kwr=Default Shape Editor for KitCAD2 KP.BPL $Version 1.0
vxr=Default Shape Template for KitCAD2 KP.BPL $version #.25 - #.#6
gxr=Default Shape Template for KitCAD2 KP2GLU32.exe $version #.25 - #.#6
Fwr=
0wr=
1wr=
2wr=
ucst=
ucstfile=
ucstg=
ucstgfile=
kpbpl1=
kpbpl2=
kpbpl3=
kpbpl4=
kpbpl5=
kpglu1=
kpglu2=
kpglu3=
kpglu4=
kpglu5=
kpglu6=
kpglu7=
;
;Currently manual Use of this template is needed to generate other shapes as needed.
;This template format gives text control to the way kp.bpl in a user editable format for
;a)drawing data and, b)allow creation of shapes/voids and, c)transport rendering data
;
;An example is templates of the above for all objects, using the extension of filename.kpt
;If no file is located then the default, simmilar to this will be applied.  The KPT file
;is only loaded when located.
;
;//comment lines start with the ; symbol
;//below is a syntax, as description first, with example second:
;0=number of lines, 17 lines to read in the example below.
;d=debug, 1 for on, 0 is default.
;1=command of above, std c++ line type, etc.  MoveTo, LineTo with 2 extra entries, ArcTo with three, etc.. 
; the addition of the DEF prefex will allow an extra interger value either positive or negitive into the sum.
;2=command(x+DEFx,0) with x being matched to a known sum, DEFx is user defined.
;3=command(0,y+DEFy) with y being matched to a known sum, DEFy is user defined.
;4=LineTo
;5=x 
;6=y
;7=LineToDEF
;8=x 
;9=DEFx
;10=y
;11=DEFy
;//For more information see the c++ on how KGraphicControl.cpp loads this.
;//some headers are required which include plan_neg, plan_pos, line_3d, poly_3d
;//---------------------------------------------------------------------------
;//---------------------------------------------------------------------------
;
;//---------------------------------------------------------------------------
;//Square 4 sides - line drawing PLAN VIEW - KP.BPL
;//---
;//---------------------------------------------------------------------------
;
[plan_neg]
d=0
0=15
1=MoveTo
2=Fmovex
3=Fmovey
4=LineTo
5=Fmovex+B1
6=Fmovey+P1
7=LineTo
8=(Fmovex+B1)-P2
9=(Fmovey+P1)+B2
10=LineTo
11=Fmovex-P2
12=Fmovey+B2
13=LineTo
14=Fmovex
15=Fmovey
;
[plan_pos]
d=0
0=15
1=MoveTo
2=Fmovex
3=Fmovey
4=LineTo
5=Fmovex+B1
6=Fmovey+P1
7=LineTo
8=(Fmovex+B1)-P2
9=(Fmovey+P1)+B2
10=LineTo
11=Fmovex-P2
12=Fmovey+B2
13=LineTo
14=Fmovex
15=Fmovey
;
;//---------------------------------------------------------------------------
;//Square 4 sides - line drawings 3D - KP2GLU32.EXE
;//---
;//---------------------------------------------------------------------------
;
;below is inserted for OpenGL renderings using kp2glu32
;The following is defined for Object Items only and differs from the above.
;Use these templates to create shaped object items like a door with door.kptg
;A file loader will be developed for kp2glu32.exe, glskel.cpp for
;Colour, glVertex3f, 3 values, and a DEF section the same as kpt example.
;define names and sides below for a cube shape to suit plan view of kp.bpl with
;an objected added ontop to finish with, as above.
;
;//---------------------------------------------------------------------------
;//Additional keys for gl renderings are below
;0=amount of section shapes or commands
;1=red value =0.0f
;2=blue value =0.0f
;3=green value =0.0f
;l=lines or vertex commands within section =GL_QUADS
;c=lines or vertex commands expressed as a number =4, not used..
;
;
;//---------------------------------------------------------------------------
;
[glu]
l=GL_QUADS
c=4
d=0
0=120
;//-----------------glu_side_1
1=glColor3f
2=0.0
3=0.7
4=0.1
5=glVertex3f
6=ATPosX
7=AHeight-AHeightFrom
8=ATPosY+ADepth
9=glVertex3f
10=ATPosX+AWidth
11=AHeight-AHeightFrom
12=ATPosY+ADepth
13=glVertex3f
14=ATPosX+AWidth
15=0
16=ATPosY+ADepth
17=glVertex3f
18=ATPosX
19=0
20=ATPosY+ADepth
;//-----------------glu_side_2
21=glColor3f
22=0.9
23=1.0
24=0.0
25=glVertex3f
26=ATPosX
27=AHeight-AHeightFrom
28=ATPosY
29=glVertex3f
30=ATPosX+AWidth
31=AHeight-AHeightFrom
32=ATPosY
33=glVertex3f
34=ATPosX+AWidth
35=0
36=ATPosY
37=glVertex3f
38=ATPosX
39=0
40=ATPosY
;//-----------------glu_side_3
41=glColor3f
42=0.2
43=0.2
44=1.0
45=glVertex3f
46=ATPosX
47=AHeight-AHeightFrom
48=ATPosY+ADepth
49=glVertex3f
50=ATPosX+AWidth
51=AHeight-AHeightFrom
52=ATPosY+ADepth
53=glVertex3f
54=ATPosX+AWidth
55=AHeight-AHeightFrom
56=ATPosY
57=glVertex3f
58=ATPosX
59=AHeight-AHeightFrom
60=ATPosY
;//-----------------glu_side_4
61=glColor3f
62=0.7
63=0.0
64=0.1
65=glVertex3f
66=ATPosX
67=0
68=ATPosY+ADepth
69=glVertex3f
70=ATPosX+AWidth
71=0
72=ATPosY+ADepth
73=glVertex3f
74=ATPosX+AWidth
75=0
76=ATPosY
77=glVertex3f
78=ATPosX
79=0
80=ATPosY
;//-----------------glu_side_5
81=glColor3f
82=0.7
83=0.7
84=0.2
85=glVertex3f
86=ATPosX
87=0
88=ATPosY+ADepth
89=glVertex3f
90=ATPosX
91=0
92=ATPosY
93=glVertex3f
94=ATPosX
95=AHeight-AHeightFrom
96=ATPosY
97=glVertex3f
98=ATPosX
99=AHeight-AHeightFrom
100=ATPosY+ADepth
;//-----------------glu_side_6
101=glColor3f
102=0.4
103=0.5
104=0.1
105=glVertex3f
106=ATPosX+AWidth
107=0
108=ATPosY+ADepth
109=glVertex3f
110=ATPosX+AWidth
111=AHeight-AHeightFrom
112=ATPosY+ADepth
113=glVertex3f
114=ATPosX+AWidth
115=AHeight-AHeightFrom
116=ATPosY
117=glVertex3f
118=ATPosX+AWidth
119=0
120=ATPosY
;//---------------------------------------------------------------------------
;eof



NOTE : Over use of KPT or KPTG file types will cause a slowing down - use only when needed.

Lines may be added or removed with the following rules (z=height):
{glcolor3f} r b g
{glvertex3f} x z y
{glvertex3fDEF} x 0 z 0 y 0



The default location to Store KPT or KPTG file types is in the C:\Program Files\Kitchen\Objects\ subdirectory.

Shapes.exe supports wizards for Novice and Advanced users, and more information See MKKPTI.exe help.

Updated Templates can be downloaded from a zipped archive of Updated Shapes.exe default kpt kptg files - Oct/2005.
Extract the Shapes15.zip file to C:\
Run with the command of C:\Program Files\Kitchen\Shapes\15x120_default.bat





©Copyright 2005, all rights reserved.

Updated on the 30th of October, 2005.

Valid HTML 4.01 Transitional