petz Posted August 28, 2007 Share Posted August 28, 2007 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 Quote Link to comment Share on other sites More sharing options...
edward Posted August 29, 2007 Share Posted August 29, 2007 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. Quote Link to comment Share on other sites More sharing options...
rdg Posted August 29, 2007 Share Posted August 29, 2007 (edited) 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 August 29, 2007 by rdg Quote Link to comment Share on other sites More sharing options...
petz Posted August 29, 2007 Author Share Posted August 29, 2007 @edward does this mean, that i have to use $TX, ... for the expresseion, or do i completely misunderstand the code? @georg thank Quote Link to comment Share on other sites More sharing options...
edward Posted August 31, 2007 Share Posted August 31, 2007 does this mean, that i have to use $TX, ... for the expresseion, or do i completely misunderstand the code? Er, I think you're misunderstanding. There's no way that nearpoint() expression can work the way you want it to. Quote Link to comment Share on other sites More sharing options...
3dbeing Posted September 28, 2007 Share Posted September 28, 2007 (edited) 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 September 28, 2007 by 3dbeing 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.