luoqiulin Posted February 28, 2015 Share Posted February 28, 2015 great Quote Link to comment Share on other sites More sharing options...
Popular Post rayman Posted February 28, 2015 Popular Post Share Posted February 28, 2015 (edited) Ok! First - the most important part of the method. Check this diagram and attached file - they are the core algorithm I came up with. 1. Let's say we have a simple 2d point cloud. What we want is to add some points between them. 2. We can just scatter some random points (yellow). The tricky part here is to isolate only the ones that lay between the original point cloud and remove the rest. 3. Now we will focus just on one of the points and will check if it is valid to stay.Let's open point cloud with certain radius (green border) and isolate only tiny part of the original points. 4. What we want now is to find the center of the isolated point cloud (blue dot) and create vector from our point to the center (purple vector). 5. Next step is to go through all points of the point cloud and to create vector from yellow point to them (dark red). Then check the dot product between the [normalized] center vector (purple) and each one of them. Then keep only the smallest dot product. Why smallest - well that's the trick here. To determine if our point is inside or outside the point cloud we need only the minimum result. If all the points are outside , then the resulted minimum dot will always be above zero- the vectors will tends to be closer to the center vector. If we are outside the point cloud the result will always be above zero. On the border it will be closer to 0 and inside - below. So we are isolating the dot product corresponding to the brightest red vector. 6. In this case the minimum dot product is above 0 so we should delete our point. Then we should go to another one and just do the same check. Thats basically all what you need. I know - probably not the most accurate solution but still a good approximation. Check the attachment for simpler example. In the original example this is done using pointCloudDot function. First to speedup things I'm deleting most of the original points and I'm trying to isolate only the boundary ones (as I assume that they are closer to gaps) and try not to use the ones that are very close together (as we don't need more points in dense areas). Then I scatter some random points around them using simple spherical distribution. Then I'm trying to flatten them and to keep them closer to the original sheets - this step is not essential, but this may produce more valid points instead of just relying on the original distribution. I'm using 2 different methods - the first one ( projectToPcPlane ) just searches for closest 3 points and create plane from them. Then our scattered points are projected to these closest planes and in some cases it may produce very thin sheets (when colliding with ground for example). There is a parameter that controls the projection. Then second one is just approximation to closest points from original point cloud. Unfortunately this may produce more overlapping points, so I'm creating Fuse SOP after this step if I'm using this. The balance between these 2 projections may produce very different distributions, but I like the first one more, so when I did the tests the second one was almost always 0. Then there is THE MAIN CHECK! The same thing that I did with the original points I'm doing here again. In 2 steps with smaller and bigger radius - to ensure that there won't be any points left outside or some of them scattered lonely deep inside some hole. I'm also checking for other criteria - what I fond that may give better control. There may be left some checks that I'm not using - I think I forgot some point count check, but instead of removing it I just added +1 to ensure that it won't do anything - I just tried to see what works and what not. Oh and there are also some unused vex functions - I just made them for fun, but eventually didn't used. So there it is. If you need to know anything else just ask. Cheers EDIT: just edited some mistakes... EDIT2:file attached pointCloudDotCheck.hiplc Edited February 28, 2015 by rayman 40 2 1 Quote Link to comment Share on other sites More sharing options...
Pazuzu Posted February 28, 2015 Share Posted February 28, 2015 Wow Rayman what a nice explanation!! Thank You!!! Quote Link to comment Share on other sites More sharing options...
Diego A Grimaldi Posted February 28, 2015 Share Posted February 28, 2015 Thanks for the explanation, very useful Btw if you meant to attach a new hip file with the latest post, I don't think it worked.. Quote Link to comment Share on other sites More sharing options...
rayman Posted February 28, 2015 Share Posted February 28, 2015 Thanks for the explanation, very useful Btw if you meant to attach a new hip file with the latest post, I don't think it worked.. thanks! I added it Quote Link to comment Share on other sites More sharing options...
Diego A Grimaldi Posted February 28, 2015 Share Posted February 28, 2015 Awesome, thanks again Quote Link to comment Share on other sites More sharing options...
eetu Posted February 28, 2015 Share Posted February 28, 2015 Hey that's clever, thanks for sharing and for the explanation! Quote Link to comment Share on other sites More sharing options...
Skybar Posted February 28, 2015 Share Posted February 28, 2015 Time and time again you show your genius Pavel, great work! 1 Quote Link to comment Share on other sites More sharing options...
Scratch Posted March 23, 2015 Share Posted March 23, 2015 Hey Folks! I read this thread with great interest and I am amazed of all your creativity and technical raffinesse! I was wondering... how's the state of all this? I am currently fighting with a small scale fluid sim and coud really use this new and awesome technique! Any updates? Quote Link to comment Share on other sites More sharing options...
sebkaine Posted March 30, 2015 Share Posted March 30, 2015 Pavel Thanks for your genius ! your stuff is just fantastic ! exactly what i need to achieve smooth surface ! Quote Link to comment Share on other sites More sharing options...
rayman Posted March 30, 2015 Share Posted March 30, 2015 Thanks! I'm really glad that you like it! Unfortunately I don't have enough time to experiment more with this setup, so feel free to use it and improve it on your own. Cheers! Quote Link to comment Share on other sites More sharing options...
sebkaine Posted March 30, 2015 Share Posted March 30, 2015 (edited) I was trying to make a dirty / cheap tricks to achieve this kind of stuff , but my R&D skills sucks deeply ! I wanted to generate a mesh with point proximity from the lowrez flip , i give a try to delaunay because it was the only one that come to my mind ... I would be curious to get your pov on a method that would allow to generate a polymesh that would be a sort of Mix beetween - delaunay tessalation for closest point connection - convex hull for getting a sheets Your tricks is perfect and will do the job wonderfully , but i have the feeling that a fast B-plan could be possible. - for exemple you select a starting position - then from this position you build triangulation with closest point - you do this until there is no more point and you check that you keep sheets pattern ... the idea is then to - smooth the mesh - add some nice displace on it - then scatter point on it that stuck - mesh in VDB Do you have any math stuff in your magic box that could do something like that ? Does it look doable ? / Clever ? / Stupid ? to You ! Thanks again for your Magic ! Cheers E Edited March 30, 2015 by sebkaine Quote Link to comment Share on other sites More sharing options...
sebkaine Posted March 31, 2015 Share Posted March 31, 2015 After some googling a find those stuff that kind illustrate the idea http://pointclouds.org/documentation/tutorials/greedy_projection.php http://www.cs.unc.edu/~isenburg/sd/ http://www.cs.cmu.edu/~quake/triangle.html it doesn't look as easy as i might expect ... basically it's surface reconstruction from a point cloud - by checking that we keep sheet pattern => no volume - by checking that mesh curvature keep a smooth pattern i find this method on wikipedia to build mesh from ptc http://en.wikipedia.org/wiki/Delaunay_triangulation http://en.wikipedia.org/wiki/Alpha_shape http://en.wikipedia.org/wiki/Voxel http://en.wikipedia.org/wiki/Distance_transform http://en.wikipedia.org/wiki/Implicit_function http://en.wikipedia.org/wiki/Marching_cubes i'll try to invstigate this if i have enough time ! this might be interesting also ! http://meshlab.sourceforge.net/ Quote Link to comment Share on other sites More sharing options...
rod.vfx.td Posted April 19, 2015 Share Posted April 19, 2015 Hi Pavel! very nice technique! I´m trying to use it with SPH solver, but it is not working.. is it possible to adapt it to work with SPH? thanks. Quote Link to comment Share on other sites More sharing options...
rayman Posted April 20, 2015 Share Posted April 20, 2015 Hello! As I already mentioned I don't have any free time to spend on this, so you should try to convert it yourself. Sorry about that! Emmanuel ideas sounds great - unfortunately right now I can't help with that either :/ I'll be glad to see if you can make any progress as it looks like a really promising project! Cheers! Quote Link to comment Share on other sites More sharing options...
sebkaine Posted April 20, 2015 Share Posted April 20, 2015 Thanks for feedback Pavel ! i'm actually trying to see if it's possible to use low rez FLIP sim to drive a Cloth Object . which would be a poor implementation of what i have in mind. But i think that to get water sims that look like thin sheets, using a sheets could be a good idea when you don't want to go the hard way with surface tension / point replication etc ... those mesh reconstruction stuff from ptc are a little to much on the dev side for my brain ... Quote Link to comment Share on other sites More sharing options...
rod.vfx.td Posted April 20, 2015 Share Posted April 20, 2015 (edited) Thanks for fast reply Pavel! i am close to finishing a project, so after i will try to understand your technique in deep and use it with SPH for sure! I need some free time for do it too. Anyway, i found a strange behaviour in houdini when i put VEX code on a env path to run your scene, some times the node "points from volume" not work anymore, in all scenes! If i remove from the path, the node works again. (but this appear interstitial) Have you any idea what can be wrong? (looks like vex code is overriding some function inside node, is it possible?) Thanks again man, incredible work. Edited April 20, 2015 by rod.vfx.td Quote Link to comment Share on other sites More sharing options...
sebkaine Posted April 20, 2015 Share Posted April 20, 2015 when you set your VEX path , you overide the houdini default VEX path , so houdini will not work correctly. you have to put the & symbol like this to concatenate your new path with the default path: HOUDINI_VEX_PATH = <my_custom_path>;& Quote Link to comment Share on other sites More sharing options...
rod.vfx.td Posted April 20, 2015 Share Posted April 20, 2015 when you set your VEX path , you overide the houdini default VEX path , so houdini will not work correctly. you have to put the & symbol like this to concatenate your new path with the default path: HOUDINI_VEX_PATH = <my_custom_path>;& Oh, it is so obvious, my mistake... Thanks Emmanuel. Quote Link to comment Share on other sites More sharing options...
Popular Post KarlRichter Posted January 26, 2016 Popular Post Share Posted January 26, 2016 Hi guys! I'm a bit late to this party but thought I would share anyways. I am very new to Houdini, but very experienced in Realflow and Maya. However, after discovering Houdini I don't think i'll ever go back. I love how much control you have with Houdini, and how easy it is to create your own tools when the provided ones don't quite fit. A while ago, I wrote a Realflow Python script that did splash hole filling. While it worked OK, it was slow and a bit unstable in certain situations. I took the same Idea and put it in a VOP node, and it seems to work really well! It is super simple and very fast because i'm not doing a bunch of dot product math, just relying on Houdini's excellent point cloud functions. Here in an example video: https://vimeo.com/153145442 See attached for example .hip Cheers! Karl splashExample.hip 17 1 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.