I'm trying to draw a curve in tikz-3dplot
that isn't the arc of a circle. I would like for it to specified by control points, similar to how tikz
has (0,0) to [controls=+(45:1) and +(135:1)] (1,0)
. I know I can draw an arc of a circle, with \tdplotdrawpolytopearc
, but I couldn't find anything in the documentation about how to draw any other type of curve. If I use the same syntax as for 2D curves, it seems a default plane is chosen in which the control points act (seems like the xy-plane). Maybe there's a way to choose that plane (and change it for every point)?
Here's a MWE and output for what I have:
\documentclass[tikz]{standalone}
\usepackage{tikz,tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{75}{130}
\begin{tikzpicture}[tdplot_main_coords]
% Shape and boundary
\draw[blue] (0,0,0)--(-1,1,0);
\fill[green,fill opacity=.8] (0,0,0)--(0,1,0)--(-1,1,0)--(-1,1,1)--(0,0,1);
\draw[blue] (0,0,0)--(0,1,0)--(-1,1,0)--(-1,1,1)--(0,1,1)--(0,0,1)--(0,0,0);
\draw[blue] (0,0,1)--(-1,1,1) (0,1,0)--(0,1,1);
% Natural guess how to draw curve
\draw[red] (0,0,0) to [controls=+(45:1) and +(135:1)] (0,1,0);
% Closest documented way how to draw curve
\tdplotdefinepoints(0,.5,-.3)(0,-.5,.3)(0,1.5,.3)
\tdplotdrawpolytopearc{.583}{}{}
\end{tikzpicture}
\end{document}
I would like to draw a curve on the "face" of this prism that's facing left, like the black curve, but with more "strength" at the end points (like a sine curve). The failed attempt is the red curve that seems to be in the plane of the "bottom" face of the prism.
So, my question is: How can I draw a curve in 3D that is not the arc of a circle?