» meanwhile at microdee's lab: RectPack
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

meanwhile at microdee's lab: RectPack

Yo vvvvellas!
I decided to write a little devblog here for stuff I'm adding to my packs, because as you could notice I'm not too good with keeping you guys updated about what's going on around my contribs, not anymore! so for start:

newest addition to mp.essentials is 2 rectangle packing nodes most obviously used for texture packing to an atlas with 2 different algorithms. RectPack (2d Czachurski) and RectPack (2d ChevyRay). Versions are actually carrying the name of the guys whom I ripped of.

The more advanced and most of the cases better algorithm is provided by Patryk Czachurski here: https://github.com/TeamHypersomnia/rectpack2D I ported his code to C# and you can see the result with 413 random rectangles in the above screenshot. Each rectangle has sides between 250-1250 pixels and the Czachurski node packs them into ~15080×15074 pixels sized space. This algorithm also provides multiple sheets (or bins or slices) of atlasses if the input rectangles wouldn't fit in the desired box size. Here is an example with textures using 8448×8832 pixels:

The other algorithm provided by Chevy Ray Johnston here: https://github.com/ChevyRay/RectanglePacker might be easier to use, less intelligent and you don't have to specify a box size.

However notice it is not at all as efficient as Czachurski in terms of filling the space with lots of rectangles. Same random rectangles are using 22845×24232 pixels. It does a slightly better job at mostly square shaped textures though (here 8448×8704 pixels)

you can get it here: md.ecosystem.mp through vpm. Enjoy!

Immediate Update

Immediately after writing this post I've noticed some differences between my results and the results at Czachurski's repo and I've noticed that apparently C++ sort is the reverse of C# LINQ sort. Now the Czachurski node produces results are replaced now they are more similar to the original ones.

microdee, Thursday, Dec 1st 2016 Digg | Tweet | Delicious 4 comments  
digitalwannabe 01/12/2016 - 14:54

yeah!

joreg 01/12/2016 - 15:16

devblog! so very much appreciated..keep'em coming! and who's next?

microdee 23/02/2017 - 21:55

@Patryk Czachurski: Nah it was totally readable and straightforward code. Here's my C# implementation: https://github.com/microdee/mp.essentials/blob/master/src/transform/CzachurskiRectanglePackerNode.cs
For my education what you consider bad in your code?

microdee 08/05/2018 - 02:16

@Patryk Czachurski: niiiice! and thanks for the reminder, I need to freshen up a bit my texture atlas handling too so yup still interested ;)

  • 1

anonymous user login

Shoutbox

~10d ago

~18d ago

joreg: Webinar on October 2nd: Rhino meets Realtime with vvvv https://visualprogramming.net/blog/2024/webinar-rhino-meets-realtime-with-vvvv/

~19d ago

joreg: 12-session online vvvv beginner course starting October 7th: https://thenodeinstitute.org/courses/ws24-5-vvvv-beginners-class/

~24d ago

joreg: Introducing: Support for latest Ultraleap hand-tracking devices: https://visualprogramming.net/blog/2024/introducing-support-for-new-ultraleap-devices/

~27d ago

joreg: 2 day vvvv/fuse workshop in Vienna as part of NOISE festival on Sept. 13 and 14: https://www.noise.ist/vienna

~1mth ago

joreg: New beginner video tutorial: World Cities https://youtu.be/ymzrK7tZLBI

~1mth ago

catweasel: https://colour-burst.com/2023/01/26/macroscopic/ yeah, ' is there anyone who cares about slides anymore...' Well me for a start! :D

~2mth ago

ventolinmono: The ELMO TRV-35 slides into your video feed > https://youtu.be/pcIM9mh1c9k?si=iB4FOfI2D6y0iETy

~2mth ago

joreg: The summer season of vvvv workshops is now complete, but you can still get access to all the recordings: https://thenodeinstitute.org/ss24-vvvv-intermediates/

~2mth ago