# What type of spline does Blender use in its node editor?

This topic is 561 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

This may be the wrong forum, but I don't know where else to put it. Blender and other graphics packages that use a "node" interface typically use the same type of spline to connect between nodes. This spline is automatically defined and the user only has control over the two end points. Moving a node correctly redefines the spline. I'd rather not dig through the Blender source code, if at all possible, but I would like to know what type of spline is being used. I've tried searching Google, but all that brings up are links to tutorials and the like.

Here is a tutorial video that shows the node editor and connection splines:

Edited by MarkS

##### Share on other sites

Using Qt and knowing the start pos named pos1 and the end pos named pos2 :

QPainterPath p;
p.moveTo( Pos1 );
const qreal dx = Pos2.x() - Pos1.x();
const qreal dy = Pos2.y() - Pos1.y();
const QPointF ControlPoint1( Pos1.x() + dx * 0.5, Pos1.y() + dy * 0.1 );
const QPointF ControlPoint2( Pos1.x() + dx * 0.5, Pos1.y() + dy * 0.9 );
p.cubicTo( ControlPoint1, ControlPoint2, Pos2 );
setPath( p );

##### Share on other sites

Using Qt and knowing the start pos named pos1 and the end pos named pos2 :

QPainterPath p;
p.moveTo( Pos1 );
const qreal dx = Pos2.x() - Pos1.x();
const qreal dy = Pos2.y() - Pos1.y();
const QPointF ControlPoint1( Pos1.x() + dx * 0.5, Pos1.y() + dy * 0.1 );
const QPointF ControlPoint2( Pos1.x() + dx * 0.5, Pos1.y() + dy * 0.9 );
p.cubicTo( ControlPoint1, ControlPoint2, Pos2 );
setPath( p );

Thanks! I went to Inkscape after posting this and played around with a simple path and came to the same conclusion. They are just Bezier curves where the control points are adjusted based on the width and height of the bounding box.

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 32
• ### Forum Statistics

• Total Topics
632630
• Total Posts
3007525
• ### Who's Online (See full list)

There are no registered users currently online

×