Notifications
Clear all
[Closed] what is this for #{}
Aug 24, 2014 9:57 pm
I know #() this is for a array, but what is this used for #{}
Thanks for any help
4 Replies
Aug 24, 2014 9:57 pm
it’s an array of bits, max uses it for vert, face and edge selection for example, useful because it would take up 32 times less space than an array of ints. Also has the wonderfully useful ability of being able to perform logical operations across the whole array… for example
fn collectMeshPolys mObj =
(
nfaces = meshop.getnumfaces mObj;
faces = #{};
faces.count = nfaces;
polys = #();
for f = 1 to nfaces where not faces[f] do
(
pfaces = meshop.getPolysUsingFace mObj f threshhold:180;
append polys pfaces;
faces += pfaces; -- ORs the faces bitarray with the poly faces bitarray "tagging" them so we don't have to process them again (see the for loop)
)
polys;
)
Aug 24, 2014 9:57 pm
however useful they are the draw backs with using bitarrays is they have only one concept of order