Page MenuHome

Geometry Nodes: Curve Support Implementation
Closed, ResolvedPublicTO DO

Authored By
Hans Goudey (HooglyBoogly)
Apr 6 2021, 7:17 PM
Tokens
"Love" token, awarded by Astronet."Love" token, awarded by PrettyFireNOI7."Love" token, awarded by monio."Like" token, awarded by jmargaud."Love" token, awarded by duarteframos."Love" token, awarded by wilBr."Love" token, awarded by damian."Like" token, awarded by GeorgiaPacific."Love" token, awarded by lone_noel."Love" token, awarded by someuser."Love" token, awarded by victorlouis."Love" token, awarded by Erindale."Love" token, awarded by TimBrown.

Description

Currently I'm just treating this as a personal project, but I thought it would be nice to have some public place to track progress.

Initial Design: https://wiki.blender.org/wiki/Modules/Physics_Nodes/Projects/EverythingNodes/CurveNodes

  • Basic design for data structures
  • Conversion from DNA Curve struct
    • Bezier
    • NURBS
    • Poly
  • Spline attributes
    • Cyclic
    • Length
    • Resolution
  • Spline evaluation
    • Position calculation
      • Bezier
      • NURBS
      • Poly
    • Tangents
    • Normals
      • Z-up method
      • Minimum twist method
      • Tangent method
      • Apply tilts to evaluated normals
    • Evaluate control point indices and interpolation factors
    • Different interpolation settings for Bezier curves
  • Curve to Mesh node (Extrude profile)
    • Extrude single vertex
    • Extrude another spline
    • Set edge sharp flag based on sharp control points
    • Use evaluated spline radius
    • Fill Caps option
    • Add UV data
    • Copy attribute data
  • 2D Curve to Mesh node
    • Investigate different triangulation methods
    • Implement flat mesh generation
  • Resample curve node
    • Add generic constant length curve evaluation
  • Trim Curve node
    • Bezier support
    • Fix bezier handles
    • Poly support
    • Figure out how to deal with NURBS
  • Bezier auto handle recalculation
  • Curve profile primitive node
    • Conversion from CurveProfile to CurveEval
    • Add a "Cyclic" option
    • Option to draw without fill unless cyclic
  • Builtin point attributes
    • Position
    • Radius
    • Tilt
    • Bezier Handles
    • NURBS weight
  • Curve Deform node
    • Figure out how to deal with extrapolation
    • Generic curve non-even sampling code
    • Build deformation on top of sampling code
  • Change Direction node
  • Curve modifier stack changes
  • Refactor to storing arrays separately
  • Refactor to speed up poly splines
  • Add support for generic attributes
    • Support in attribute nodes
    • Join attribute when joining curves
    • Support in curve nodes, create APIs, etc.
    • Interpolation between point and spline domain
  • Add instancing directly on evaluated points
  • Curve from Edges node
  • Curve end points node
  • Figure out design for curvature and length parameter attribute/data
  • Implement length parameter data
  • Implement curvature data

Event Timeline

Hans Goudey (HooglyBoogly) changed the task status from Needs Triage to Confirmed.Apr 6 2021, 7:17 PM
Hans Goudey (HooglyBoogly) created this task.
Hans Goudey (HooglyBoogly) renamed this task from Curve Support Implementation to Geometry Nodes: Curve Support Implementation.Apr 6 2021, 7:20 PM
Hans Goudey (HooglyBoogly) updated the task description. (Show Details)
Hans Goudey (HooglyBoogly) updated the task description. (Show Details)

One thing that I would love to see included in the curve support is the option for natural parameterisation of specifically beziers. This lets you get even spacing along the curve which is a huge bonus when using curves for modelling tasks like positioning lamp posts or pillars or flights of stairs etc.

Hi Hans, lots of great stuff already implemented, good job! Here are my findings.

  • it feels bit weird that to make a road body(extrude profile along curve) I have to create a vertical line(BezierCurve1), I'd expect something like BezierCurve2


  • it seems to me that trimming currently just offsets first(or last) control point along the curve, see the effect here

I noticed you've got a convert curve to mesh modifier/node planned and I was wondering if there is anything planned to go in opposite direction from a mesh to a curve? Having something like that would make it a lot easier to non-destructively create railings and pipes so you can very easily edit their shape on the fly.

