1
$\begingroup$

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]
$\endgroup$
  • $\begingroup$ use circ[[1]] in GeometricTransformation? $\endgroup$ – kglr Mar 8 at 22:22
4
$\begingroup$

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

$\endgroup$
  • 1
    $\begingroup$ 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.) $\endgroup$ – murray Mar 8 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.