<div dir="ltr"><div dir="ltr">Thanks for doing this. Indeed I see the issue and reported a bug here:<div><br></div><div><a href="https://github.com/Kitware/vtk-js/issues/982">https://github.com/Kitware/vtk-js/issues/982</a><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 14, 2018 at 3:22 AM Raimonds Vilums <<a href="mailto:raimonds@cenos-platform.com">raimonds@cenos-platform.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><a href="https://codepen.io/raimonds-vilums/pen/OrMrEz" target="_blank">https://codepen.io/raimonds-vilums/pen/OrMrEz</a><br></div><div dir="ltr"><br></div><div>After load, you can see colored cells without transparency (3-component array).</div><div><br></div><div>For loading 4-component array, change array name on line 187</div><div>from <font face="monospace, monospace">mapper.setColorByArrayName('<b><font color="#38761d">rgbData</font></b>')</font><font face="arial, helvetica, sans-serif">;</font></div><div>to <font face="monospace, monospace">mapper.setColorByArrayName('<b><font color="#cc0000">rgbaData</font></b>');</font></div><div>which does not work.</div><div><br></div><div>Raimonds</div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 13, 2018 at 6:59 PM Sebastien Jourdain <<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Can you do a codepen and share it so I can see what you are doing exactly?</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 13, 2018 at 9:26 AM Raimonds Vilums <<a href="mailto:raimonds@cenos-platform.com" target="_blank">raimonds@cenos-platform.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">I tried and got</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">index.js:441 Uncaught (in promise) TypeError: Cannot add property 3, object is not extensible</div><div dir="ltr"> at Object.publicAPI.rGBAToRGBA (index.js:441)</div><div dir="ltr"> at Object.publicAPI.convertToRGBA (index.js:487)</div><div dir="ltr"> at Object.publicAPI.mapScalars (index.js:238)</div><div dir="ltr"> at Object.publicAPI.mapScalars (index.js:272)</div><div><br></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 13, 2018 at 6:10 PM Sebastien Jourdain <<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">You should be able to have an array with 4 components (RGBA)</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 13, 2018 at 9:01 AM Raimonds Vilums <<a href="mailto:raimonds@cenos-platform.com" target="_blank">raimonds@cenos-platform.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Is it possible to display cells with custom opacity for each cell?</div><div><br></div><div>Till now, I managed<br></div><div>1) set opacity to the actor (e.g., <span style="font-family:"Courier New";color:rgb(102,14,122);font-weight:bold">actor</span><span style="color:rgb(0,0,0);font-family:"Courier New"">.</span><span style="color:rgb(0,0,0);font-family:"Courier New";font-style:italic">getProperty</span><span style="color:rgb(0,0,0);font-family:"Courier New"">().</span><span style="font-family:"Courier New";color:rgb(122,122,67)">setOpacity</span><span style="color:rgb(0,0,0);font-family:"Courier New"">(0.5)</span>)<br></div><div>2) color cells with solid colors, e.g:<br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><ul><li>vtk file contains CELL_DATA array of floats with 3 components for every color</li><li><pre style="color:rgb(0,0,0);font-family:"Courier New""><span style="color:rgb(69,131,131)">mapper</span>.setColorModeToDirectScalars();</pre></li><li><pre style="color:rgb(0,0,0);font-family:"Courier New""><pre style="font-family:"Courier New""><span style="color:rgb(69,131,131)">mapper</span>.setScalarModeToUseCellFieldData();</pre></pre></li><li><pre style="font-family:"Courier New""><pre style="color:rgb(0,0,0);font-family:"Courier New""><span style="color:rgb(69,131,131)">mapper</span>.setColorByArrayName(<span style="color:rgb(0,128,0);font-weight:bold">'my_cell_data'</span>);</pre></pre></li></ul></blockquote></div><div>But I could not find a way to set alpha/opacity/transparency for particular cells.</div><div>Is it possible?</div><div><br></div><div>Regards,</div><div>Raimonds</div><div> <br></div></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>