1
$\begingroup$

I'd like to convert a mesh object into a point cloud. I started using the vertices:

coordinates = []
for x in range(len(obj.data.vertices)):
    v = obj.matrix_world * obj.data.vertices[x].co
    coordinates.append(v)

Plotting the coordinates I get a point cloud as expected: Chair Point Cloud

However, depending on the mesh, there are huge irregular gaps between the points. Is there a way to "interpolate" between the coordinates to get a regular pointcloud?

I found this proposal but couldn't make use of it.

$\endgroup$
2
  • 1
    $\begingroup$ Are you planning to use this data in Blender or another program? Your answer may allow different answers to the original question. $\endgroup$ Commented Jan 26, 2016 at 3:18
  • $\begingroup$ Thanks for your hint, I am planning to export the coordinates. $\endgroup$
    – frthjf
    Commented Jan 26, 2016 at 10:16

2 Answers 2

1
$\begingroup$

Consider the Remesh Modifier. [Apply] the Remesh modifier with the button in the modifier to get a new mesh with vertices equally spaced as a simple description.

Remesh On Below. View Eye Active. enter image description here

Remesh Off Below. View Eye Inactive. enter image description here

You may also consider the Loop Cut Tool if you want some particular control of the division of loop cuts.

enter image description here

A Blender Particle System can emulate the point cloud.

enter image description here

Close up view of the particles emitted from vertices.

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ to have even space / grid like you may use emit: faces + particles/face = 1 (onli for jitter variant..) or so $\endgroup$
    – o.g.
    Commented Jan 26, 2016 at 8:01
  • $\begingroup$ Thank you, the remesh method works fine! However, I am still facing one problem: If the mesh is not "one piece" it gets deformed very badly (I hope that description is clear) $\endgroup$
    – frthjf
    Commented Jan 26, 2016 at 10:15
  • $\begingroup$ Ahh, stupid, I didn't see the "Remove disconnected pieces" option. So thanks again! $\endgroup$
    – frthjf
    Commented Jan 26, 2016 at 10:22
2
$\begingroup$

A solution is to set particles on the object and to use GRID instead of (default) random in the settings (Note that also works on Volume, if the case, to fill with points)

Use No for physics to get fixed particles.


To further get the coordinates of those particles use:

gridVectors = [p.location for p in bpy.data.objects['Cube'].particle_systems[0].particles]

that if u need to further use coords in script


Also note that the grid acts a bit weird sometimes, more like the remesh tools, so the particles may or may not be on the faces, but rather at a distance, not quite controllable.

In the pic, I added particles to these meshes with settings as shown. enter image description here

$\endgroup$
4
  • $\begingroup$ You wrote [a variant]. A variant of what? $\endgroup$ Commented Jan 26, 2016 at 8:05
  • $\begingroup$ A variant of getting even points. By saying "a variant" I assume there are other ways. Also I'm not very pleased by the level of control over grid particles, or how they work sometimes. Should I say "a solution" ? $\endgroup$
    – o.g.
    Commented Jan 26, 2016 at 8:09
  • $\begingroup$ Thank you, but I can't find this option in Blender 2.74. What is the Python API method for this action? $\endgroup$
    – frthjf
    Commented Jan 26, 2016 at 10:18
  • $\begingroup$ Sorry, I updated now to show I use particles. And what you see is particles settings. $\endgroup$
    – o.g.
    Commented Jan 26, 2016 at 10:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .