Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
commands to construct paths
- Fixed a bug with `brace` and `flip: true` (#1017)
- Added a new `transform` function that multiplies a given transformation matrix with the current one (#1019)
- **BREAKING** Renamed `on-yz` to `on-zy` (#1020)

# 0.4.2
- The `tree` element now has a `anchor:` argument to position the tree (#929)
Expand Down
5 changes: 0 additions & 5 deletions docs/api/draw-functions/projections/on-yz.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions docs/api/draw-functions/projections/on-zy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import OnZY from "@site/cetz/docs/_generated/draw/projection/on-zy.mdx";

# on-zy

<OnZY />
2 changes: 1 addition & 1 deletion docs/api/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default [
"api/draw-functions/projections/ortho",
"api/draw-functions/projections/on-xy",
"api/draw-functions/projections/on-xz",
"api/draw-functions/projections/on-yz",
"api/draw-functions/projections/on-zy",
],
},
{
Expand Down
Binary file modified manual.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/draw.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
#import "draw/transformations.typ": set-transform, transform, rotate, translate, scale, set-origin, move-to, set-viewport
#import "draw/styling.typ": set-style, fill, stroke, register-mark
#import "draw/shapes.typ": circle, circle-through, arc, arc-through, mark, line, grid, content, rect, bezier, bezier-through, catmull, hobby, merge-path, polygon, compound-path, n-star, rect-around, svg-path
#import "draw/projection.typ": ortho, on-xy, on-xz, on-yz
#import "draw/projection.typ": ortho, on-xy, on-xz, on-zy
#import "draw/util.typ": assert-version, register-coordinate-resolver
10 changes: 6 additions & 4 deletions src/draw/projection.typ
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,23 @@
}, matrix.transform-rotate-x(90deg))
})

/// Draw elements on the yz-plane with optional x offset.
/// Draw elements on the zy-plane with optional x offset.
///
/// All vertices of all elements will be changed in the following way: $mat(x_"argument", y, x)$, where $x_"argument"$ is the x-value given as argument.
/// All vertices of all elements will be changed in the following way:
/// $mat(x_"argument", y, x)$, where $x_"argument"$ is the x-value given
/// as argument.
///
/// ```example
/// ortho({
/// on-yz({
/// on-zy({
/// rect((-1, -1), (1, 1))
/// })
/// })
/// ```
///
/// - x (number): X offset for all coordinates
/// - body (element): Elements to draw
#let on-yz(x: 0, body) = get-ctx(ctx => {
#let on-zy(x: 0, body) = get-ctx(ctx => {
let x = util.resolve-number(ctx, x)
scoped-transform(body, if x != 0 {
matrix.transform-translate(x, 0, 0)
Expand Down
6 changes: 3 additions & 3 deletions tests/projection-ortho/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
import draw: *
ortho({
axes(4)
on-yz({
on-zy({
checkerboard()
})
})
Expand All @@ -78,7 +78,7 @@
import draw: *
ortho(sorted: true, {
axes(4)
on-yz(x: -1, {
on-zy(x: -1, {
checkerboard()
})
on-xy(z: -1, {
Expand Down Expand Up @@ -153,7 +153,7 @@
import draw: *
ortho({
on-xz({ circle((0, 2, 2), name: "a") })
on-yz({ circle((2, 0, 0), name: "b") })
on-zy({ circle((2, 0, 0), name: "b") })
})

line("a", "b")
Expand Down
Loading