Rectangles and Gradients

[email protected] Thu, 10 Oct 2019 18:43:52 +0000 (UTC)
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
--===============0729844039==
Content-Type: multipart/alternative; 
	boundary="----=_Part_509056_2001509023.1570733032034"

------=_Part_509056_2001509023.1570733032034
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi all,

When a rectangle gets rotated in 3d and then flattened to 2d it can become a trapezoid. If a linear gradient is drawn using one side of the trapezoid the gradient becomes "angled." A mesh gradient solves this but the mesh gradient doesn't output to text in a svg. The mesh gradient isn't defined for svg 1.0 so the output gets rasterized. Is there a way to have a linear gradient draw like a mesh gradient in 3d so that svg can be output as text? Maybe some geometry that I am missing. It would be a good thing to be able to output mesh gradients as text in svg.

The histogram_chart3d program rotates some rectangles in 3d with cairo. It compares mesh gradients and linear gradients along with the output to svg. If interested in taking a look, build instructions are at the top of histogram_chart3d_UI.c or a make file if you have gtk3 and freetype libraries to link to. Cairo draws very well here. Even the mesh gradient cylinders look really good.

https://gitlab.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc/cairo3d

Thanks,
Eric
------=_Part_509056_2001509023.1570733032034
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit


<div style="color:black;font: 10pt arial;"><font size="2">Hi all,<br>
<br>
When a rectangle gets rotated in 3d and then flattened to 2d it can become a trapezoid. If a linear gradient is drawn using one side of the trapezoid the gradient becomes "angled." A mesh gradient solves this but the mesh gradient doesn't output to text in a svg. The mesh gradient isn't defined for svg 1.0 so the output gets rasterized. Is there a way to have a linear gradient draw like a mesh gradient in 3d so that svg can be output as text? Maybe some geometry that I am missing. It would be a good thing to be able to output mesh gradients as text in svg.<br>
<br>
The histogram_chart3d program rotates some rectangles in 3d with cairo. It compares mesh gradients and linear gradients along with the output to svg. If interested in taking a look, build instructions are at the top of histogram_chart3d_UI.c or a make file if you have gtk3 and freetype libraries to link to. Cairo draws very well here. Even the mesh gradient cylinders look really good.<br>
<br>
https://gitlab.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc/cairo3d<br>
<br>
Thanks,<br>
Eric</font></div>

------=_Part_509056_2001509023.1570733032034--

--===============0729844039==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

LS0gCmNhaXJvIG1haWxpbmcgbGlzdApjYWlyb0BjYWlyb2dyYXBoaWNzLm9yZwpodHRwczovL2xp
c3RzLmNhaXJvZ3JhcGhpY3Mub3JnL21haWxtYW4vbGlzdGluZm8vY2Fpcm8=

--===============0729844039==--