Page MenuHome

Geometry Nodes: Finish off Distribute Points in Volume
AbandonedPublic

Authored by Angus Stanton (abstanton) on Sep 25 2021, 3:42 PM.
Tags
None
Tokens
"Love" token, awarded by kenziemac130."Love" token, awarded by Yegor."Love" token, awarded by mrblissfly."Love" token, awarded by Yuro."Love" token, awarded by Rusculleda."Love" token, awarded by verbal007."Love" token, awarded by Winand."Love" token, awarded by nacioss."Love" token, awarded by dulrich."Love" token, awarded by HEYPictures.

Details

Summary

Adds the distribute points in volume node.
Uses almost entirely the work by @Kenzie (kenziemac130) , so full credit to them for the node.
Adds a stable id field output to the grid mode, which uses the float3::hash to hash
each points position.

Diff Detail

Repository
rB Blender
Branch
T85898-points-in-volume (branched from master)
Build Status
Buildable 20680
Build 20680: arc lint + arc unit

Event Timeline

Angus Stanton (abstanton) requested review of this revision.Sep 25 2021, 3:42 PM
Angus Stanton (abstanton) created this revision.

Update diff to use modify_geometry_sets.

  • fix rest of merge conflict shenanigans
  • update to use modify_geometry_sets, removed shallow transform stuff :(
  • update to work with latest master, remove stable id
Hans Goudey (HooglyBoogly) requested changes to this revision.Nov 15 2021, 8:15 PM

Sorry for the delay in reviewing!

  • The code is certainly much simpler now!
  • There is no stability with the random distribution mode, but I think that's okay. We're using the OpenVDB implementation anyway, and the node is still helpful without it.
  • Did you verify that the stable ID didn't work with the grid mode? It seems like a straightforward idea to hash the positions, similarly to the distribute on faces node.
  • I think the node should be wide enough by default to display the full name. Something similar is done for the other distribute node.
  • It looks like the points are offset from the origin, maybe by half of the voxel size?
    • I see there is some handling of that in the code, but maybe it's not working as expected? Maybe convert_to_grid_index_space is helpful.
    • Generally I would expect to have a point at the origin.
    • Let me know if I'm forgetting something here.
source/blender/nodes/geometry/nodes/node_geo_distribute_points_in_volume.cc
110

This can probably look like the conversion in ParticleList for the points to volume node.

119–120

It would be helpful to have a comment about the choice of random number generator here.

150

This can use continue rather than indenting the rest of the loop.

206

This should still have a keep_only to remove the volume from the geometry set.

This revision now requires changes to proceed.Nov 15 2021, 8:15 PM
  • Did you verify that the stable ID didn't work with the grid mode? It seems like a straightforward idea to hash the positions, similarly to the distribute on faces node.

Honestly I didn't, I saw it was removed in the distribute points on faces node and assumed that the stable id node being developed would do the same as what I was accomplishing with stable id. Whilst I never tested it I still had doubts as I can't image a hash of a double would produce the same value across frames, as surely the grid calculations result in small discrepancies due to floating point errors?

  • I think the node should be wide enough by default to display the full name. Something similar is done for the other distribute node.

Will address this

  • It looks like the points are offset from the origin, maybe by half of the voxel size?
  • I see there is some handling of that in the code, but maybe it's not working as expected? Maybe convert_to_grid_index_space is helpful.
  • Generally I would expect to have a point at the origin.

I think this can be addressed, but I'm not sure the expected behaviour is a point at the origin. When changing the spacing by a multiple of 2 (eg from 0.3 to 0.6) the positions will stay the same but with more points filling in between, however if its changed by a different amount the the positions will change completely. I'll see if I can fix it though

I saw it was removed in the distribute points on faces node

The change for that node was to output it as a named attribute instead of an anonymous attribute, the other distribute node still outputs that data. But yeah, it's worth testing if the hash works I think.

  • Merge branch 'master' into T85898-points-in-volume
  • add keep Point cloud keep only
  • Merge branch 'master' into T85898-points-in-volume
  • Add node size to node declaration
  • Add stable id output to grid mode
  • Remove all build files, oops
Angus Stanton (abstanton) marked 2 inline comments as done.
  • Remove WITH_OPENVDB definition
Yuro (Yuro) added a subscriber: Yuro (Yuro).
Yegor (Yegor) added a subscriber: Yegor (Yegor).

Updated for master

Hi @Angus Stanton (abstanton) may I continue on this?

Hi, yes please! I'm sorry I've not been updating it, life has got in the way unfortunately. I think it's almost done to be honest, there's not a ton left to fix I don't think.

Ok, im trying to update the patch here but it doesn't let me, I think I need to create a new patch, will credit you and Kenzie

Closing in favor of D15375