error with "fill style" Attribute

6 views
Skip to first unread message

Vice Ice

unread,
Jun 14, 2009, 2:09:15 PM6/14/09
to Sketch Users
See sample below. The polygon with style triangle ist devided to to
tikz filldraw and 2 draw commands. the draw commands are missing my
line style, so the borders are black. but they should be red.

%----------------------------------------------------------------------------------------------
def viewpoint (2,-0.5,1)
def lookat (0, 0, 0)
def upvector [0,0,1]

def pt0 (0,0,1)
def pt1 (1,0,1)
def pt2 (1,1,2)

def d0 (0,0,1.5)
def d1 (1,0,1.5)
def d2 (1,1,1.5)

special | \tikzstyle{prisma} = [fill=blue!70,draw=blue,fill
opacity=0.3,line width=.3pt] | [lay=under]
special | \tikzstyle{triangle} = [fill=red!70,draw=red,fill
opacity=0.3,line width=.3pt] | [lay=under]

def scene {
polygon [fill style=prisma] (pt0) (pt1) (pt2)
polygon [fill style=triangle] (d0) (d1) (d2)
}

put { view ((viewpoint),(lookat),[upvector]) } {scene}

global { language tikz }

Kjell Magne Fauske

unread,
Jun 14, 2009, 2:29:46 PM6/14/09
to sketch...@googlegroups.com


I have not checked how the generated code looks like, but the problem
is probably that the draw commands overwrite the fill styles. The
correct way to do this is to use the 'line style' attribute:

def scene {
polygon [fill style=prisma, line style=something] (pt0) (pt1) (pt2)
polygon [fill style=triangle, line style=something] (d0) (d1) (d2)
}

If you look at the generated code you will probably see why your
original code does not work.

- Kjell Magne

Vice Ice

unread,
Jun 14, 2009, 2:33:45 PM6/14/09
to Sketch Users
Ok, thanks. I will try it.

On 14 Jun., 20:29, Kjell Magne Fauske <kjel...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages