Is there an implementation of a straight skeleton algorithm with Three.JS

Hello I recently came across this library for creating straight skeletons. It left me wondering if there is anything similar implemented for three.js, more specifically the offset and extrusion functionalities outlined here.

I know there are some simple offsetting out there, including three’s own extrudeGeometry, however I haven’t seen anything nearly as robust, and able to handle holes and weighted skeletons like this.

Any suggestions? Thank you!

2 Likes

Can you show some examples if you really done?

A bit rude bro. If you’re gonna ask people to share things, you might want to explain why you want/need to see it or at least give some positive feedback. :slight_smile:

A straight skeleton algorithm that works well for any polygonal shape (including holes, self-intersections, concavities) is hard to do. There are too many special cases that must be resolved. I’m not aware of implementation specific to Three.js. Generally, such algorithm could (and should) be designed to be independent on any graphical/rendering system.

So, my suggestion is to look for JavaScript implementations of the straight skeleton algorithm and experiment whether any of them works fine with Three.js.

I made a quick search and this algorithm implementation in TypeScript came up. It is for unweighted skeletons, but reportedly, supports holes:

1 Like

Thank you! That does make sense.

And thanks for the implementation suggestion, it uses as its base the same link I mentioned, which is great.

1 Like