Page MenuHome

Geometry Nodes: Add Loose Ends mode to Curve Trim node.
Needs ReviewPublic

Authored by Charlie Jolly (charlie) on Jan 5 2022, 2:46 AM.
Tokens
"Like" token, awarded by duarteframos."Love" token, awarded by D0ppelgaenger."Love" token, awarded by cmzw."Love" token, awarded by wilBr.

Details

Summary

This mode trims the loose ends from a curve.

Adapted from GP trim stroke operator, this removes loose ends from a curve.

Use case: When drawing paths this helps tidy up the loose ends.

Imagine drawing a fence with a curve and you don't want the ends to overlap.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 19765
Build 19765: arc lint + arc unit

Event Timeline

Charlie Jolly (charlie) requested review of this revision.Jan 5 2022, 2:46 AM
Charlie Jolly (charlie) created this revision.
Charlie Jolly (charlie) edited the summary of this revision. (Show Details)Jan 5 2022, 2:47 AM
Charlie Jolly (charlie) edited the summary of this revision. (Show Details)
Charlie Jolly (charlie) edited the summary of this revision. (Show Details)Jan 5 2022, 11:04 AM

Fix UI to use drop down menu.

Charlie Jolly (charlie) edited the summary of this revision. (Show Details)Jan 14 2022, 2:01 AM

This is an interesting idea, but maybe it's better to generalize the behavior, for example to retrieve a factor on each spline that it intersects itself. Then again, the fact that a spline can intersect itself multiple times does complicate things. Either way, I just have a feeling that this feature is a little too specific. But I guess it is useful, especially if you want to fill a freehand drawing maybe.

This is an interesting idea, but maybe it's better to generalize the behavior, for example to retrieve a factor on each spline that it intersects itself. Then again, the fact that a spline can intersect itself multiple times does complicate things. Either way, I just have a feeling that this feature is a little too specific. But I guess it is useful, especially if you want to fill a freehand drawing maybe.

I thought about generalizing it but the main use case is to tidy up hand drawn curves which this does non-destructively. Curve Trim node seems a logical place for it unless there was a Curve Tidy node that had this and other ops like Join Ends.

Your idea for outputting intersections should be a different node. A Curve Intersection node would provide a list of points of all intersections for connected Curves.

Rebase to master after changes to curves api.

Charlie Jolly (charlie) updated this revision to Diff 54098.EditedJul 27 2022, 3:06 PM

Renamed mode from Intersection to Loose Ends.

Charlie Jolly (charlie) retitled this revision from Geometry Nodes: Add Intersection mode to Curve Trim node. to Geometry Nodes: Add Loose Ends mode to Curve Trim node..Jul 27 2022, 3:09 PM
Charlie Jolly (charlie) edited the summary of this revision. (Show Details)
Charlie Jolly (charlie) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) requested changes to this revision.Oct 12 2022, 8:17 PM

I wonder if a generalization of this node would be as a combination of the "Curve Intersections" node and the "Trim Curves" node.
If the trim curve node could use the output of the curve intersection node to find trim points, all the functionality would be reusable and more powerful.
I'm not sure what data would have to pass between the nodes, but it seems theoretically possible?

Either way, CurveEval has been removed, so this would have to use the new curves type and the new trim implementation.

This revision now requires changes to proceed.Oct 12 2022, 8:17 PM

Update and rebase to use new curve types. This caculates the loose
intersections then trims the curve.

This doesn't move the start and end points after trimming like the previous code
and relies on the trim function solely.

Added curve function evaluated_positions_for_curve as this is required for
the intersection function.

There maybe some logic to have this part of a curve intersections node but
that probably needs some design work still.

Update evaluated_positions_for_curve function to match D15624