# Is it possible to have different edgeColor and color on circleSource ?

**URL:** https://discourse.vtk.org/t/is-it-possible-to-have-different-edgecolor-and-color-on-circlesource/8216
**Category:** Web
**Created:** [April 5, 2022, 10:03am UTC](https://discourse.vtk.org/t/is-it-possible-to-have-different-edgecolor-and-color-on-circlesource/8216 "2022-04-05T10:03:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![toro](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/58f4c7/32.png) [@toro](https://discourse.vtk.org/u/toro)
#### Post date: [April 5, 2022, 10:03am UTC](https://discourse.vtk.org/t/is-it-possible-to-have-different-edgecolor-and-color-on-circlesource/8216/1 "2022-04-05T10:03:52Z")

</div>

Hi all,

I’m trying to colorize an actor whose mapper’s input connection is the output port of a circle source:

```auto
        var c = vtkCircleSource.newInstance();
        c.setLines(true);
        c.setFace(true);
        c.setResolution(80)
        c.setRadius(0.00005);

        const mapper = vtkMapper.newInstance();
        mapper.setInputConnection(c.getOutputPort());
        const actor = vtkActor.newInstance();
        actor.getProperty().setColor(1, 1, 1);

```

So far, so good.

But:

```auto
actor.getProperty().setEdgeColor(1, 0, 0);

```

doesn’t work.

```auto
actor.getProperty().setLineWidth(3);

```

doesn’t work either.

The question is then: is it possible to have at the same time different edge and face colors on actors build from circleSource?

In a different use case, the color is obtained from a lookup table:

```auto
        var lookupTable = vtkColorTransferFunction.newInstance();
        const preset = vtkColorMaps.getPresetByName("rainbow");
        lookupTable.applyColorMap(preset);
        lookupTable.setMappingRange(0, 100);
        lookupTable.updateRange();

        actor.getMapper().setScalarModeToUseCellData();
        actor.getMapper().setScalarRange(0, 100);
        actor.getMapper().setLookupTable(lookupTable);

        let d = vtkDataArray.newInstance({
            name: "t",
            dataType: 'Float32Array',
            values: Array.from({ length: c.getOutputData().getPolys().getNumberOfCells() }, (v, i) => t)
        });

        let attr = vtkDataSetAttributes.newInstance();
        attr.setScalars(d);
        attr.setActiveScalars("t");
        c.getOutputData().setCellData(attr);

```

This was working well on spheres but is rendered differently with circle:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/0/035aa3ba9b56f8ba3defe7e792f9a881c3c1d2af.png)

So here only the edge is drawn and colored. Is that expected?

Thanks for your help

---

<div class="post-metadata">

### Author: ![Eric\_Li](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/9d8465/32.png) [@Eric\_Li](https://discourse.vtk.org/u/Eric_Li)
#### Post date: [April 4, 2023, 7:39am UTC](https://discourse.vtk.org/t/is-it-possible-to-have-different-edgecolor-and-color-on-circlesource/8216/2 "2023-04-04T07:39:42Z")

</div>

you can turn on EdgeVisibility by `actor->GetProperty()->SetEdgeVisibility(true)`, and try again.

---

<div class="post-metadata">

### Author: ![KOt](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kot/32/7906_2.png) [@KOt](https://discourse.vtk.org/u/KOt)
#### Post date: [October 30, 2023, 9:18am UTC](https://discourse.vtk.org/t/is-it-possible-to-have-different-edgecolor-and-color-on-circlesource/8216/3 "2023-10-30T09:18:01Z")

</div>

That does not work: it shows all edges of all triangles.
