Archived post by sniperjake945

i know we’ve all moved on from the hex sphere conversation but i will say the planarization method sidefx is using in the facet sop is actually so un flattering. Im assuming its generating some kind of per face normal and then using the average position and then projecting wrt to that. but like there are so many better methods… For instance, using the local/local solve from: roipo.github.io/publication/poranne-2013-interactive/planarization.pdf
We get the result on the right after 50 iterations (which is planar for all faceted polygons) vs what’s coming out of the facet sop with make planar turned on (left)…
The file also includes an example of the local global solve (or at least to the best of my ability it does)

if we planarize before faceting we can get even better results in some cases. Like this sphere example. The left is facet and the right is the local/local solve (faceted after).

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20250810/18/25/image.png
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20250810/18/25/jr_planarize_polygons.hip

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