A Script to Skin a Point Cloud (for Blender 2.4x)

Sorry for my double posting. Deleted.

Thank you all for your comments and for reminding all those who are interested of this script. As some of you notice soon after using the script, there are still a lot of work to be done in the range from minor improvements through a big challenge. I’ve been thinking it lacks a way to import a point cloud from a file. And more advanced, we can make it work without specification of the parameters that you have to tweak so far, as Abidos mentioned. Anyway, all your comments encourage me to restart to improve the script. Thanks again.

TylosaurusRex:
Thank you for your comment. This script can do skinning only and doesn’t have the ability to import a point cloud from a file. However, I also created another script called CSV Importer and it can import a .csv file that contains xyz point data. Please go here to download if you get interested and some of the example files in it will help to do that.
What the skinning script can do so far is to skin the selected vertices in one Object in Blender. You have to repeat the task to skin with the UI of the script over 300 times but I understand it’s absolutely not productive. I can easily change a bit of the code to skin not only one Object but also all the selected Objects in Blender. How will it work if the script has that feature?

I’m going to answer the rest of the comments soon.

Thanks again. I didn’t think I was writing to solve the problem with the skinning of vertices at all. I started to write the code of CSV Importer at first, and then this forum led me to create another script for point clouds. If I didn’t upload the first script and I didn’t get your suggestions, it wouldn’t be found here or anywhere, I think.

BlueSpider:
Thank you for your comments. Did the script work with a random cloud.

Abidos:
Thank you for your comments and for giving me an example. Yes, I clearly understood what you said. The ideal goal of the script would be to be able to skin any types of vertices and to rebuild them into the original shapes of mesh exactly. However, there is no way completely to solve the problem of deciding where to put a face only using the information of the location of vertices. There are many possibilities to connect vertices when there is a correct connection.
So, to solve the problem, I assumed the vertices are close or have uniform density like a cloud of points.
OK, the UI should be improved. You have to understand what each parameter means after downloading the script and I know that you have to take several trials to get a good result.
It’s a good point and it will be nice if you can use it without setting the parameters by deciding them based on the density of the given point cloud. And I think it would be also possible to change the parameters automatically while skinning. The current script uses the constant parameters that are specified first in the UI throughout the calculation for skinning, so the point cloud is supposed to have the same density to skin correctly. Adjusting the parameters locally in skinning would give us a better surface than ever with my easy guessing.
I’m not sure it’s easy to decide the parameters automatically, but it’s interesting to think about it.

Hi there!

I agree that judging on parameters AUTOMATICALLY may NOT be that easy in ALL cases! But I think, it is not so that difficult for the script to calculate average distance between the verts, then determine the other two parameters without user interference.

I also understand that making script work for ALL cases of point clouds is a GREAT challenge. But I’d like to open a discussion on the issue right now. I take grounds on the fact that recently I’ve been working on dealing with various types of 2D contours but I am sure that techniques are applicable to 3D figures too. In mathematics there is a very comprehensive way to determine if a contour or a 2D figure is convex or concave or it has some collinear adjacent verts which can be treated as a “convex” case. I believe similar technique can be applicable to a 3D point cloud too (though I admit I havent seen it showed somewhere so far). The ease of 2D testing really come NOT from the fact that points are 2D (not 3D) but that they are tested in some order. This feature - order - in an unknown 3D cloud is also unknown and there should be a way to determine a possible order of points somehow. At the moment, I dont know how… But I can clearly show what cases a modified and clever script shall NOT consider as a possible one. Lets turn back to the “comb example”. It is obvious that the solution provided by the script consists of two (or more) non-connected parts of a mesh. I think, this is a clear sign what shall be NOT considered as a final solution. Sooo… first modification should lead to analyzing a solution found and if it consists of several parts => look for another solution with the same points!!! I know that this takes time, but the script iterates the points several times any way so that it MUST be able to take ALL info required from them in what-so-ever aspects, right? Secondly, provided the script is looking for a one-part-mesh solution => this to be put somewhere in the algorithm and if a criterion prove to be False during script work => start looking for a new solution at earlier stage. At the moment, I am not able to propose a proper place for this cause I am not in deep with algorithm of the script… Finally, there is another idea of mine which may be helpful to further development of the script. Back to “comb example”… if we are looking for a convex 3D figure, ie like a wrapped of the comb and script is able to construc the side faces that are currently missing => some verts inside will remain non-connected or connected somehow INSIDE the overall figure. So analysis that shows such a situation should also lead to a conclusion that THIS IS NOT a possible figure and a new solution should be searched. Therefore, the convex-concave criterion is crucial for this script and it should be tested as early as possible to massively save processing time!.. The new solution should definitely be a concave figure => look for edges that go INTO the cloud and NOT just in its surroundings. In the comb case, while looking from “above” with the comb lying on the ground, it is obvious that connections should go a way zig-zag and NOT straight-forward thus connecting tops of comb sticks (sorry, I dont know the correct word in English)… But mathematically this has a very simple test - Y (respectively X, depending on the orientation) coordinates of points which are the base of comb sticks are between the coordinates of verts of tops of two adjacent sticks, right? Sooo this should mean something for the script too!!! Well, in case of general location of the comb, there should be a conversion of coordinates made in regards to the middle axis (or what is supposed to be a middle axis) of the prospective object.

