Drawing a curve (not necessarily an arc) in tikz-3dplot
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?
tikz-pgf diagrams tikz-3dplot
add a comment |
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?
tikz-pgf diagrams tikz-3dplot
add a comment |
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?
tikz-pgf diagrams tikz-3dplot
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?
tikz-pgf diagrams tikz-3dplot
tikz-pgf diagrams tikz-3dplot
asked 13 mins ago
Jānis LazovskisJānis Lazovskis
3,3821232
3,3821232
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476860%2fdrawing-a-curve-not-necessarily-an-arc-in-tikz-3dplot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476860%2fdrawing-a-curve-not-necessarily-an-arc-in-tikz-3dplot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown