How can I use hobby-to-cubic from the API in CetZ?

I would like to use the hobby-to-cubic function mentioned in the CetZ documentation here.

Various LLMs suggest using code like the following with cetz.hobby.hobby-to-cubic:

#import "@preview/cetz:0.5.0"

#let my-points = ((0, 0), (1, 2), (2, 0))
// Calling the function to get Bézier segments
#let segments = cetz.hobby.hobby-to-cubic(
my-points, 
close: true
)

However, I just get the error message that:

module `cetz` does not contain `hobby`

In the absence of documented examples of how to use functions from the API, it is hard to know how to proceed, hence my question in this forum.

The function hobby.hobby-to-cubic is private API and not exposed to consuming packages.

If you want to draw a hobby-curve, use cetz.draw.hobby(...).

Thanks for the quick reply! It’s strange to see it in the manual given that it is an internal-only function and not available for use.

However, I should say the actual goal I had was in calculating the outer bounds of the hobby curve that I had created in order to have a grid that it completely fits inside.

Because a hobby curve can go outside the boundaries of the control points, it’s not just a matter of calculating the minimum and maximum values of the points provided to the hobby function.