Jump to content

Nearpoint Question


petz

Recommended Posts

hi,

i have used the scatter sop and copied circles to the points. to avoid overlapping objects, i activated the "compute nearest" option and used this attribute to drive the scale of the circles. just for fun i have tried then to achieve the same result by using the nearpoint expression. i have used the following code - nearpoint("../point1", point("../point1", $PT, "P", 0), point("../point1", $PT, "P", 1), point("../point1", $PT, "P", 2)) - but all i got, was the increasing point number. i have tried the expression in several variations, but i can

point_distance2.hipnc

Link to comment
Share on other sites

I don't think your expression can work because you want the nearest point in that SOP *except* for point number $PT. It's returning you the expected result since that is the point number that is closest to that position in space.

Link to comment
Share on other sites

but i have no idea how to start

http://www.cricketschirping.com/processing/CirclePacking1/

http://en.wiki.mcneel.com/default.aspx/McN...2DCirclePacking

Maybe a dop/sop solver can be used to pack circles?

It looks very iterative/recursive ...

Georg

(not working: pythonSOP rdg_circle_pacling_v1.13.zip)

Edited by rdg
Link to comment
Share on other sites

  • 4 weeks later...
Er, I think you're misunderstanding. There's no way that nearpoint() expression can work the way you want it to.

Well to be sure I think there is a way, perhaps you want to use a copy sop along with a delete sop in 2 branches one delete selected the other delete non selected using `stamp("../copy1",$CY,0)` as your expression in the pattern field, where $CY is declared in your copy sop, then use the nearpoint expression and using the delete selected sop as your lookat..can't u/l any files from here, Sony can be a bit particular about that :-/ in an atribute sop after the delete selected, but before the copy add an attribCreate sop with the expression

nearpoint("../delete2", point("../delete1", 0, "P", 0), point("../delete1", 0, "P", 1), point("../delete1", 0, "P", 2))

you can explicitly tell it the point number as there should only be 1 point in that sop, of course this is not going to be quick if you have a very large number of points, but it will do the trick.

you should add a delete sop after the delete selected, and delete everything and merge it back into one stream before the copy sop... worked fine for me.

-3db

p.s.

forgot to add in the number of copys field you should use the expression npoints("../scatter1")

Edited by 3dbeing
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...