# More Materials on ExtrudeGeometry

**URL:** <https://discourse.threejs.org/t/more-materials-on-extrudegeometry/34269>\
**Category:** Discussion\
**Tags:** materials, geometry\
**Created:** [January 29, 2022, 2:57pm UTC](https://discourse.threejs.org/t/more-materials-on-extrudegeometry/34269 "2022-01-29T14:57:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shinymaker](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/shinymaker/32/23871_2.png) [@Shinymaker](https://discourse.threejs.org/u/Shinymaker)\
**Post date:** [January 29, 2022, 2:57pm UTC](https://discourse.threejs.org/t/more-materials-on-extrudegeometry/34269/1 "2022-01-29T14:57:08Z")

</div>

In [this reply on another post](https://discourse.threejs.org/t/adding-walls-from-mouse-clicks/15892/2), Mugen87 summarily states the truth about `ExtrudeGeometry's` material usage. My question is, would supporting more fine-grained application of materials in `ExtrudeGeometry` be a feature the 3js powers that be would consider adding? The above-linked post is one example of someone wanting the feature; I’m also working on a project where I want that feature (in my case, I only want the “top” face to have a unique material). I’ve gone ahead and customized `ExtrudeGeometry` for my own needs (as I suspect that other poster also did). Should I take it a step further, clean it up, and submit a pull request?

---

<div class="post-metadata">

**Author:** ![vielzutun.ch](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/vielzutun.ch/32/21366_2.png) [@vielzutun.ch](https://discourse.threejs.org/u/vielzutun.ch)\
**Post date:** [January 29, 2022, 3:41pm UTC](https://discourse.threejs.org/t/more-materials-on-extrudegeometry/34269/2 "2022-01-29T15:41:09Z")

</div>

> [@Shinymaker](#):
>
> (in my case, I only want the “top” face to have a unique material)

It’s interesting, that exactly your use-case is already covered by the standard `ExtrudeGeometry()`:

From the [documentation](https://threejs.org/docs/#api/en/geometries/ExtrudeGeometry):

> When creating a Mesh with this geometry, if you’d like to have a separate material used for its face and its extruded sides, you can use an array of materials. The first material will be applied to the face; the second material will be applied to the sides.

---

<div class="post-metadata">

**Author:** ![Shinymaker](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/shinymaker/32/23871_2.png) [@Shinymaker](https://discourse.threejs.org/u/Shinymaker)\
**Post date:** [January 29, 2022, 3:57pm UTC](https://discourse.threejs.org/t/more-materials-on-extrudegeometry/34269/3 "2022-01-29T15:57:41Z")

</div>

The documentation is slightly misleading. The first material is applied to the top **and bottom** faces (“caps”) and the second material to the sides. A quick glance at the code shows why; the caps are part of the same group with the same material index. I’m not going to quote the code here, because it’s a lot of lines; see [ExtrudeGeometry.js](https://github.com/mrdoob/three.js/blob/efbfc67edc7f65cfcc61a389ffc5fd43ea702bc6/src/geometries/ExtrudeGeometry.js) lines 510-564.

---

<div class="post-metadata">

**Author:** ![vielzutun.ch](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/vielzutun.ch/32/21366_2.png) [@vielzutun.ch](https://discourse.threejs.org/u/vielzutun.ch)\
**Post date:** [January 29, 2022, 4:12pm UTC](https://discourse.threejs.org/t/more-materials-on-extrudegeometry/34269/4 "2022-01-29T16:12:19Z")

</div>

> [@Shinymaker](#):
>
> The documentation is slightly misleading.

I generously assumed, that the extruded geometry would be _standing_ on its bottom face, which would become hidden from sight and so it wouldn’t really matter what material it has … 😊

I also gave you a “like” for your precision reading and interpretation.
