Trying to add thickness to a custom lathe geometry

Hi all,

I am wondering if anyone can provide me with some guidance.
I have a custom shape that I describe using a path and .lineTo + .arc. I then use .getPoints() and pass this to the LatheGeometry. This works great and I am happy with the result. My next step and where I am having some trouble is giving this shape some thickness (a very thin wall thickness).

Currently I pass a path to LatheGeometry which gives me the shape. I figured I should try to extrude the path that I already have and then pass that resulting plane to LatheGeometry, but I have not had success doing so.

Here is a visual of the pre-lathe shape I currently have, and the pre-lathe shape I am looking for to give me thickness.

And here is a codepen with my progress so far: https://codepen.io/nateyy/pen/vEBbyLq

Thanks for your help!

To my knowledge, there is no built-in function in Three.js that can do this.

You want an equidistant curve, which is a CAD classic. Blender can do this easily, with the help of the “Curve Tools” addon, “Recursive offset” subfunction

If you want it interactively, via GUI slider “thickness”, then you’re on your own and have to construct the offset path like you did with the initial path.

That said: what visual impact do you expect this to have on the viewer?

I am looking for interactivity for this use case. Though the visual impact may be minimal this is for an engineering application that requires precise measurements.

Thank you for providing some more info.

You may be able to do it in a similar way to Construction of frames with contour/profile
I have only considered angular shapes, not curves. But this can be extended.

3 Likes

Not perfect (there are some glitches), but it might give some ideas:

https://codepen.io/boytchev/full/dPbrRzG

image

8 Likes

This is a super creative solution and should work great for what I am looking for. Thanks so much for your input!

1 Like

Very elegant solution! :+1:

I particularly like how you are putting the thickness to the inside and how you limit the slider’s range just so no “undercutting” occurs (thickness > smallest radius).

1 Like

Very elegant solution.
Is there a reason to use BoxGeometry?

That’s how it works too:


 var lathe = new THREE.Mesh(
		new THREE.BufferGeometry(),
1 Like

No any specific reason.

It is just a habit of mine to use something visible (usually boxes) for object placeholders.

3 Likes