Archived post by Nick D

@mestela `Sure! Here’s a short rap about Matt Estela:
Verse 1: Meet Matt Estela, the man with the plan He runs Cg Wiki, where graphics fans Can find all the knowledge they need to grow And learn about Houdini, the software pro
Chorus: Matt’s got the skills, he’s got the drive He makes the graphics come alive With Houdini in his hands, he’s a king Making stunning visuals, that’s his thing!`

Archived post by PaqWak

So I was looking for a way to find the longest path in a network of edges, like the opposite from what the ‘find shortest path’ does. I remember looking for a solution previously without succes. So I asked Skynet (Chat-GPT), and here’s his solution :

The doc don’t mention that, actually the shortest path OP complain about the negative weight … but it indeed output the longest path as far as I can tell 🥳

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20234501/11/23/image.png

Archived post by SniperJake945

you can get some neat effects by adjusting the above code too, like a weighted max, with just a constant y value for the gradient can give you this like pillars rising up effect: “`c vector g = volumegradient(1, 0, @P); //taking the gradient from the second input,
float intensity = ch(“intensity”); float dx = length(v@dPdx); //voxel size; g *= dx; //scale our vector by voxel size float samples = chi(“samples”); float out_val = @density; float weights = 1.0; for(int i = 0; i <= samples; i++){ float u = i / float(samples); //0 -> 1 vector sample_p = v@P + g * u * intensity; float value = volumesample(0, 0, sample_p); float w = smooth(-.1, 1, 1 – u); //in theory this should be a gaussian, because its a better falloff, but yolo out_val = max(out_val,value * w); //weighted max
} @density = out_val;// / weights; “`

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20222908/22/22/unknown.png

Archived post by SniperJake945

@Casey throw this in a prim wrangle (this code snippet group edges based on the interior angle of the two adjacent prims):
“`c vector edge(int h){ return vector(point(0, “P”, hedge_dstpoint(0, h))) – vector(point(0, “P”, hedge_srcpoint(0, h))); }
int h = primhedge(0, @primnum); int test = h; do{ if(hedge_equivcount(0, h) > 1){ vector e = edge(h) * (hedge_primary(0,h) ? 1 : -1); int prim1 = hedge_prim(0, h); int prim2 = hedge_prim(0, hedge_nextequiv(0, h)); vector n1 = prim(0, “N”, prim1); vector n2 = prim(0, “N”, prim2); matrix3 m = dihedral(e, set(0,0, 1)); //rotate e to be face up n1 *= m; n2 *= m; n1.z *= 0; //ensure our normal is 2d now, and normalize, probably overkill but whatever n2.z *= 0; n1 = normalize(n1); n2 = normalize(n2); float ang = atan2(n2.y*n1.x – n2.x*n1.y, n2.x*n1.x + n2.y*n1.y); //angle between vectors in 2d ang += M_PI; //interior angle, from 0-2PI if(ang <= radians(ch("interior_angle_maximum"))){ //our test is in degrees, typically we want to find interior angles lower than 100 degrees? setedgegroup(0, "peaks", hedge_srcpoint(0, h), hedge_dstpoint(0, h), 1); } } h = hedge_next(0, h); }while(h != test); ``` and then click the add parms button thing on the wrangle, for the geo you sent, it seems like an angle threshold of 100 degrees seems to work 🙂

oh and you need to add prim normals with a normal sop