BlockCAD technical info

Back to BlockCAD home 

The brick data for BlockCAD can be contained in many places, important files from the beginning are blockcad.ini and parts.dat, later on you may have any number of part files with any name:

BlockCAD has a couple of limitations, which (as far as I see) never will go away:

There are also some more short term limitations, which I hope to remove sometime in the future:


Hardcoded brick types

All those brick descriptions look like <type indicator> <length>x<width>x<height>. The length and width are measured in one-stud pieces, the height is measured in plates (i.e a standard brick has a height of three).

Sample blockcad.ini

---
[Main]
Pages=4
LDrawLIB=C:\DOSAPP\LDRAW
LDrawTest=MODELS\TEST.DAT
[Page1]
40 ; This is the item height in the selection listbox
4x2x3
3x2x3
2x2x3
[Page2]
60
10x2x3
8x2x3
10x1x3
[Page3]
40
T 4x2x3
C 2x2x3
T 1x2x3
N 4x2x3
I 2x2x3
E 1x2x3
[Page4]
76
G parts.dat, stdblock
G parts.dat,roofinner
G parts.dat,lwing
G parts.dat,rwing
M combos\minifig0
---

There can also be an alternate display name after a vertical bar '|' on the brick descriptions. The idea is to note the actual Ldraw part identity here, so you have a chance to use only the pieces that can be drawn in Ldraw.

For the M-lines to work correcly, You have to add a bitmap (.bmp) to the same directory as the model is in. Don't make the bitmap too large!

Sample parts.dat

The general bricks use higher resolution coordinates, a one stud piece (1x1x3) is 20x20x24 here. The octant is the current viewing direction. For bricks that are transparent, you really need to draw every surface, irrespective of the viewing octant, for opaque bricks you can optimise by only drawing the visible surfaces. The ordering of the surfaces is important, you must give them in an order that guarantees that a surface that can occlude another is drawn after it. On bricks with many slopes in different directions this might well be impossible (use Ldraw instead)!

---
[stdblock] ; name of the brick
NP=6 ; number of polygons (surfaces)
BB=80,40,24 ; size of bounding box
; Surface 1, 4 corners, bordered, x, y, z, ...
P1=4, 1, 0,0,0, 0,40,0, 80,40,0, 80,0,0
; Surface 2, etc.
P2=4, 1, 0,0,0, 0,40,0, 0,40,24, 0,0,24
P3=4, 1, 0,0,0, 80,0,0, 80,0,24, 0,0,24
P4=4, 1, 0,40,0, 80,40,0, 80,40,24, 0,40,24
P5=4, 1, 80,0,0, 80,40,0, 80,40,24, 80,0,24
P6=4, 1, 0,0,24, 0,40,24, 80,40,24, 80,0,24
; Drawing information for all octants
; octant 0: 3 surfaces, surface numbers
; etc.
Q1=3 ,6,4,2
Q2=3 ,6,3,2
Q3=3 ,6,3,5
Q4=3 ,6,4,5
Q5=3 ,4,2,1
Q6=3 ,3,2,1
Q7=3 ,3,5,1
Q8=3 ,4,5,1
; Top studs: which surface, number of studs, x, y, ...
TS=6,8, 10,10, 10,30, 30,10, 30,30, 50,10, 50,30, 70,10, 70,30
; Bottom studs
BS=1,3, 20,20, 40,20, 60,20
---

In some of the brick descriptions you might see another parameter 'LD=2'. This tells the program that this brick needs special handling when converting to Ldraw format. As the conversion routines are in the program code, you have no possibility to add another 'conversion special', so you should never use this (unless you have the source code of course).


Editing standard blocks - not written yet

Editing general blocks - not written yet

BC2LD.LST description - not written yet

 

Last updated 1998-10-03

  isaksson.etuna@ebox.tninet.se