Archived post by niconghiem

Was toying with the Linear Solver at work this week and ended up writing a Spectral Clustering algorithm that can somehow guess the number of clusters. Finally found a good scenario where it actually made sense to use the Spare_parminputindex trick (and not me obfuscating stuff for no reason <:hyperlaugh:443322845406298112> )

Unfortunately with those data-analysis type of things, the algorithm is not really scale dependent and results vary a lot if the parameters (standard deviation/distance between clusters) are in the good ballpark tho for my use case at work (clustering crowds) those do not really vary much so it’s pretty solid in most cases

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20250806/12/25/dev_spectral_clustering.mp4
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20250806/12/25/spectral_clustering_dev.hiplc

Archived post by sniperjake945

yeah i mean the problem itself is slightly underdefined because there are two possible solves, one where you rotate down and one where u rotate up

but it’s actually solved with a quadratic equation so u end up with both points of intersection

here are all the intersections visualized

here’s the file that has all the math for u

and like sure this could all be done with trig but this seemed cooler

🙂

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20232312/15/23/image.png
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20232312/15/23/Calculate_When_It_Connects_JR.hiplc

Archived post by mattiasmalmer

sometimes xyzdist() is not really what you want when you want to get distance from the edge of a font and so on because you get all these rounded corners. i wrote a quick wrangle that gives you the same type of sharp distance that an inset would give you:

“` int numprims=nprimitives(1);
float dist=10000000000000000000; for (int i=0; ipp=v@P-p0; if (dot(normalize(-normalize(p3-p1)+normalize(p0-p1)),v@P-p1)>=0) { if (dot(normalize(-normalize(p2-p0)+normalize(p1-p0)),pp)>=0) { dist=min(dist,(length(cross(pp,dir))/length(dir))); } }
}
@dist=dist; “`

(the second input is a “convertline” of the font)

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233912/04/23/houdinifx_CuEDfyQLMW.gif

Archived post by mattiasmalmer

sometimes xyzdist() is not really what you want when you want to get distance from the edge of a font and so on because you get all these rounded corners. i wrote a quick wrangle that gives you the same type of sharp distance that an inset would give you:

“` int numprims=nprimitives(1);
float dist=10000000000000000000; for (int i=0; ipp=v@P-p0; if (dot(normalize(-normalize(p3-p1)+normalize(p0-p1)),v@P-p1)>=0) { if (dot(normalize(-normalize(p2-p0)+normalize(p1-p0)),pp)>=0) { dist=min(dist,(length(cross(pp,dir))/length(dir))); } }
}
@dist=dist; “`

(the second input is a “convertline” of the font)

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20232412/04/23/houdinifx_CuEDfyQLMW.gif