Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1036 > unrolled thread

shfil

Started byCecil Westerhof <Cecil@decebal.nl>
First post2012-11-11 11:30 +0100
Last post2012-11-16 18:29 -0600
Articles 10 — 6 participants

Back to article view | Back to comp.lang.postscript


Contents

  shfil Cecil Westerhof <Cecil@decebal.nl> - 2012-11-11 11:30 +0100
    Re: shfil "abeddie@hotmail.com" <abeddie@hotmail.com> - 2012-11-13 07:50 -0800
      Re: shfil Cecil Westerhof <Cecil@decebal.nl> - 2012-11-13 17:56 +0100
        Re: shfil "abeddie@hotmail.com" <abeddie@hotmail.com> - 2012-11-13 10:12 -0800
          Re: shfil Cecil Westerhof <Cecil@decebal.nl> - 2012-11-13 20:10 +0100
        Re: shfil Ross Presser <rpresser@gmail.com> - 2012-11-13 11:05 -0800
          Re: shfil Herbert Voss <Herbert.Voss@alumni.tu-berlin.de> - 2012-11-13 21:24 +0100
            Re: shfil Ross Presser <rpresser@gmail.com> - 2012-11-13 21:43 -0800
    Re: shfil John Deubert <john@acumentraining.com> - 2012-11-15 09:28 -0800
    Re: shfil "luser.droog" <luser.droog@gmail.com> - 2012-11-16 18:29 -0600

#1036 — shfil

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-11-11 11:30 +0100
Subjectshfil
Message-ID<87vcdcl9dg.fsf@Compaq.site.inet>
I found the shfill command with I can create gradients. Is there a good
resource to get started? I could not find something that explains and show the
things in layman's terms.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#1040

From"abeddie@hotmail.com" <abeddie@hotmail.com>
Date2012-11-13 07:50 -0800
Message-ID<705855b4-e077-47fc-a9a6-01d848283e00@googlegroups.com>
In reply to#1036
On Sunday, November 11, 2012 5:39:13 AM UTC-5, Cecil Westerhof wrote:
> I found the shfill command with I can create gradients. Is there a good
> 
> resource to get started? I could not find something that explains and show the
> 
> things in layman's terms.
> 
> 
> 
> -- 
> 
> Cecil Westerhof
> 
> Senior Software Engineer
> 
> LinkedIn: http://www.linkedin.com/in/cecilwesterhof

%!
100 400 300 200 rectclip
<<
  /ShadingType 2
  /ColorSpace [ /DeviceRGB ]
  /Coords [100 400 400 600 ]
  /Function
  <<
    /FunctionType 2
    /Domain [ 0 1 ]
    /C0 [ 1 0 0 ]
    /C1 [ .5 1 .5 ]
    /N 1
  >>
>>
shfill
showpage

[toc] | [prev] | [next] | [standalone]


#1041

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-11-13 17:56 +0100
Message-ID<878va5jvb8.fsf@Compaq.site.inet>
In reply to#1040
Op dinsdag 13 nov 2012 16:50 CET schreef abeddie@hotmail.com:

>> I found the shfill command with I can create gradients. Is there a good
>>
>> resource to get started? I could not find something that explains and show the
>>
>> things in layman's terms.
>>
>
> %!
> 100 400 300 200 rectclip
> <<
> /ShadingType 2
> /ColorSpace [ /DeviceRGB ]
> /Coords [100 400 400 600 ]
> /Function
> <<
> /FunctionType 2
> /Domain [ 0 1 ]
> /C0 [ 1 0 0 ]
> /C1 [ .5 1 .5 ]
> /N 1
>>>
>>>
> shfill
> showpage

That is exactly what I found and use. But there should be more
functions (otherwise FunctionType would be redundant). I would like an
explanation about those, but I can not find it.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#1042

From"abeddie@hotmail.com" <abeddie@hotmail.com>
Date2012-11-13 10:12 -0800
Message-ID<4a39887d-ecff-4a75-a503-4176a836aba9@googlegroups.com>
In reply to#1041
On Tuesday, November 13, 2012 11:59:13 AM UTC-5, Cecil Westerhof wrote:
> Op dinsdag 13 nov 2012 16:50 CET schreef abeddie:
> 
> 
> 
> >> I found the shfill command with I can create gradients. Is there a good
> 
> >>
> 
> >> resource to get started? I could not find something that explains and show the
> 
> >>
> 
> >> things in layman's terms.
> 
> >>
> 
> >
> 
> > %!
> 
> > 100 400 300 200 rectclip
> 
> > <<
> 
> > /ShadingType 2
> 
> > /ColorSpace [ /DeviceRGB ]
> 
> > /Coords [100 400 400 600 ]
> 
> > /Function
> 
> > <<
> 
> > /FunctionType 2
> 
> > /Domain [ 0 1 ]
> 
> > /C0 [ 1 0 0 ]
> 
> > /C1 [ .5 1 .5 ]
> 
> > /N 1
> 
> >>>
> 
> >>>
> 
> > shfill
> 
> > showpage
> 
> 
> 
> That is exactly what I found and use. But there should be more
> 
> functions (otherwise FunctionType would be redundant). I would like an
> 
> explanation about those, but I can not find it.
> 
> 
> 
> -- 
> 
> Cecil Westerhof
> 
> Senior Software Engineer
> 
> LinkedIn: http://www.linkedin.com/in/cecilwesterhof

