1

This is related to my confusion over how to combine graphics objects and geometric objects: see Affine transformation of circular arc in 3D.

Why does evaluating the Show expression below cause the error

Graphics3DBox is not a Graphics3D primitive or directive

shift = AffineTransform[{IdentityMatrix[3], {2, 0, 0}}];
circ = 
  ParametricPlot3D[shift[{Cos[t], 0, Sin[t]}], {t, 0, 2 π}, 
    PlotStyle -> Green];
rot[angle_] := RotationTransform[angle, {0, 0, 1}, {0, 0, 0}];

Show[
  Graphics3D[GeometricTransformation[circ, rot[π/2]]],
     Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0}, 
     AxesLabel -> {x, y, z}, PlotRange -> 3]
m_goldberg
  • 107,779
  • 16
  • 103
  • 257
murray
  • 11,888
  • 2
  • 26
  • 50

1 Answers1

4

The output of ParametricPlot3D is a Graphics3D object, and GeometricTransformation must receive primitives instead. So use:

Show[Graphics3D[GeometricTransformation[circ[[1]], rot[Pi/2]]],
 Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0}, 
 AxesLabel -> {x, y, z}, PlotRange -> 3]

enter image description here

A region approach would be:

circ = ParametricRegion[shift[{Cos[t],0,Sin[t]}],t];
Show[
    Region[TransformedRegion[circ, rot[Pi/2]], BaseStyle->{Thick, Green}],
    Boxed->False, Axes->True, AxesOrigin->{0,0,0}, PlotRange->3
]

enter image description here

Carl Woll
  • 130,679
  • 6
  • 243
  • 355
  • 1
    Thank you for your indulgence. I'm still bothered by the relationship between "Graphics3D objects" and "[geometric] primitives". Eventually the distinction may penetrate my obviously thick skull. (I don't think I've ever had this much trouble mapping Mathematica's language design into my mental maps.) – murray Mar 08 '19 at 22:37