Essentially what I want to be able to do is something like this:


I want to just be able to just use the first mesh, add a vertex bevel modifier to it and then convert it to a curve (via a modifier) to extrude a pipe/railing from it. We can do this with current tools but it has to be done destructively, so if I wanted to change things up (add more kinks or do different angles) it's more difficult that it should be. Alternatively you could use the skin modifier to do it non-destructively but doing this adds a lot of unneeded geometry you don't want (especially if you do game modeling), it can also only do roundish profiles properly and it's generally just less precise.

@Robin Karlsson (Nauss) Have you seen the mesh to curve node in the alpha version of 3.0? I'd also like to support bevel/fillet directly on curves at some point though.

@Hans Goudey (HooglyBoogly) Thanks, Hans! I had not seen that as I've not used 3.0 at all until just now. It seems to do pretty much exactly what I needed, it just seems a little bit bugged at the moment.

I've not used geometry nodes in the past so it's very possible that I'm doing something wrong and I know Blender 3.0 is just in alpha, but I'm getting this kind of bugged looking result right now:


This is just with a beziercircle as the profile curve. I also tried using an attribute fill on the curves depth but I couldn't get it to work (probably missing something).

I can upload the blendfile if that'd help.

@Hans Goudey (HooglyBoogly) Thanks, Hans! I had not seen that as I've not used 3.0 at all until just now. It seems to do pretty much exactly what I needed, it just seems a little bit bugged at the moment.

I've not used geometry nodes in the past so it's very possible that I'm doing something wrong and I know Blender 3.0 is just in alpha, but I'm getting this kind of bugged looking result right now:


This is just with a beziercircle as the profile curve. I also tried using an attribute fill on the curves depth but I couldn't get it to work (probably missing something).

I can upload the blendfile if that'd help.

As far as I know this is not a bug. I just discussed this with my friends a few days ago. The conclusion was that this is because geometry nodes currently only supports z-up method for the normal, (as you can see in the main post of this page, under the normal category). So until the other two methods being implemented, we could only use some hacks to work around it.

It is a bug actually, since the existing Z up method for curves doesn't have this problem. Should be a simple fix hopefully. I just need to get to it. Thanks for sharing.

Zijun Zhou (Eary) added a comment.EditedJun 7 2021, 7:15 AM

It is a bug actually, since the existing Z up method for curves doesn't have this problem. Should be a simple fix hopefully. I just need to get to it. Thanks for sharing.

Oh it is? This is good news! And.. I need to talk to my friends about this.

Zijun Zhou (Eary) added a comment.EditedJun 7 2021, 7:41 AM

since the existing Z up method for curves doesn't have this problem.

Hmm I just tried it out using regular curves, and it some how also has the problem?

@Hans Goudey (HooglyBoogly) That's good to know! Thanks for looking into it, Hans!

@Zijun Zhou (Eary) I tried doing that curve manually again in both Blender 2.93 and 3.0 and it's working in both of them for me for some reason, just not when trying it with geometry nodes.

@Zijun Zhou (Eary) I tried doing that curve manually again in both Blender 2.93 and 3.0 and it's working in both of them for me for some reason, just not when trying it with geometry nodes.

Make sure to set the twist method to z-up, then I think you should see it @Robin Karlsson (Nauss)


@Zijun Zhou (Eary) Thanks for the clarification! I'm seeing the same problem now, just missed the twist setting.

I dreaming of attribute that shows point position on a curve (length), many in percents.

Hmm I just tried it out using regular curves, and it some how also has the problem?

Ah, sorry, I should have clarified. Because it's Z-up normal there will always be an artifact when is passes through horizontal. But there was a bug when a spline was completely vertical that is fixed now. (Thanks Jacques!)

I dreaming of attribute that shows point position on a curve (length), many in percents.

I am too! The issue is this sort of only makes sense for poly splines, maybe for bezier splines too (definitely not NURBS), and I would like to at least aim to have a goal of consistency between them.
But maybe the limitation is fine. I'll keep this in mind.

This task is mostly finished, so I'll close it in favor of more specific followup tasks and patches:

The "Curve profile primitive node" item doesn't feel necessary at this point, since it relates more to custom profile bevels than curves.