[Swansea Hackspace] openscad maths

Ceri Clatworthy ceri.clatworthy at gmail.com
Thu Oct 30 13:37:39 GMT 2014


Hi, going crazy here ...


I need something like:


test = 102; // 0x66

if (test AND 1) {do something usefull @ poz 1};
if (test AND 2) {do something usefull @ poz 2};
..
..
..
if (test AND 128) {do something usefull @ poz 128};
if (test AND 256) {do something usefull @ poz 256};

excerera ...excetera ...



e.g. draw the binary representation of a 16 bit number in cubes/spheres !!!

102 should look like:

_##_ _##_

128:

#___ ____

170: (0xAA)
#_#_ #_#_

85 (0x55)
_#_# _#_#

Cheers

Ceri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://swansea.hackspace.org.uk/pipermail/hackspace/attachments/20141030/7e485bd1/attachment.html>


More information about the Hackspace mailing list