1.5.2 Commands and macros linked with colors

Exemple(s): Each facet is coloured according to the rating of the center of gravity. The color is added thanks to the ColorJump macro in the jump ending facet constant. The Hsb macro is made for continuously varying the color. Before drawing the surface, the facets are sorted using the SortFacet command, then are drawn.



  \begin{texgraph}[name=ColorJump, export=pgf]
  view(-6.5,6,-6.5,5.5),
  Marges(0,0,0,0),size(7.5),
  view3D(-3,3,-3,3,-3,3),ModelView(central),
  S:=GetSurface([u+i*v,2*sin(u)+cos(v)],
                 -3+3*i,-3+3*i),
  stock:=for facette in S By jump do
     z:=Zde(isobar3d(facette)),
     facette,
     ColorJump(Hsb(270*(Zsup-z)/(Zsup-Zinf),1,1))
          od,
  FillStyle:=full, LabelSize:=footnotesize,
  BoxAxes3D(grid:=1, FillColor:=lightblue),
  Ligne3D(SortFacet(stock),1)
  \end{texgraph}

 PIC



Heat type colouring