Hope the above considerations will be of help… :slight_smile:

Regards,

You got a new approach. Thank you for sharing. Finding another solution to seek a better result sounds nice. I haven’t thought that idea of trying to search for another one. Maybe that’s because I started to write the script to deal with a huge amount of points like 100K vertices to skin and another trial seems to take much time.
We can check whether it’s skinned in a good shape or not, looking at how many parts the skinned mesh has or how many vertices remain inside with connecting as a convex 3D figure, but I’m wondering how I can search for the next solution. Searching somewhat in a random way?

I’m sorry for my long silence but I’ve updated the script from v0.12 to v0.14 and now it’s available for download at my homepage from here.

The main changes from v0.12 are:

  • added a new UI mode which allows you to use the script from the menu Mesh in Blender. You can set the parameters quickly in the new popup block.
  • can switch the UI mode. The popup UI will be display if the 3D window is in EditMode, and the script GUI will be display in otherwise.
  • corrected the function CalcAverageNormal. The algorithm is based on Lagrange’s Lambda Method minimizing of sum(ax+by+cz)^2, which is the real minimization of the distances between vertices and the center.

I’m going to update the top post of this thread as well when I have time. Please try to use the script.

Hi

Would you mind explaining the basic algorithms and math you have used to make the script?. I want to look into your script in dept but would be nice to get some insight first.

Hello plec, thank you for your comment. Yes, of course. I already have a page that I made before to give the idea of how the script skins a point cloud. I wrote it for the version t15 though the latest is t23, but the part of algorithm in t23 is almost the same as t15 does, so I think it would be useful.

Algorithm:
Explanation of how the script t15 skins point cloud

There are more pages explaining something about the script in my homepage.

Settings:
Explanation of how to setup the parameters of the script t23

List of Another Notes and Memos:
http://hanspg.web.fc2.com/Pages/csv_scripts/PointCloudSkinner_note.html

I hope it helps you.

Hans thanks for the great follow up. I will dig in these materials tonight.

cheers

would this method be useful to farsthary for skinning sph fluid simulations?

i’m certainly trying this script out :slight_smile:

Very cool!

I just saw this video today that makes a point cloud out of a face made through voodoo and a digital camera. Very intriguing!

http://www.youtube.com/watch?v=vbvex7maHL8

@ MarkJoel60 - intriguing YES, but not getting a nice result, details, etc. :no:

Regards,

@spacetug: SPH fluid simulations seems to have vertices inside of the volume, not only on the surface. If so, applying this script to SPH simply doesn’t work well. The script has to be modified to ignore the vertices inside of the volume and to connect only the vertices which hold the volume…

@MarkJoel60, Abidos: I agree. The script has to be improved more with lots of work to get good results.

maybe using a mirror the script can detect the other side of the object

Cool. :slight_smile: This reminds me of all the survey data I took during geology fieldcamp. I bet that if I put all of my field notes into the correct format and made a cloud of vertices with them, I could reconstruct our mapping area.

so when I digitize a model in Rhino into a point cloud I cannot bring that into Blender?

buh buh buh …

Anyway to make the work?

I wanted to present you another way of using the script Point Cloud Skinner v0.14
Connect two spheres of UVsphere and Icosphere using the script.

Hi Hans, thank you very much for the scripts the possibilities looks fantastic.

Thank you, vklidu. Did it work without error?