Skip to content

Commit

Permalink
Merge pull request #11 from Tnixc/master
Browse files Browse the repository at this point in the history
gradient painter + paths
  • Loading branch information
Moulberry committed Sep 20, 2023
2 parents 8f6158f + cebc9bb commit a58ebdd
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/tools/painting/gradientpainter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Gradient Painter

The **Gradient Painter** tools allows you to paint gradients using multiple blocks.

To use, click on pos1 and you will see a line appear. Click and drag to paint from pos2.

The **Mask Surface** option allows only painting blocks which are adjacent to a non-solid block.

# Planar vs Spherical Gradients

You may select the type of gradient to be either spherical or planar.

![Plane vs Sphere in gradient selection](https://cdn.discordapp.com/attachments/1012669638578020403/1153873402931724417/2023-09-19_21.46.32.png)

As you can see, for the "Plane" option, the gradient goes from pos1 to pos2 in one direction. For the "Sphere" option, The gradient radiates from pos1 to pos2, with pos2 being the radius, and pos1 being the center(i.e. starting point)

# Interpolation

You may select the type of interpolation to be used: Nearest, Linear, and Bezier. See the difference below:

In order from top to bottom: Nearest, Linear, Bezier.

![Interpolation](https://cdn.discordapp.com/attachments/1012669638578020403/1153874160502722641/2023-09-19_21.24.42.png)

Look up the curves to see how it is calculated specifically but in essence, nearest gives you hard boundaries between each block type. Linear gives a smooth transistion as the name implies, and Bezier has a more rapid change in the center, and eases in/out. The effect is more apparent with larger gradients.

# Locking

You may select between no locking, locking only pos1, and locking both pos1 and pos2.

No locking makes it so that the start and end points of the gradient change with every stroke

Locking only pos1 makes it so that the starting point of the gradient remains fixed even after you release the mouse button. However pos2 remains unfixed such that the length of the gradient can change freely.

Locking both pos1 and pos2 makes it so that the gradient's start and end points remains fixed, and you can use multiple strokes to cover the same area with the same effect.

To unlock the points select locking to "none".

# Clamp to edge

If this option is enabled, the gradient will be applied in such a way that it doesn't extend beyond pos2.
56 changes: 56 additions & 0 deletions src/tools/path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Paths

The path tool allows you create curves in 3d space using gizmos as nodes. Click on any point to create a gizmo. It will be automatically selected. Click `ctrl + z` or the undo keybind to remove the currently selected gizmo.

# Curve types

You may select from Linear(Bresenham), Linear(DDA), Catenary, Catmull-Rom Spline, and Bezier curve.

# Linear(Bresenham)

This creates a straight line from node to node. Diagonal blocks are not filled in. You cannot change the radius.

![Linear(Bresenham)](https://imagedelivery.net/W9K_l6ndK9x4x8m3rurakg/5fd8e02b-0698-453c-8f90-cbd716807d00/original)

# Linear(DDA)

This also creates a straight line from node to node. The diagonal blocks are filled in. You may change the radius.
![Linear(DDA)](https://imagedelivery.net/W9K_l6ndK9x4x8m3rurakg/b9d88f87-5f1a-4e87-deb1-60a6485e1300/original)

# Catenary

This creates a line which has some slack. It dangles down from node to node. The diagonal blocks are filled in. You may change the radius.

There are two more parameters for this curve. You may invert it such that it is flipped upside down. You may also adjust the slack, a 0% slack is a straight line.

![Catenary](https://imagedelivery.net/W9K_l6ndK9x4x8m3rurakg/90849c39-9774-4ad7-377a-efed21509400/original)

# Catmull-Rom Spline
This type of spline is particularly useful for creating smooth paths. The spline passes through every node. The spline is also continuously smoothed between nodes evenly*.

![Catmull-Rom Spline](https://imagedelivery.net/W9K_l6ndK9x4x8m3rurakg/d2b12da7-3514-4be9-6ba1-3ae1d589d900/original)

# Bezier Curve

A Bezier curve is formed by specifying a set of nodess that influence the shape of the curve. The curve starts at the first nodes, ends at the last node, and is influenced by the positions of the intermediate control points. The curve smoothly interpolates between the control points. The curve does NOT pass through all the nodes. The nodes other than the start and end nodes affect how the curve is shaped.
[Read more here](https://www.wikiwand.com/en/B%C3%A9zier_curve)

![Bezier Curve](https://imagedelivery.net/W9K_l6ndK9x4x8m3rurakg/24a41357-17ef-4403-8ecd-6994d06cad00/original)

# Additional curve options

Looped: When enabled, this connects the first and last nodes, forming a loop.

# Node specific options

**Overried Block**

This option allows you to override the block for that node. It forms a gradient between the connected node(s). If this option is not enabled, the active block is used by default, forming a gradient with that block.

**Override Radius**

This option allows you to override the radius for that node. When enabled, the radius will smoothly transition between each node, allowing you to create curves with changes in thickness.

**Catmull-Rom Spline Easing**

You may select between Linear, Slight, Quadratic, Cubic, or Quartic easing. Each easing looks different. This only affects the easing of the selected node.

0 comments on commit a58ebdd

Please sign in to comment.