Jump to content

Any polygon -> Sphere


Recommended Posts

Does anybody know of a way to turn any closed (and no holes,so genus 0 surface) polygonal object into a sphere with equal pointcount?

I've tried normalizing the object's P and raycasting. While this kind-of-works the sphere does not consist of equally spaced points.

Edited by Macha
Link to comment
Share on other sites

Does anybody know of a way to turn any closed (and no holes,so genus 0 surface) polygonal object into a sphere with equal pointcount?

I've tried normalizing the object's P and raycasting. While this kind-of-works the sphere does not consist of equally spaced points.

I'm not sure if this is what you are looking for. This is a sphere with equally spaced points. It is not entirely stable though

SphereFromPoints.hipnc

Link to comment
Share on other sites

Does anybody know of a way to turn any closed (and no holes,so genus 0 surface) polygonal object into a sphere with equal pointcount?

I've tried normalizing the object's P and raycasting. While this kind-of-works the sphere does not consist of equally spaced points.

Can you post some sample geometry?

Link to comment
Share on other sites

I hope I understood what you wanted.

I only converted one piece into a sphere. You'll have to add a foreach to process all the pieces, but other wise my approach was simple. Using the center of a piece I project each point out a given radius, then apply a Smooth SOP to tighten all the edges. This process is then repeated in a ForEach X number times until an even sphere is created.

Not sure if this is the fastest solution, but it works. ;)

sphere.hip

Link to comment
Share on other sites

Hey Hopbin, this is virtually identical to my setup except that you put the last step into a foreach again. I never thought of that! I tried it but a foreach inside a foreach doesn't seem to work. Even if nothing is inside the nested foreach, it messes up the geometry!

Any inklings as to why?

foreachexample.hip

Link to comment
Share on other sites

My approach doesn't really generate equal length edges.

I was thinking that a virtual spring force could be applied to the edges to draw them closer to each other, and then repeat that in a for/each. I gave it a try, but sadly couldn't get it to work.

I'm sure someone as a VEX node somewhere that does averaging of edge lengths correctly.

Link to comment
Share on other sites

I'm off to bed now, but maybe you can explain something to me. As the documentation in Houdini isn't very clear.

When working with a For/Loop in a VEX SOP. How is the output calculated? I mean, how do something like take a constant as an input and then sum it by the total number of steps in the loop as the output. So that, if the constant was 1 and the Loop went from 1 to 10, then the output should then be 10.

Did that make any sense? I basically don't understand how the output of a For/Loop works.

Link to comment
Share on other sites

Here is an example Hopbin.

The thing to remember with the forloop vopsop is that you need to plug in the value that you want to modify. If no modification occurs (due to a logic decision) then it will pass the input value out unchanged. If a condition is met it will evaluate whats inside the loop, but you have to plug that parameter in!

forloop.hip

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