hologen Posted March 11, 2008 Share Posted March 11, 2008 hi all how to make same distance between point on scatter object, thanx Quote Link to comment Share on other sites More sharing options...
rdg Posted March 11, 2008 Share Posted March 11, 2008 I don't think the scatterSOP can do this as it scatters. What geometry do you want to process? Maybe you can create a regular pointcloud and project the points onto your geometry. Maybe you can create this point cloud based on your geometry and refinde/subdive it. This would still introduce some distortions based on projection. Or you unwrap you geometry in a undistorted way project a grid to it and transfer the point positions back to the source mesh. Or you wait for the next answer that offers the oneSOP solution I am not aware of. Geog Quote Link to comment Share on other sites More sharing options...
eetu Posted March 11, 2008 Share Posted March 11, 2008 Having the points exactly equidistant is not possible. One thing you could try is scatter a bit too many points, and then use the FuseSOP to remove points closer to each other than your predefined minimum distance. eetu. Quote Link to comment Share on other sites More sharing options...
hologen Posted March 11, 2008 Author Share Posted March 11, 2008 yes its very difficult i think, i need equidistant between point, cause i will copy box with the same size so they don't overlap each other but still random. aswin. yes its very difficult i think, i need equidistant between point, cause i will copy box with the same size so they don't overlap each other but still random. aswin. Quote Link to comment Share on other sites More sharing options...
rdg Posted March 11, 2008 Share Posted March 11, 2008 i will copy box with the same size so they don't overlap each other but still random. it's hard to guess what you are really looking for. But you could create a grid of points and then use the groupSOP to group all points within your geometry and copy the boxes to them: http://www.preset.de/2007/0227/elefant-001/ Georg Quote Link to comment Share on other sites More sharing options...
symek Posted March 11, 2008 Share Posted March 11, 2008 (edited) The easist way to do such things is POP. Emit particels with self collision (interact) and set their scale to proper distance. After few frames you will be see that every particle finds its own space. The same thing goes for DOPs and intersection resolving but takes more time for big scene. Another way is VEX and HOM. Here you have the discusion on similar topic (the same even?): http://forums.odforce.net/index.php?showto...non-overlapping You'll find there some examples in VEX_SOP (+ great *.hip by petz with foreachSOP usage). Another incarnation of the same basic idea would look like this: sop deleteByDistance(string pointcloud = ""; int tries = 10; float min_dist = 1;) { int handle = pcopen(pointcloud, "P", P, 1, tries); vector pos; int pc_num; float pc_dist; while (pciterate(handle) ) { pcimport(handle, "P", pos); pcimport(handle, "point.number", pc_num); pcimport(handle, "point.distance", pc_dist); if ( (P != pos) && ( pc_dist <= min_dist)) addgroup("delete", pc_num); } } Now you can delete all points in the "delete" group. This solution isn't perfect. There is a slight misconception here as "tries" takes too much importance in that flow. Another code not directly on subject but solving quite similar problem (and I have it on my sketchpad right now so I can share it) is in HOM. It simply deletes prims group's members if they are too close to each other. Hope this will help you find the right solution for you. Cheers, sy. geo = hou.pwd().geometry() min_dist = hou.pwd().parm("dist").eval() for prim in geo.prims(): if prim.attribValue("group") == 1: prim_pos = hou.Vector3(prim.attribValue("Cd")) for nei in geo.prims(): if nei.attribValue("group") == 1 and prim != nei: nei_pos = hou.Vector3(nei.attribValue("Cd")) if prim_pos.distanceTo(nei_pos) <= min_dist: nei.setAttribValue("group", 0) This is a PythonSOP. It assumes: - "Cd" prim attribute with prim position copied onto it (with PrimitiveSOP for example) - "group" prim attribute with group membership indicator (0 or 1) Edited March 11, 2008 by SYmek 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.