Skip to content

Plot circle in 3d space #749

Answered by platypus999
platypus999 asked this question in Q&A
Discussion options

You must be logged in to vote

Upon further research (and trial-and-error), the easiest way I could find to plot an unslanted circle in the ortho environment was to put the circle in another cetz.canvas, and encapsulate it with content.

So instead of circle(coordinate, ...), I will do content(coordinate, [#cetz.canvas({circle((), ...)})]).
This will work with any shape (or combination of shapes that can be contained in a canvas).

I will mark this question as answered, but any further insights / better implementation suggestions are welcome!

#cetz.canvas({
  import cetz.draw: *
  ortho(x: 20deg, y: 30deg, {
    on-xz({
      grid((0, 0), (5.5, 5.5), step: 1.0, stroke: gray + 0.2pt)
      line((0, 0), (0, 5.5), mark: (en…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@johannes-wolf
Comment options

Answer selected by platypus999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants