lugnut 2 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 Share this post Link to post Share on other sites
Noobini 732 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 Share this post Link to post Share on other sites
lugnut 2 Posted November 25, 2020 Ah thanks! should have tried that! Share this post Link to post Share on other sites