Popular Post konstantin magnus Posted November 7, 2021 Popular Post Share Posted November 7, 2021 A simple mycelium growth simulation that works in 2D and 3D: It constantly adds points to the outer edge of point clouds (1) and favours doing so towards food (2). 1: Direction away from surrounding points: float radius = chf('radius'); int pts_max = chi('max_points'); int handle = pcopen(0, 'P', v@P, radius, pts_max); vector pos_avg = pcfilter(handle, 'P'); vector dir_avg = v@P - pos_avg; v@N = dir_avg; 2: Weighting probabilities and adding points: int pt_near = nearpoint(1, v@P); vector pos_near = point(1, 'P', pt_near); float prox = distance(v@P, pos_near); float weight_prox = fit(prox, prox_min, prox_max, 0.0, 1.0); float weight_rim = fit(length(v@N), rim_min, rim_max, 1.0, 0.0); float weight = dens * (weight_rim + weight_prox); if(nrandom('mersenne') > weight){ vector pos_add = v@P + normalize(v@N) * offset; int pt_add = addpoint(0, pos_add); addprim(0, 'polyline', i@ptnum, pt_add); } mycelium.hiplc 10 3 Quote Link to comment Share on other sites More sharing options...
crispr_boi Posted December 2, 2021 Share Posted December 2, 2021 this is awesome! again an awesome gift from Konstantin! Quote Link to comment Share on other sites More sharing options...
scorpes Posted January 30, 2023 Share Posted January 30, 2023 Very cool! Thank you. Is it also possible to grow this on a 3D surface? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted January 30, 2023 Author Share Posted January 30, 2023 (edited) 7 hours ago, scorpes said: Very cool! Thank you. Is it also possible to grow this on a 3D surface? Hi Robert, yes, you can integrate the minimal surface position with the ray node or minpos(). I've added the pig head to the food input to motivate growth there, as well. mycelium_3d.hipnc Edited January 30, 2023 by konstantin magnus 1 1 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.