[Tex/LaTex] TikZ semi transparent contiguous shapes with no gaps

graphicstikz-pgftransparencywolfram-mathematica

Short Question:

The short question can be stated as follows: Is there a way to perfectly align filled (but possibly not drawn) shapes that completely cover contiguous areas?

Consider the MWE:

\documentclass[tikz,crop=true,border=1pt]{standalone}
\definecolor[named]{Back}{cmyk}{0,.3,.94,0}
\definecolor[named]{Front}{cmyk}{0,1.0,.64,.34}
\tikzset{mmaF/.style={fill=Front!#1,draw=Front!#1,
    line width=.04pt,opacity=1}}
\tikzset{mmaB/.style={line width=0.01pt,fill=Back!#1,   
    draw=Back!#1,opacity=.5}}
%
\begin{document}
\begin{tikzpicture}
    \begin{scope}[transparency group]
    \draw[mmaF=50] (0,0) rectangle ++(2,2);
    \draw[mmaB=90] (1,1) rectangle ++(2,2);
    \draw[mmaB=90] (-1,-1) rectangle ++(2,2);
    \draw[mmaB=90] (-1,1) rectangle ++(2,2);
    \draw[mmaF=88] (2,-1) rectangle ++(2,2);
    \draw[mmaB=90] (1,-1) rectangle ++(2,2);            
    \end{scope}
\end{tikzpicture}
\end{document}

Which produces:

Sample tikz polygons

If you look closely, there are little doubly drawn lines over the center reddish polygon. If you change draw=Back!#1 for draw=none in style mmaB, then you get little gaps instead of doubly drawn lines.

What makes this question hard is the fact that the order of the polygons is important. I can't simply group the mmaB style polygons into a scope with opacity=.5,transparency group. The reason is explained below, in the background story.

Background Story

Using Mathematica to compute polygons, I can draw things like this:

A drawing in tikz, produced with mathematica

For the curious, this is just some 10.000+ lines of simple tikz. Mathematica computes the 3D->2D conversion, and gives an ordered collection of plane tikz shapes to be filled with either style mmaF-for front facing polygon- or mmaB-for back facing polygon.

However, I am having trouble when mixing with opacity:

This time, with some semi transparent parts

Where you can see the grid lines. Problem: how to remove the grid lines in the semi-transparent part?

Best Answer

I'm not sure to understand the question (my english :) ) I use \path instead of \draw.

\documentclass[tikz,crop=true,border=1pt]{standalone}
\definecolor[named]{Back}{cmyk}{0,.3,.94,0}
\definecolor[named]{Front}{cmyk}{0,1.0,.64,.34}
\tikzset{mmaF/.style={fill=Front!#1,opacity=1}}
\tikzset{mmaB/.style={fill=Back!#1, opacity=.5}}
%
\begin{document}
\begin{tikzpicture}
    \begin{scope}[transparency group]
    \path[mmaF=50] (0,0) rectangle ++(2,2);
    \path[mmaB=90] (1,1) rectangle ++(2,2);
    \path[mmaB=90] (-1,-1) rectangle ++(2,2);
    \path[mmaB=90] (-1,1) rectangle ++(2,2);
    \path[mmaF=88] (2,-1) rectangle ++(2,2);
    \path[mmaB=90] (1,-1) rectangle ++(2,2);            
    \end{scope}
\end{tikzpicture}
\end{document}   

enter image description here