Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8842287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:55:11+00:00 2026-06-14T10:55:11+00:00

I am wondering what algorithm (or formula) Inkscape uses to calculate the control points

  • 0

I am wondering what algorithm (or formula) Inkscape uses to calculate the control points if the nodes on a path are made “smooth”.

That is, if I have a path with five nodes whose d attribute is

M 115.85065,503.57451
  49.653441,399.52543 
  604.56143,683.48319 
  339.41126,615.97628 
  264.65997,729.11336

And I change the nodes to smooth, the d attribute is changed to

M 115.85065,503.57451 
C                     115.85065,503.57451 24.747417,422.50451
  49.653441,399.52543 192.62243,267.61777 640.56491,558.55577
  604.56143,683.48319 580.13686,768.23328 421.64047,584.07809
  339.41126,615.97628 297.27039,632.32348 264.65997,729.11336
  264.65997,729.11336

Obviously, Inkscape calculates the control point coordinates (second last and last coordinate pair on lines on or after C). I am interested in the algorithm Inkscape uses for it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:55:12+00:00Added an answer on June 14, 2026 at 10:55 am

    I have found the corresponding piece of code in Inkscape’s source tree under
    src/ui/tool/node.cpp, method Node::_updateAutoHandles:

    void Node::_updateAutoHandles()
    {
    
        // Recompute the position of automatic handles.
        // For endnodes, retract both handles. (It's only possible to create an end auto node
        // through the XML editor.)
        if (isEndNode()) {
            _front.retract();
            _back.retract();
            return;
        }
    
        // Auto nodes automaticaly adjust their handles to give an appearance of smoothness,
        // no matter what their surroundings are.
        Geom::Point vec_next = _next()->position() - position();
        Geom::Point vec_prev = _prev()->position() - position();
        double len_next = vec_next.length(), len_prev = vec_prev.length();
        if (len_next > 0 && len_prev > 0) {
            // "dir" is an unit vector perpendicular to the bisector of the angle created
            // by the previous node, this auto node and the next node.
            Geom::Point dir = Geom::unit_vector((len_prev / len_next) * vec_next - vec_prev);
            // Handle lengths are equal to 1/3 of the distance from the adjacent node.
            _back.setRelativePos(-dir * (len_prev / 3));
            _front.setRelativePos(dir * (len_next / 3));
        } else {
            // If any of the adjacent nodes coincides, retract both handles.
            _front.retract();
            _back.retract();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering, I have an algorithm of mine that I want to test
I was wondering if you know any algorithm that can do an automatic assignment
I have a list of random integers. I'm wondering which algorithm is used by
I was wondering what signature algorithm (digestOID) BouncyCastle uses by default if you do
I have pasted pseudocode for a paxos algorithm below and was wondering if someone
In my algorithm I have two values that I need to choose at random
I was wondering if there are any algorithms that calculate the day of week
I'm wondering if there's an algorithm that would can get pixels inside a certain
I was wondering if Dijkstra's algorithm can be modified to find the path between
I am wondering if there exists some asymmetric encryption algorithm that would work with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.