TransWikia.com

Can HatchShading be applied to a general Graphics3D object?

Mathematica Asked by Peeter Joot on February 4, 2021

Is it possible to apply HatchShading (a new Mathematica 12 option for Plot3D and friends) to a generic Graphics3D object (for example, spheres, tubes, and arrows), such as:

a = {0, 0, 0};
b = {1, 0, 0};
c = {0, 1, 0};
Graphics3D[{
   Arrowheads[0.2]
  , Arrow[ Tube[{a, b}, 0.05]]
  , Arrow[ Tube[{a, c}, 0.05]]
  , Sphere[a, 0.2]
  }]

some 3d graphics objects

If not, how can I render such a Graphics3D object in grayscale?

One Answer

You can add the directives HatchShading[] and Lighting -> "Neutral" ("white light sources in default positions") or Lighting -> "Accent" ("a directional white light in default direction") before the graphics primitives:

Graphics3D[{Lighting -> "Neutral"
    , HatchShading[]
    , Arrowheads[0.2]
    , Arrow[ Tube[{a, b}, 0.05]]
    , Arrow[ Tube[{a, c}, 0.05]]
    , Sphere[a, 0.2]
    }, ImageSize -> Large] 

enter image description here

With Lighting -> "Accent" we get

![enter image description here

Answered by kglr on February 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP