# Tube Geometry with width

**URL:** <https://discourse.threejs.org/t/tube-geometry-with-width/50540>\
**Category:** Questions\
**Tags:** threejs, geometry\
**Created:** [April 18, 2023, 6:32pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540 "2023-04-18T18:32:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![cory](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/cory/32/33264_2.png) [@cory](https://discourse.threejs.org/u/cory)\
**Post date:** [April 18, 2023, 6:32pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/1 "2023-04-18T18:32:50Z")

</div>

Hello everyone, I hope you have a nice day.

I would like to generate the tube which has its own width.  
To use TubeGeometry or CylinderGeometry in three.js the width is zero.  
And if it’s possible, can I draw it in Cannon.js too?  
So, please help me.

---

<div class="post-metadata">

**Author:** ![Lawrence3DPK](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/lawrence3dpk/32/29184_2.png) [@Lawrence3DPK](https://discourse.threejs.org/u/Lawrence3DPK)\
**Post date:** [April 18, 2023, 6:47pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/2 "2023-04-18T18:47:49Z")

</div>

It’s not clear what you’re asking, [TubeGeometry](https://threejs.org/docs/#api/en/geometries/TubeGeometry) has a radius parameter you can pass in on its creation… Is this what you’re referring to as “width”?

---

<div class="post-metadata">

**Author:** ![cory](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/cory/32/33264_2.png) [@cory](https://discourse.threejs.org/u/cory)\
**Post date:** [April 18, 2023, 6:57pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/3 "2023-04-18T18:57:57Z")

</div>

Hi @Lawrence3DPK, thank you for your help.

Sharing this image for the reference…

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?dsh=S-503130643%3A1681844173123822&continue=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1MA0rKEUMj3D8fw6iDXIGoWQupQj87dY9%2Fview%3Fusp%3Dshare_link&followup=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1MA0rKEUMj3D8fw6iDXIGoWQupQj87dY9%2Fview%3Fusp%3Dshare_link&ifkv=AQMjQ7TGo6qeKniEaQ8Lyt-I4NI11rDoaCvZtbQEUxgicxYZ4EY8xaKPqQf5mrrvaBx-jBycyg1o&osid=1&passive=1209600&service=wise&flowName=WebLiteSignIn&flowEntry=ServiceLogin)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?dsh=S-452625345%3A1681844234147603&continue=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1scnm-ERDwNQpGbuotgOvY7AVtFpDxL8_%2Fview%3Fusp%3Dsharing&followup=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1scnm-ERDwNQpGbuotgOvY7AVtFpDxL8_%2Fview%3Fusp%3Dsharing&ifkv=AQMjQ7TDyXA2mmDk-ImXfDvh94xJc9d8X5G3c5Oo4vUcqtrkwCdFS5KbWUeYRDk1E6TdaSzLopAN&osid=1&passive=1209600&service=wise&flowName=WebLiteSignIn&flowEntry=ServiceLogin)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

---

<div class="post-metadata">

**Author:** ![Lawrence3DPK](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/lawrence3dpk/32/29184_2.png) [@Lawrence3DPK](https://discourse.threejs.org/u/Lawrence3DPK)\
**Post date:** [April 18, 2023, 7:08pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/4 "2023-04-18T19:08:26Z")

</div>

Both of the links you’ve shared return a malformed url request, any chance you can just paste the images in this thread?

---

<div class="post-metadata">

**Author:** ![cory](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/cory/32/33264_2.png) [@cory](https://discourse.threejs.org/u/cory)\
**Post date:** [April 18, 2023, 7:20pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/5 "2023-04-18T19:20:44Z")

</div>

Sorry, I forgot to set the permission. 😄  
Please check it again

---

<div class="post-metadata">

**Author:** ![Lawrence3DPK](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/lawrence3dpk/32/29184_2.png) [@Lawrence3DPK](https://discourse.threejs.org/u/Lawrence3DPK)\
**Post date:** [April 18, 2023, 7:22pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/6 "2023-04-18T19:22:00Z")

</div>

Nope, it’s a still a malformed 404.

---

<div class="post-metadata">

**Author:** ![cory](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/cory/32/33264_2.png) [@cory](https://discourse.threejs.org/u/cory)\
**Post date:** [April 18, 2023, 7:25pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/7 "2023-04-18T19:25:02Z")

</div>

I tried to upload an image here, but it didn’t go through.

Please check it again.

> **[Screenshot\_12.png](https://drive.google.com/file/d/1scnm-ERDwNQpGbuotgOvY7AVtFpDxL8_/view)**
>
> Google Drive file.

> **[Screenshot\_13.png](https://drive.google.com/file/d/1MA0rKEUMj3D8fw6iDXIGoWQupQj87dY9/view)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [April 18, 2023, 7:30pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/8 "2023-04-18T19:30:05Z")

</div>

> [@cory](#):
>
> I tried to upload an image here, but it didn’t go through.

Let me try:

![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/c/d/cda131ede470bf16567636556f4e123bd8f97be8.png) ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/e/0/e0b89e298975a3fe3b71395be713d64554b89bb9.png)

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [April 18, 2023, 7:49pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/9 "2023-04-18T19:49:51Z")

</div>

As an option, you can use `THREE.Shape` of `absarc` with a circular hole, and pass it in `THREE.ExtrudeGeometry`

 ![изображение](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/4/846f4de32d2dcbf549e2a7a870d0ee4adf1ee7cf.png)

Demo: [https://codepen.io/prisoner849/full/WNaGowN](https://codepen.io/prisoner849/full/WNaGowN)

---

<div class="post-metadata">

**Author:** ![cory](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/cory/32/33264_2.png) [@cory](https://discourse.threejs.org/u/cory)\
**Post date:** [April 18, 2023, 7:59pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/10 "2023-04-18T19:59:29Z")

</div>

Thank you @prisoner849, it works well

---

<div class="post-metadata">

**Author:** ![cory](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/cory/32/33264_2.png) [@cory](https://discourse.threejs.org/u/cory)\
**Post date:** [April 18, 2023, 8:00pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/11 "2023-04-18T20:00:07Z")

</div>

And can I draw this shape even in Cannon.js?

---

<div class="post-metadata">

**Author:** ![Nathan\_Caspar](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nathan_caspar/32/45141_2.png) [@Nathan\_Caspar](https://discourse.threejs.org/u/Nathan_Caspar)\
**Post date:** [February 27, 2024, 9:54pm UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/12 "2024-02-27T21:54:40Z")

</div>

@prisoner849 is it possible to control the thickness of this tube with a slider using the GUI? I am hoping to create a simple tube like this (but straight) where a user can control the size of the inner and outer diameter.

Thanks!

---

<div class="post-metadata">

**Author:** ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)\
**Post date:** [February 28, 2024, 12:00am UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/13 "2024-02-28T00:00:51Z")

</div>

You can but you wont be able to use a dynamic collider with it… but it could work as a static collider.

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [February 28, 2024, 7:46am UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/14 "2024-02-28T07:46:37Z")

</div>

Rebuild mesh’s geometry by extruding a shape with new parameters? 🤔

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [February 28, 2024, 9:59am UTC](https://discourse.threejs.org/t/tube-geometry-with-width/50540/15 "2024-02-28T09:59:35Z")

</div>

I’d propose morphing between the outer surface and the central path along the tube. Better performance at the cost of more data.
