Hi all,

The brlcad bu_bitv is very intelligently implemented. But it turns out to be very difficult to wrap that in the python code which is required for BOT primitive

Below, I explain the situation further.

-> The bu_bitv has a vector "bits" which is a unsigned char type of data. (of size 2 as per the definition)

-> Now during the initialization of a bu_bitv, only the required memory is allocated as required by the number of bits. So for example if I have only 8 bits to store the api is programmed such that the memory which will be allocated will be = sizeof(bu_bitv) - 2(substract the 2) + 1 (allocate a byte for 8 bits)

->Now while importing a structure in python code we cannot determine whether extra memory has been allocated or not!

Please suggest remedial measure I should adopt. I spent a long time understanding the code and what is happening. ;-) Please use the below links for understanding further.

bot structure : [1]
bit_v : [2]
A typical usage of bit_v for bot : [3]

Cheers!
Raj.

[1] http://brlcad.org/xref/source/include/rtgeom.h#L620
[2] http://brlcad.org/xref/source/include/bu.h#L1365
[3] http://brlcad.org/xref/source/src/libged/typein.c#L1018