# Extrude w/o cap + CSG = Artifacts

**URL:** https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874
**Category:** Bugs
**Created:** [December 22, 2020, 9:21pm UTC](https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874 "2020-12-22T21:21:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rockwell15](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rockwell15/32/13116_2.png) [@rockwell15](https://forum.babylonjs.com/u/rockwell15)
#### Post date: [December 22, 2020, 9:21pm UTC](https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874/1 "2020-12-22T21:21:50Z")

</div>

So I’ve found that if I extrude a shape w/o end caps, then apply a CSG operation to it, I get artifacts.

In the demo provided I use a simple box to subtract from my extruded shape, and it seems as if the absence of the cap gets projected to the other side of the box. Though I’m not sure why this happens since it doesn’t intersect on the cap.

> **[Babylon.js Playground](https://playground.babylonjs.com/#3KEIEY)**

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [December 22, 2020, 10:00pm UTC](https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874/2 "2020-12-22T22:00:42Z")

</div>



---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [December 22, 2020, 10:01pm UTC](https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874/3 "2020-12-22T22:01:32Z")

</div>

@Evgeni_Popov will have a look tomorrow he is usually amazing with those kind of issues 🙂

---

<div class="post-metadata">

### Author: ![rockwell15](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rockwell15/32/13116_2.png) [@rockwell15](https://forum.babylonjs.com/u/rockwell15)
#### Post date: [December 22, 2020, 10:02pm UTC](https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874/4 "2020-12-22T22:02:50Z")

</div>

Awesome, thanks!

---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [December 23, 2020, 10:22am UTC](https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874/5 "2020-12-23T10:22:34Z")

</div>

Unfortunately I think that’s the algorithm which expects closed shapes to work as expected…

> [@rockwell15](#):
>
> Though I’m not sure why this happens since it doesn’t intersect on the cap.

It’s the cap ended up in the box which is the problem: if you add `cap: BABYLON.Mesh.CAP_END` to the extrusion it does work as expected.

> **[Babylon.js Playground](https://playground.babylonjs.com/#3KEIEY%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [December 23, 2020, 9:52pm UTC](https://forum.babylonjs.com/t/extrude-w-o-cap-csg-artifacts/16874/6 "2020-12-23T21:52:40Z")

</div>


