Macha Posted April 25, 2011 Share Posted April 25, 2011 (edited) 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 April 25, 2011 by Macha Quote Link to comment Share on other sites More sharing options...
kgoossens Posted April 25, 2011 Share Posted April 25, 2011 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 Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted April 25, 2011 Share Posted April 25, 2011 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? Quote Link to comment Share on other sites More sharing options...
Macha Posted April 26, 2011 Author Share Posted April 26, 2011 (edited) Clever setup in the file above! Below is an example geometry. For example, blending each of the pieces to spheres. example.hip Edited April 26, 2011 by Macha Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted April 26, 2011 Share Posted April 26, 2011 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 Quote Link to comment Share on other sites More sharing options...
Macha Posted April 26, 2011 Author Share Posted April 26, 2011 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 Quote Link to comment Share on other sites More sharing options...
anim Posted April 26, 2011 Share Posted April 26, 2011 Stamp Name and Index Stamp Name variables should be unique for nested ForEach SOPs to work, so just rename them in second For Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted April 26, 2011 Share Posted April 26, 2011 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. Quote Link to comment Share on other sites More sharing options...
Macha Posted April 26, 2011 Author Share Posted April 26, 2011 Thanks Anim. Trying this method with more complicated objects we notice that it is not stable. Surely this should be possible. Like 3d pelting. Hmmm. foreachexample.hip Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted April 26, 2011 Share Posted April 26, 2011 Does any of the geometry contain convex hulls? Quote Link to comment Share on other sites More sharing options...
Macha Posted April 26, 2011 Author Share Posted April 26, 2011 Does any of the geometry contain convex hulls? Possibly, but it wouldn't be extremely convex. In any case no holes, so that in principle a blend into a sphere would be possible. Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted April 26, 2011 Share Posted April 26, 2011 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. Quote Link to comment Share on other sites More sharing options...
Macha Posted April 26, 2011 Author Share Posted April 26, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.