Evaluation over a (bezier) curve

Post your coolest Hexcasting creations here.

New topics are NOT for chatting or asking help, put those in the comments of a post or in a different forum.
User avatar
Cameron TNT
Posts: 7
Joined: Wed Jun 11, 2025 1:22 am

Evaluation over a (bezier) curve

Post by Cameron TNT »

This spell acts like thoths over a bezier curve (for those unfamiliar with bezier curves, imagine the pen tool in some drawing software), evaluating a given spell over a list of positions on the curve. This could be used to generate smooth curves as part of building a structure, or perhaps to smoothly animate an object moving through space. Notably like thoths this spell also copies the stack in each iteration, so the stack should be well managed.

The ravenmind is cleared by this spell, but the stack is preserved. This spell does not utilise any addons.

Points on a bezier curve are defined by a t value 0<t<1, so to evaluate multiple points on a curve this spell linearly spaces the t values over the interval [0,1]

This spell expects the stack to firstly have a payload to run over each element, and secondly a list of vectors defining the bezier curve P0 through Pn (where P0 and Pn are end points, and all other points are control points), and finally a value N which defines how many points on the curve should be evaluated (N=10 defines a list t=[0.0,0.1,0.2...1.0]) as such:
  • (Spell)
  • N
  • Points
  • Payload
  • (Any other iotas to be copied)
This spell fails for N>~150, if larger values are required the list generation part of the spell can be modified.

Notably, a fixed step in t does not neccesarily correspond to the same fixed step on the curve, and to correct this would make the spell quite unwieldy (keyword arc length parameterization), so any blockwork spells must account for overlap in rounding values, and other spells may need to account for non-linear spacing. If anyone has a method to normalise the spacing without using numerical intergration, please let me know.

One use of this spell could be to carve a curve out of a surface. This could be achived by setting up the stack as so:
qqq qaqqqqq eee Break the block on the bezier
aqqqqq Draw the points from a focus
Numerical Reflection: 0 Number of points to break (this should be ~ the number of blocks on your curve)
aqqqqq Draw the spell from a focus

If you have any queries regarding the spell feel free to ping me on discord, or PM me on the forums.

Numerical Reflection: 1aaeddwdedwNumerical Reflection: 0adeeedqqaeaaeqqqdeaqqaadadaawwqaqwwaqawedqdeeeeNumerical Reflection: 4ddadaadaadaadeaqqv-qqqNumerical Reflection: 1aaeddwddwaaeaaqqaeaaeaaeddwqaqwqqqdeaqqaaqwqaaeqqwawqaawqqqddqaawaqawaaeaaqeewdweddwwaqawwaawaawddeqqwawqaawqwaeawqaeaqaewdqdweqaeaqv-eeeaawdddadadeeeaawddaadaadaavdeaqqqwaeawqvv-aawdddeaqqeeeaawdddadadvv-

Code: Select all

Numerical Reflection: 1
Prospector's Gambit
Division Distillation
Numerical Reflection: 0
Single's Purification
Vacant Reflection
{
Hermes' Gambit
Dioscuri Gambit
Length Purification
Multiplicative Distillation
Integration Distillation
}
Numerical Reflection: 4
Fisherman's Gambit
Gemini Gambit
Hermes' Gambit
Bookkeeper's Gambit: v-
{
Numerical Reflection: 1
Prospector's Gambit
Subtractive Distillation
Rotation Gambit
Vacant Reflection
Prospector's Gambit
Length Purification
{
Hermes' Gambit
Speaker's Decomposition
Huginn's Gambit
{
Undertaker's Gambit
Multiplicative Distillation
Rotation Gambit
Muninn's Reflection
Multiplicative Distillation
Additive Distillation
Jester's Gambit
Huginn's Gambit
Flock's Reflection
Flock's Gambit
Derivation Decomposition
Bookkeeper's Gambit: v-
}
Jester's Gambit
Thoth's Gambit
}
Jester's Gambit
Gemini Gambit
Bookkeeper's Gambit: v
Hermes' Gambit
Flock's Disintegration
Bookkeeper's Gambit: vv-
Jester's Gambit
Hermes' Gambit
}
Jester's Gambit
Thoth's Gambit
Bookkeeper's Gambit: vv-
P.S.
For the minimalists out there, this version of the spell takes only a list of points defining the bezier and a single t value, and returns the resulting point on that bezier. This version assumes the stack only has these elements. This could also be used with thoths to evaluate any amount of arbritarily spaced t values, which could be useful if you wanted to pre-calculate t values to based on the inverse arc length function. To be fully honest, I myself did not expect this task to be achievable in less than 30 patterns, but here we are.
Bezier Cut
Numerical Reflection: 1aaeddwddwaaeaaqqaeaaeaaeddwqaqwqqqdeaqqaaqwqaaeqqwawqaawqqqddqaawaqawaaeaaqeewdweddwwaqawwaawaawddeqqwawqaaweeeaawdddadadeeeaawddaadaadaavdeaqqvv-

Code: Select all

Numerical Reflection: 1
Prospector's Gambit
Subtractive Distillation
Rotation Gambit
Vacant Reflection
Prospector's Gambit
Length Purification
{
Hermes' Gambit
Speaker's Decomposition
Huginn's Gambit
{
Undertaker's Gambit
Multiplicative Distillation
Rotation Gambit
Muninn's Reflection
Multiplicative Distillation
Additive Distillation
Jester's Gambit
Huginn's Gambit
}
Jester's Gambit
Thoth's Gambit
}
Jester's Gambit
Gemini Gambit
Bookkeeper's Gambit: v
Hermes' Gambit
Bookkeeper's Gambit: vv-