Dear All,
I have an imported mesh and I wish to map its faces
In an aligned fashion like shown in the right image.
Please advise.
AFAIK it’s most unlikely that you can do that with native components (but never say never). Notify if you want a C# solution on that matter (rather simple for a quad mesh of that kind of topology).
BTW: Of course the easiest way is to have the Brep face and do an “ordered in U/V” mesh out of it … but anyway.
See some tests: get an ordered mesh, then make chaos - chaos means: get the faces and do a scrambled eggs face order in the mesh face list, then remake the mesh using the re-ordered faces … then re-order faces based mostly on FF connectivity trees and remake the mesh.
Can you upload your mesh?
Impoted Mesh for mapping.3dm (490.2 KB)
attached is the mesh for maaping.
the result of the last image looks great.
will the output enable working with image sampler ?
how do I obtain this c# solution ?
thanks.
Here’s an approach that might work. It divides the mesh up into columns of faces based on distance to a guide line. You have to pick this line manually.
You can apply a second sorting pass to sort the faces in each column using another line, but a similar approach. This will not work if the mesh is very twisted, only if the distances between the faces and the guide geometry are increasing per column/row.
mesh face stripper.gh (17.0 KB)
For quad meshes of that simplicity the re-ordering logic is not very complicated. By assuming that you know what a FF connectivity tree is AND FOR THAT type of quad meshes (no holes, no meshes out of Brep faces [trim]):
Start by finding faces with valence 2 meaning the 4 “corner” faces, Valence 2 means find FF branches where there’s 2 indices listed. Control what face is the start (for intance by index in some list that samples the face indices or pick some randomly etc etc). This is connected (obviously) with 2 others. Pick one (and remember the other (#)). Loop as follows: name the one picked as next (the start as previous) and find the neighbor face to the next that doesn’t share any edge vertex with the previous. Continue. If you can’t find a face … you have reached the end of the “column” (or the end or the road having consumed all the faces) and you start again from the face (#). It’s kinda a bastardized cluster analysis approach (well … kinda).
here’s the logic applied on a “helical” mesh (ordered > chaotic > reordered):
Image sampler? where this fits into the problem?
If no good Samaritan can provide a solution with native components I’ll upload an oversimplified C# that does that.
this work around is great but its way over my league.
I hoped the solution would be in the data tree tools…or plug-in.
if I could arrange the mapping of the mesh so it would coordinate with an image sampler
then mesh would be a base for a pattern.
David already provided a good solution with native components … so don’t bother with loops, connectivity trees, list intersections and other freaky stuff.
thank you All.
will this remapping make the mesh a base of pattern controled by image sampler ?
lets say that a gradiant image controled the extrudes rising from the mesh.
Hmm … given the opportunity and since you are after tricks with Images and Meshes have some fun with this (PS: with all due modesty … using Me as test).
The 1Z challenge: what it takes for “pixelating” the mesh with mini cubes ???
Map_the_Lord_V1.gh (120.5 KB)