Nice tutorial
I have one suggestion about the usage of the voxelIdList
If you are using it as a lookup for the hash of previously seen items,
using a list is going to be progressively slower and slower over time as
the list grows, because doing "x in list" is O(n) complexity. You might
want to use a set():
##
voxelIdSet = set()
...
if cubeId in voxelIdSet :
continue
else:
voxelIdSet.add(cubeId)
##
A set is O(1) complexity, so doing "x in set" will instantly find the item
by its hash, as opposed to have to scan the entire list looking for an
equality match.
On Wed, Mar 20, 2013 at 4:11 AM, Ravi Jagannadhan <[email protected]> wrote:
> There should be some way of using this to make better minecraft models....
>
>
> On Tue, Mar 19, 2013 at 8:11 AM, Daz <[email protected]> wrote:
>
>> Wow thanks! I'm all over it ! :)
>>
>>
>> On Sunday, 17 March 2013 21:23:12 UTC, Narann wrote:
>> > Hy all!
>> >
>> >
>> > I've just over a very little (but I think fun) tutorial about how to
>> reproduce geometry voxelization using Maya Python API.
>> >
>> >
>> > It could be more optimized etc but I've done this quickly, just for
>> fun, and would like to share with you.
>> >
>> >
>> >
>> >
>> http://www.fevrierdorian.com/blog/post/2013/03/16/Geometry-voxelization-using-Maya-Python-API
>> >
>> >
>> > The second version is more opimized and work with animation.
>> >
>> >
>> > Regards,
>> >
>> >
>> > Dorian
>> >
>> >
>> >
>> > PS: For french, a french version:
>> >
>> >
>> >
>> http://www.fevrierdorian.com/blog/post/2013/03/16/Voxelisation-polygonale-via-l-API-Python-Maya
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> --
> Where we have strong emotions, we're liable to fool ourselves - Carl Sagan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.