lugnut Posted November 25, 2020 Share Posted November 25, 2020 Hi all- Building a procedural constraint network for wires by connecting the interior points in a grid. It works fine for some grid dimensions, but not others, where the sim blows up. shown below a 5x5 and a 6x6 grid. A 15x15 grid will work fine, but a 6x6 one won't. Curious! I'm building zero-length constraints from the interior points and setting the anchor points as follows: int wirepts[] = nearpoints(1,@P,.0001); foreach (int wpt; wirepts) { if(wpt != wirepts[0]) { int pt1 = addpoint(0,v@P); int pt2 = addpoint(0,v@P); setpointattrib(0,"anchor_id",pt1,wirepts[0]); setpointattrib(0,"anchor_id",pt2,wpt); int newprim = addprim(0,"polyline",pt1,pt2); setprimattrib(0,"constraint_name",newprim, "WireGlue"); setprimattrib(0,"constraint_type",newprim, "position"); } } setpointgroup(0,"delete",@ptnum,1,"set"); I delete the original points later - I'm not using the first of the nearpoints to avoid a prim with the same anchor points, I thought that might be the problem, but it didn't seem to matter. Does anybody know the reason why this happens? Am I missing something? Thanks - I'm including a sample file. wireGridConstraints.hiplc Quote Link to comment Share on other sites More sharing options...
Noobini Posted November 25, 2020 Share Posted November 25, 2020 (edited) it's your time dependent nodes, ie. the transform because you transform, then do attribtransfer...I think this is causing things to go awry, so I disabled your transform and moved it to AFTER the transfer (quickest way to pinpoint the culprit is in your orig file, simply disable the transform, it works straightaway, just without the movement) wireGridConstraints_fix.hipnc Edited November 25, 2020 by Noobini Quote Link to comment Share on other sites More sharing options...
lugnut Posted November 25, 2020 Author Share Posted November 25, 2020 Ah thanks! should have tried that! 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.