Jump to content

randomly to comb normals down w/o overlap?


Recommended Posts

hi to everybody,

does anyone have an idea how to randomly comb/rotate/slant normals down to the surface level without overlapping/intersecting them with each other?

any link or useful search tag that can lead to procedural solution would be appreciated.

perhaps video can better explain my problem:

normals_fall_down.mov normals_fall_down.hipnc

(idea on how to avoid overlapping these little tubes?)

thanks,

nem

Link to comment
Share on other sites

An interesting problem, congrats! ;)

I suppose a simulation is out of the question.

Here's a thinking-out-loud sort of nonoptimal solution within sop-land.

We start with scattered points:

comb1.png

Next we want to know about our neighbors. Let's add a triangulate-2d sop.

comb2.png

Hmm, interesting, now we have edges to our neighbors. We don't want to lay our normal

along any edge, because then another normal might well end up along the same edge.

So, we might just as well decide to lay it in the middle of two edges. It sounds reasonable

to orient the normal to the direction where the neighbors are farthest, so let's pick the middle

of the two longest edges. This can be rephrased as the midpoint of the farthest of the edges

"across" from the current point. (sorry, lacking some english geometry vocabulary here :)

Luckily there is just the operation to get these points - the "dual" mode of the divide sop.

comb3.png

Ok, it's not exactly those points, but halfway across. No worry, we're only interested in the direction.

Now for each point we have a polygon, the points of which describe the directions to the middle

of neighboring points. Next we need to find the farthest of the polygon's points, but I didn't find a

simple way to do that :) Probably some foreach loop could find it, but that's, uhm, left as an exercise

to the reader :) Instead, I just took the centroid of the polygon, I think generally it should be

somewhere close to the direction of the farthest point..

comb4.png

Now all that is left is to set the normal of the original points to the direction of these centroids - just

a point sop with $TX2 - $TX etc.

comb5a.pngcomb5b.png

comb6.png

Soo.. this is just a hand-waving method with some short cuts taken, but hopefully it gives some ideas.

It's clearly not perfect, but it's hard to say if there even exists a "correct" answer for the problem.

A vop sop using point clouds might be another direction to look at. I'd love to see other solutions too :)

eetu.

comb2.hip

Link to comment
Share on other sites

Ah, just couldn't leave this alone.. :)

Got thinking about volumes.

Here we copy metaballs to the original points, and make a volume of that.

Now the volume gradient at each point equals the direction of "most/closest neighbors".

In a point sop we set the normal to the inverse of the above - the direction where

the pointcloud is sparsest in the neighborhood.

volcomb1.png

Increasing the metaball radius or weight increases the correlation between neighboring

normals. This makes the solution better, especially with a dense point cloud. On the other

hand the result becomes less random, and randomness was one of the original requirements.

But, depending on use, something like this might even be fitting..

volcomb2.png

eetu.

comb3.hip

Link to comment
Share on other sites

Oh well.

Looking at the previous one I thought that if the point distribution is pretty uniform,

the local density isn't that all-important.

Leaving sop-land, here's a version from a vop sop with just a curl noise inside.

curlcomb1.png

As before, if we dial down the randomness we get a better solution.

curlcomb2.png

comb4.hip

Link to comment
Share on other sites

eetu, thank you for great ideas, vangoghian pattern of solution no.3 with curl noise is aesthetically most suitable for what I need, but now I have to find replacement for $NX=0 expression in Point SOP in order to use this method on sphere instead on flat plane.

post-4301-1234115155_thumb.jpg

suppose I can flat them down with Ray SOP, but can't make it working. Any idea?

EDIT:

ok, solved.

copy the 2-point Line on points, so there is a new point on tip of each normal, then flatten those new point back to surface with Ray SOP, then delete every other point so there is just new points, then orient original normals to new points with $T2-$T expression.

post-4301-1234124067_thumb.jpg

Edited by watchman
Link to comment
Share on other sites

that's much better solution, thank you.

normals_fall_down4.mov

Don't know if it's possible to see because of small resolution - but in this test render couple of these small guys keep dangling when everything stops and rotate around its normal axis quiet erratically.

I know this is a strange question, but does anyone have an idea why is that happening and how to calm them down?

Link to comment
Share on other sites

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...