# Measure area only for specific labels

**URL:** <https://community.freefem.org/t/measure-area-only-for-specific-labels/1349>\
**Category:** General Discussion\
**Created:** [November 25, 2021, 3:08pm UTC](https://community.freefem.org/t/measure-area-only-for-specific-labels/1349 "2021-11-25T15:08:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![distractor](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@distractor](https://community.freefem.org/u/distractor)\
**Post date:** [November 25, 2021, 3:08pm UTC](https://community.freefem.org/t/measure-area-only-for-specific-labels/1349/1 "2021-11-25T15:08:31Z")

</div>

So imagine a 3D body, can also be as simple as cube.

```auto
load "msh3"

int[int] l6 = [37, 42, 45, 40, 25, 57];
int r11 = 11;
mesh3 Th = cube(4, 5, 6, [x*2-1, y*2-1, z*2-1], label=l6, flags =3, region=r11);

cout << "Volume = " << Th.measure << ", border area = " << Th.bordermeasure << endl;

```

But is it possible to obtain the area of triangles with a specific label? For example, if I wanted to measure the boundary area of label 40, how would I do that?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 25, 2021, 3:13pm UTC](https://community.freefem.org/t/measure-area-only-for-specific-labels/1349/2 "2021-11-25T15:13:18Z")

</div>

Use `extract`, cf. `FreeFem-sources/examples/3dSurf/extractSurfFromMesh3.edp`, and then take the measure of the resulting `meshS`.

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [November 25, 2021, 6:12pm UTC](https://community.freefem.org/t/measure-area-only-for-specific-labels/1349/3 "2021-11-25T18:12:39Z")

</div>

just use

real area40= int2d(Th,40)(1.);
