Page MenuHome

Geometry Nodes: Trim Curves with Cyclic Curves
AbandonedPublic

Authored by Johnny Matthews (guitargeek) on Oct 20 2021, 5:00 PM.

Details

Summary

Turn off cyclic if either mode is currently trimming so that the node works
with cyclic curves.

T91936

Diff Detail

Repository
rB Blender
Branch
trimc (branched from master)
Build Status
Buildable 18049
Build 18049: arc lint + arc unit

Event Timeline

Johnny Matthews (guitargeek) requested review of this revision.Oct 20 2021, 5:00 PM
Johnny Matthews (guitargeek) created this revision.
Hans Goudey (HooglyBoogly) requested changes to this revision.Oct 20 2021, 5:08 PM

Unfortunately I don't think it's quite this simple, since the trimming should also consider the cyclic portion of the curve between the last and first points.
For example, on a cyclic quadrilateral input, input factors 0.8-0.9 should give a spline that is in between the last and first point.

This revision now requires changes to proceed.Oct 20 2021, 5:08 PM

Unfortunately I don't think it's quite this simple, since the trimming should also consider the cyclic portion of the curve between the last and first points.
For example, on a cyclic quadrilateral input, input factors 0.8-0.9 should give a spline that is in between the last and first point.

Good point, that's a lot harder...

  • Add the first point as an endpoint when trimming cyclic

While adding a point to the end of the spline is a valid solution, it also has the downside that the spline will need to be re-evaluated if it is already evaluated. While that's totally fine for curves without many points, it's probably bad enough for large ones that I would like to avoid it.

So, I think I'll push a little more for a solution that changes the logic of the trim_bezier_spline, trim_poly_spline, etc. functions. For Poly splines I'd guess that it wouldn't be too bad. Beziers would probably be a bit more complicated, but still seems doable, and NURBS is just the same thing as Poly but a little bit different.

Hans Goudey (HooglyBoogly) requested changes to this revision.Oct 21 2021, 3:52 AM
This revision now requires changes to proceed.Oct 21 2021, 3:52 AM

D14481 adds support for cyclic curves, I'll close this patch in favor of that.