Jump to content

Packing sorted by an attribute?


probiner

Recommended Posts

Given weighted (colored red:x, green:y) polygon islands if I use the UV Layout SOP, the colors will have somewhat random distribution:

image.png.5f5d8d83c32b48e678c231c106e662e0.png 

Now, what I'm wondering is if there's an already established way to have the packing respect an attribute (vector2 or 2 floats) to sort the uv islands according to one or both values in the respective axis. Here's a mock-up:
image.png.34c04ac871e4f42857f6d5c5acc5056e.png

Even if I don't use UVs and do some simulation, it's not sure how I would go about to have the, let's say cylinders, fill a space and respect sorting.

Scene: PRB_WeightedPacking.hiplc

Cheers
prb

Edited by probiner
Link to comment
Share on other sites

Yes, UV layout is a complex operation to build from scratch , if you are interested, you could learn more about the theory there by looking for this  paper

Least squares conformal maps for automatic texture atlas generation" by levy et al, https://members.loria.fr/Bruno.Levy/papers/LSCM_SIGGRAPH_2002.pdf

 

I agree with Konstantin Solution, looks like a solution to me. Matt delete a random piece, but you could establish rule and  as copy on the UV 0.1 space

 

 

 

Link to comment
Share on other sites

On 12/24/2021 at 10:03 AM, konstantin magnus said:

Matt published a perhaps suitable packing method called "Pack fattest to thinnest boxes":
https://www.tokeru.com/cgwiki/index.php?title=ForLoops

Thanks, but can't use this dart throwing method in my case, since I have a fixed set of islands to pack, so I can't just delete part of them for not fitting. It's a useful method, just not for my case.

 

On 12/26/2021 at 2:41 PM, vinyvince said:

Yes, UV layout is a complex operation to build from scratch , if you are interested, you could learn more about the theory there by looking for this  paper

Least squares conformal maps for automatic texture atlas generation" by levy et al, https://members.loria.fr/Bruno.Levy/papers/LSCM_SIGGRAPH_2002.pdf

 

I agree with Konstantin Solution, looks like a solution to me. Matt delete a random piece, but you could establish rule and  as copy on the UV 0.1 space

 

 

 

As mentioned above, deletion method won't do for me. Thanks for the link about LSCM, I'll see if it inspires me to get something functional going. But let's see if some ready made approach surfaces :)


Cheers
prb

Edited by probiner
Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...