made a tutorial of some SDF stuff that comes up every now and then
Category: cgi-math
Archived post by jan1376
Archived post by mattiasmalmer
“` void branchlessONB(vector n; vector b1; vector b2) { float sign =sign(n.z); float a = -1.0f / (sign + n.z); float b = n.x * n.y * a; b1 = set(1.0f + sign * n.x * n.x * a, sign * b, -sign * n.x); b2 = set(b, sign + n.y * n.y * a, -n.y); }
vector tangentu; vector tangentv;
branchlessONB(v@N,tangentu,tangentv);
v@tangentu=tangentu; v@tangentv=tangentv;
“`
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 mattiasmalmer
this is just a very crude work in progress implementation.
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20253401/27/25/PHASOR.hiplc
Archived post by _white_dog_
Sorry for finding your post late 😟 It may be too late now, but I tried implementing the biharmonic distance paper drive.google.com/file/d/1idWx_30R_VuXmIfLpyvkdl2ZCSak3x3D/view?usp=drive_link
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20243208/31/24/image.png
Archived post by sniperjake945
🫡
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20243504/09/24/jr_voronoi_kate_help.hip
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; i
}
@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; i
}
@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