The sample and some instructions are from Adobe Technical Note 5600 Smooth Shading.

[toc] | [prev] | [next] | [standalone]


#1044

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-11-13 20:10 +0100
Message-ID<87vcd9iaj4.fsf@Compaq.site.inet>
In reply to#1042
Op dinsdag 13 nov 2012 19:12 CET schreef abeddie@hotmail.com:

> The sample and some instructions are from Adobe Technical Note 5600 Smooth
> 	Shading.

Found it. Thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#1043

FromRoss Presser <rpresser@gmail.com>
Date2012-11-13 11:05 -0800
Message-ID<ec7292cf-50b5-46ad-bca6-24e859c0f85c@googlegroups.com>
In reply to#1041
On Tuesday, November 13, 2012 11:59:13 AM UTC-5, Cecil Westerhof wrote:

> That is exactly what I found and use. But there should be more
> functions (otherwise FunctionType would be redundant). I would like an
> explanation about those, but I can not find it.

I couldn't find any explanation, but I did find an example using 
/Functiontype 3

http://sourceforge.net/p/cdk/cdknews/ci/a9a40286037ea138286fe6fd65db2826637aed2b/tree/CDKlogo.eps

[toc] | [prev] | [next] | [standalone]


#1045

FromHerbert Voss <Herbert.Voss@alumni.tu-berlin.de>
Date2012-11-13 21:24 +0100
Message-ID<agfokhFa57fU1@mid.uni-berlin.de>
In reply to#1043
Am 13.11.2012 20:05, schrieb Ross Presser:
> On Tuesday, November 13, 2012 11:59:13 AM UTC-5, Cecil Westerhof wrote:
>
>> That is exactly what I found and use. But there should be more
>> functions (otherwise FunctionType would be redundant). I would like an
>> explanation about those, but I can not find it.
>
> I couldn't find any explanation, but I did find an example using
> /Functiontype 3

and one for type 4, also available with PSTricks:

%!PS-Adobe-2.0
%%BoundingBox 0 0 285 285
%
/ED { exch def } bind def
/GTriangle {
   gsave
   /mtrx matrix currentmatrix def
   /colorA ED /colorB ED /colorC ED 	% save the colors
   /yA ED /xA ED               		% save the origin
   xA yA translate
   rotate       		        	% \psk@gangle
   /yB ED /xB ED /yC ED /xC ED   	% save other coordinates
   /ds [                % save data in a array
      0 0 0 colorA aload pop     	% fd x y xr xg xb
      0 xB xA sub yB yA sub colorB aload pop
      0 xC xA sub yC yA sub colorC aload pop
%     1 xC xB add yB colorA aload pop  	% for use with 4 points ABCD
   ] def
   newpath
   <<
   /ShadingType 4           % single Gouraud
   /ColorSpace [ /DeviceRGB ]
   /DataSource ds
   >>
   shfill
   closepath
   mtrx
   setmatrix grestore} def

284.52744 0.0 142.26372 284.52744 0. 0.0 0.0
[ 0 0 1]
[ 0 1 0]
[ 1 0 0]
GTriangle
stroke


Herbert

[toc] | [prev] | [next] | [standalone]


#1046

FromRoss Presser <rpresser@gmail.com>
Date2012-11-13 21:43 -0800
Message-ID<6ff391b6-acf0-4296-8be8-0b2f8b4091dc@googlegroups.com>
In reply to#1045
On Tuesday, November 13, 2012 3:24:50 PM UTC-5, Herbert Voss wrote:

> and one for type 4, also available with PSTricks:

Herbert, that uses /ShadingType 4 and no /Function at all.

[toc] | [prev] | [next] | [standalone]


#1047

FromJohn Deubert <john@acumentraining.com>
Date2012-11-15 09:28 -0800
Message-ID<2012111509284883551-john@acumentrainingcom>
In reply to#1036
On 2012-11-11 10:30:35 +0000, Cecil Westerhof said:

> I found the shfill command with I can create gradients. Is there a good
> resource to get started? I could not find something that explains and show the
> things in layman's terms.

There's a very old Acumen Journal article, "A Taste of Smooth Shading," 
that you might find helpful. It's the November 2000 issue (issue number 
1!), free for the downloading at

	www.acumentraining.com/acumenjournal.html.

Hope that helps.

- J
-- 
========
John Deubert
Acumen Training
PostScript & PDF Engineering Classes & Consulting
www.acumentraining.com

Learn PostScript programming techniques
Read the free Acumen Journal
acumentraining.com/acumenjournal.html

[toc] | [prev] | [next] | [standalone]


#1050

From"luser.droog" <luser.droog@gmail.com>
Date2012-11-16 18:29 -0600
Message-ID<k86lot$erj$1@dont-email.me>
In reply to#1036
Cecil Westerhof wrote:

> I found the shfill command with I can create gradients. Is there a good
> resource to get started? I could not find something that explains and show
> the things in layman's terms.
> 

There's some information about shading in Bill Casselman's Mathematical
Illustrations, ch. 14. He talks about Type 4 (free-form Gouraud) and Type 6
(Coons patch meshes).

The function is often implicit for the Type. The behavior is entirely
determined by the parameters and the data. Otherwise you could do it the
old way by "Riemannian" approximation: iterated over itty-bitty rectangles
and calculate the color for each one. But that tends to mess up
your "device-independence" depending on the grain of the approximation (the
dx and dy).

Interpolation is Calculus.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web