Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Rounded-edge textured cubes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121343] Rounded-edge textured cubes
  • From: "Christopher O. Young" <cy56 at comcast.net>
  • Date: Mon, 12 Sep 2011 04:18:30 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

I'm trying to have textured cubes to illustrate things such as the relation
of rates of change in difference tables to the rates of change of areas of
squares of squares and volumes of cubes. It would be a big help to have
rounded cubes with some texture on them. The texture is mostly for looks,
but would certainly add something. A rounded-edge option for Cuboid[ ] would
be wonderful. I'm experimenting with using tubes on the edges and moving
them inwards.

One thing that works, but might be too slow, is using RegionPlot to get an
inequality plot of each cube. Yields a nicely rounded surface, but I can't
seem to map textures to it evenly. I get "streaking" of the marble on six of
the surfaces, and only two get the normal looking marble texture.

Chris Young
cy56 at comcast.net


ineq = PolyhedronData["Cube", "RegionFunction"][x, y, z]

With[
 {r = .7},
 
 RegionPlot3D[ineq,
  
  {x, -r, r}, {y, -r, r}, {z, -r, r},
  
  PlotStyle -> Directive[
    Specularity[White, 30],
    Texture[ExampleData[{"ColorTexture", "WhiteMarble"}]]
    ],
  
  TextureCoordinateFunction -> ({#3, #2, #1} &),
  
  Lighting -> "Neutral",
  Mesh -> None,
  PlotRange -> All,
  PlotPoints -> 20
  ]
 ]





  • Prev by Date: How to do this substitution?
  • Next by Date: Re: execution model: Function vs. delayed execution
  • Previous by thread: Re: How to do this substitution?
  • Next by thread: a question about data plotting