Function Repository Resource:

Graphics3DSketch

Source Notebook

Convert an ordinary Graphics3D object to a sketch-styled raster image

Contributed by: Silvia Hao

ResourceFunction["Graphics3DSketch"][expr]

converts expr to a sketch-styled raster image.

ResourceFunction["Graphics3DSketch"][expr,f]

converts expr to a sketch-styled raster image, applying f to lines that are obscured.

Details and Options

The first argument to ResourceFunction["Graphics3DSketch"] should be a Graphics3D options Lighting and AbsoluteThickness[2]}style to use for obscured lines

Examples

Out[14]=
ResourceFunction["Graphics3DSketch"][Show[{
   SphericalPlot3D[
    1, {\[Theta], 0.24 \[Pi], \[Pi]/2}, {\[Phi], 0, 1.8 \[Pi]},
    PlotStyle -> White,
    PlotPoints -> 50, Mesh -> None, BoundaryStyle -> Black]
   ,
   SphericalPlot3D[
    1, {\[Theta], 0, \[Pi]/5}, {\[Phi], \[Pi]/4, 2.1 \[Pi]},
    PlotStyle -> FaceForm[Lighter[Blue, .5], GrayLevel[.9]],
    PlotPoints -> 50, Mesh -> None, BoundaryStyle -> Black]
   ,
   Graphics3D[{FaceForm[Lighter[Pink, .8], GrayLevel[.8]], Cylinder[{{0, 0, 0}, {0, 0, .8 Cos[\[Pi]/5.]}}, Sin[\[Pi]/5.]]}]
   }
  ,
  PlotRange -> 1.2 {{-1, 1}, {-1, 1}, {0, 1}}, AxesOrigin -> {0, 0, 0}, Boxed -> False,
  SphericalRegion -> True], "DashStyle" -> {Dashing[.01], Red, AbsoluteThickness[3]}]
Out[16]=

Publisher

Silvia Hao

Version History

Related Resources

Author Notes

Graphics3DSketch is a revision of DashedGraphics3D from the Sketch-type graphics with transparency and dashed hidden lines post in the linked reference.

License Information

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant