2

I'd like to create a point cloud using the Geometry Node Editor based on my own custom data.

enter image description here

The data is stored in a .txt file, plain [x,y,z] coordinates and looks like this:

v1 : 1, 2, 1; 
v2: 1.5, 2, 0; 
v3: 0, 2.5, 2; 
v4: 1.2, 2, 0; 
etc. 

I also tried a python script to import the vertices, which is working fine but I don't find a way to use it for Geometry Nodes.

Q: Is there any way to create a point cloud based on the given data to make use of Geometry Nodes features in order to further manipulate the point cloud?

brockmann
  • 12,613
  • 4
  • 50
  • 93
  • Related: https://blender.stackexchange.com/questions/76535/create-model-from-xyz-data-points – brockmann Mar 03 '21 at 11:54
  • If the data has been imported as vertex per coordinate, it's technically a point cloud already. Just wondering what's your question...? Do you'd like to visualize the point cloud? – brockmann Mar 03 '21 at 12:00
  • Yes, I want to visualize point cloud. I have few coordinates [x, y, z]. My expectation is that I will create Point Cloud like it is in Blender 2.93 (Cube with random points) and every point will belong to my coordinates [x, y, z].

    Then I will continue in Geometry Node Editor where I want to set to every point in cloud different object.

    The problem is that I dont know how to create Point Cloud from my vertices instead of random points.

    – Petra Svobodova Mar 03 '21 at 12:05
  • See: Is it possible to render vertices in Blender?. Again, a set of vertices is a point cloud, goal achieved. Suggest add your comment to the question. – brockmann Mar 03 '21 at 12:07
  • Thanks. I have problem when I create Point Cloud (Experimental in Blender >2.92) that the points in cloud are distributed randomly. I want to have them in positions which I set) – Petra Svobodova Mar 03 '21 at 12:13
  • Don't know this feature but if they are distributed randomly, it's obviously not the right feature to use. I'd suggest import them using python, see my first comment. Otherwise please edit your question, share your data and explain in detail what your goal is, thanks. – brockmann Mar 03 '21 at 12:17
  • oki, I will describe it better with my data – Petra Svobodova Mar 03 '21 at 12:33
  • I want to create Point Cloud like this:

    https://imgur.com/a/OMGf1bb.jpg

    The points inside have some coordinates [x, y ,z].

    I have my own coordinates: v1 : 1, 2, 1; v2: 1.5, 2, 0; v3: 0, 2.5, 2; v4: 1.2, 2, 0; etc.

    I want to set points in cloud to my coordinates via Python script.

    I need it like this, because then I am using Geometry Editor.

    – Petra Svobodova Mar 03 '21 at 12:56
  • Ok, I think I am finally getting close: bpy.ops.object.pointcloud_add(align='WORLD', location=(0,0,0), scale=(1,1,1)) obj = context.active_object for i in range (0, 35): obj.data.points[i].co = (0,0,0) v = obj.data.points[30].co print(v) – Petra Svobodova Mar 03 '21 at 13:05
  • I have edited the question for you. If something is wrong, please correct it. Also please add what you call the "Geometry Editor". Do you mean geometry nodes by that? – brockmann Mar 03 '21 at 13:12
  • Thanks. I mean Geometry Node Editor – Petra Svobodova Mar 03 '21 at 14:18
  • I have edited the question for you again. Instead of comments, please use the [edit] link at the bottom of your question (https://i.stack.imgur.com/lXFuK.png) to add information to your post. – brockmann Mar 03 '21 at 14:35

1 Answers1

0

I've been working on this problem lately as well, If you have the points as vertices you can use something like this node setup to get a renderable point cloud pointcloud

In case you find it useful I've put together an addon blender_plots which automatically generates such node trees from numpy arrays and also supports adding a different color to each point

Linus
  • 298
  • 1
  • 5