[Scilab-users] creating nice svg-files

classic Classic list List threaded Threaded
6 messages Options
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] creating nice svg-files

Dear all,

I try to create some svg-files using xs2svg.

In the plot I use xfpoly to draw regions of interest in different colours.

// plot the ROI 1
xfpoly(roi1_X, roi1_Y ,color_roi1);    
e=gce();       
e.foreground = color_roi1;           
e.line_mode = "off";
// plot the ROI 2
xfpoly(roi2_X, roi2_Y ,color_roi2);    
e=gce();       
e.foreground = color_roi2;           
e.line_mode = "off";

The code itself is running, and the plot in Scilab looks as expected...even when I zoom into the graph it's all nice.

However:
When I export the plot with xs2svg some thin black lines appear within the regions.
This can be seen when I open the svg with inkscape.

Yes: I could use xs2png, but I'ld prefer xs2svg.

Any idea how to avoid these black lines..see example below?

Thank you,
Philipp



grafik.png
example of xs2svg export

grafik.png
example of xs2png export



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} creating nice svg-files

Hello,

> De : users [mailto:[hidden email]] De la part de P M
> Envoyé : jeudi 28 février 2019 20:06
>
> When I export the plot with xs2svg some thin black lines appear within the regions.
> This can be seen when I open the svg with inkscape.
> [...] Any idea how to avoid these black lines.

I don't know for your case but I usually rework a bit the SVG files created by Scilab.

I noticed for example that the white background is made of several rectangles and right triangles, I simplify the paths etc.

I wonder if the black line is not a seam between two surfaces:
maybe your red surface is made of two objects instead of one and you might join them.

HTH

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} creating nice svg-files

Hi Christophe

... I figured out that in inkscape one can combine paths...( Ctrl++ )... so that creates just one single area.
so i have a solution.

However it might be interesting to know, how Scilab fills the polygon when saving it as an svg.
To me it seems something similar to a tessalation...building triangles to fill the area.
The lines in the image are the triangle edges.

In my example the red surface is a fill of one single polygon.
Also the green area is the fill of one single polygon.



Thanks,
Philipp




Am Fr., 1. März 2019 um 09:13 Uhr schrieb Dang Ngoc Chan, Christophe <[hidden email]>:
Hello,

> De : users [mailto:[hidden email]] De la part de P M
> Envoyé : jeudi 28 février 2019 20:06
>
> When I export the plot with xs2svg some thin black lines appear within the regions.
> This can be seen when I open the svg with inkscape.
> [...] Any idea how to avoid these black lines.

I don't know for your case but I usually rework a bit the SVG files created by Scilab.

I noticed for example that the white background is made of several rectangles and right triangles, I simplify the paths etc.

I wonder if the black line is not a seam between two surfaces:
maybe your red surface is made of two objects instead of one and you might join them.

HTH

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: creating nice svg-files

Le 01/03/2019 à 14:20, P M a écrit :

> Hi Christophe
>
> ... I figured out that in inkscape one can combine paths...( Ctrl++
> )... so that creates just one single area.
> so i have a solution.
>
> However it might be interesting to know, how Scilab fills the polygon
> when saving it as an svg.
> To me it seems something similar to a tessalation...building triangles
> to fill the area.
> The lines in the image are the triangle edges.

Yes, it's the case, at least as soon as the figure is in 3D. In 3D,
every surface defined by a set of (not necessarily coplanar) vertices is
decomposed as a set of joined triangles.

These "edges" are not extra drawn lines, but a very thin space (likely
1-pixel thin) in-between almost joined triangles edges. Indeed, changing
the background color changes their color.
The fix would be to output some triangles oversized by 1/10000 ?
This could have some potential drawbacks, like (partly) hiding some
lines actually drawn as edges, etc.
To be assessed.

Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: creating nice svg-files

Le 01/03/2019 à 17:27, Samuel Gougeon a écrit :

> Le 01/03/2019 à 14:20, P M a écrit :
>> Hi Christophe
>>
>> ... I figured out that in inkscape one can combine paths...( Ctrl++
>> )... so that creates just one single area.
>> so i have a solution.
>>
>> However it might be interesting to know, how Scilab fills the polygon
>> when saving it as an svg.
>> To me it seems something similar to a tessalation...building
>> triangles to fill the area.
>> The lines in the image are the triangle edges.
>
> Yes, it's the case, at least as soon as the figure is in 3D. In 3D,
> every surface defined by a set of (not necessarily coplanar) vertices
> is decomposed as a set of joined triangles.
>
> These "edges" are not extra drawn lines, but a very thin space (likely
> 1-pixel thin) in-between almost joined triangles edges. Indeed,
> changing the background color changes their color.
> The fix would be to output some triangles oversized by 1/10000 ?

Maybe there is some SVG internal property directly tuning this effect. I
will look at that.

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} creating nice svg-files

In reply to this post by der_Phil
This issue is now reported as bug 15991.

A way to correct it is provided in the report. However, implementing this fix
for Scilab -- that uses an external library for SVG exports -- might be not possible.

Regards


Le 01/03/2019 à 14:20, P M a écrit :
Hi Christophe

... I figured out that in inkscape one can combine paths...( Ctrl++ )... so that creates just one single area.
so i have a solution.

However it might be interesting to know, how Scilab fills the polygon when saving it as an svg.
To me it seems something similar to a tessalation...building triangles to fill the area.
The lines in the image are the triangle edges.

In my example the red surface is a fill of one single polygon.
Also the green area is the fill of one single polygon.

Thanks,
Philipp


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users