Skip to content

Commit 0a3d3bb

Browse files
committed
PR Fixes
1 parent 1eadadf commit 0a3d3bb

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/draw/projection.typ

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
(0, 0, 0, 1),
2222
)
2323

24-
// Sort drawables by median or max segment z-value
2524
#let _sort-by-distance(drawables) = {
2625
return drawables.sorted(key: d => {
2726
let z = none
@@ -54,7 +53,7 @@
5453
// - projection-matrix (matrix): Projection matrix
5554
// - reset-transform (bool): Ignore the current transformation matrix
5655
// - sorted (bool): Sort drawables by maximum distance (front to back)
57-
// - cull-face (none,string): Enable back-face culling if set to `"cw"` for clockwise
56+
// - cull-face (none,str): Enable back-face culling if set to `"cw"` for clockwise
5857
// or `"ccw"` for counter-clockwise. Polygons of the specified order will not get drawn.
5958
#let _projection(body, view-matrix, projection-matrix, reset-transform: true, sorted: true, cull-face: "cw") = {
6059
(ctx => {
@@ -122,7 +121,7 @@
122121
/// - y (angle): Y-axis rotation angle
123122
/// - z (angle): Z-axis rotation angle
124123
/// - sorted (bool): Sort drawables by maximum distance (front to back)
125-
/// - cull-face (none,string): Enable back-face culling if set to `"cw"` for clockwise
124+
/// - cull-face (none,str): Enable back-face culling if set to `"cw"` for clockwise
126125
/// or `"ccw"` for counter-clockwise. Polygons of the specified order will not get drawn.
127126
/// - reset-transform (bool): Ignore the current transformation matrix
128127
/// - body (element): Elements to draw

src/polygon.typ

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
///
44
/// Cubic segments get linearized by sampling.
55
///
6-
/// - segment (list): List of segments
6+
/// - segment (array): List of segments
77
/// - samples (int): Number of samples
8-
/// -> List of vectors
8+
/// -> array
99
#let from-segments(segments, samples: 10) = {
1010
import "/src/bezier.typ": cubic-point
1111
let poly = ()
@@ -24,10 +24,10 @@
2424
/// Computes the signed area of a 2D polygon.
2525
///
2626
/// The formula used is the following:
27-
/// $ 1/2 sum_i=0^n-1 x_i*y_i+1 - x_i+1*y_i $
27+
/// $ 1/2 \sum_{i}=0^{n-1} x_i*y_i+1 - x_i+1*y_i $
2828
///
29-
/// - points (list): List of Vectors of dimension >= 2
30-
/// -> Signed area
29+
/// - points (array): List of Vectors of dimension >= 2
30+
/// -> float
3131
#let signed-area(points) = {
3232
let a = 0
3333
let n = points.len()
@@ -45,8 +45,10 @@
4545
/// Returns the winding order of a 2D polygon
4646
/// by using it's signed area.
4747
///
48-
/// - point (list): List of polygon points
49-
/// -> "ccw" (counter clock-wise) or "cw" (clock-wise) or none
48+
/// Returns either "ccw" (counter clock-wise) or "cw" (clock-wise) or none.
49+
///
50+
/// - point (array): List of polygon points
51+
/// -> str,none
5052
#let winding-order(points) = {
5153
let area = signed-area(points)
5254
if area > 0 {

0 commit comments

Comments
 (0)