New tool: Curve which uses point as control handle

Issue #395 resolved
Susan Spencer created an issue

Allow use of previously defined points to the be end point of a control handle.

Use case:

I define a point A, then later when creating a curve I can select A as as end point to one of the curve's control handle.

Comments (22)

  1. Susan Spencer reporter

    This would be my preferred way to create curves. This is how I create curves in my python program. It works really well.

  2. Susan Spencer reporter

    But it isnt interactive, so some people would not prefer this method.

    But once created, the points can be tweaked, so the user can see how the curve moves and determine the best formula for the point.

  3. Roman Telezhynskyi repo owner

    I can make it like a separate tool. User select point B, A, D and E. What do you think?

  4. Benjamin Nauck

    I'm really looking forward to see this implemented. It will help me a lot in a pattern I'm currently designing.

    Regarding interactivity: How about making it possible to snap/connect a spline control point handle to a existing point without opening a dialog?

    I'm thinking something like this:

    1. Create a spline
    2. Move spline's control point near an existing point (maybe hold down a modifier key) and it will snap
    3. The control point's position gets defined by the position of the other point

    Now when you change the target point the spline updates automatically.

    If you then want to modify the linked control point (and remove the connection):

    1. Select the spline
    2. Move the control point and it will unsnap and break the link
  5. Roman Telezhynskyi repo owner

    Benjamin, what you see is a "night sky". Each object has an order in history. This is the main reason why we don't have the snapping feature. Most graphic editors don't have such problems. I am speaking about depth of object in sequence. And snapping feature will not work for some cases because object exist before the target.

    Regarding interactivity: How about making it possible to snap/connect a spline control point handle to a existing point without opening a dialog? I am thinking more about special tool or second mode for exist tool like Susan suggested.

  6. David Arnold

    I was looking into how to implement this. Might be a long journey, because C++ is not of my particular knowledge. However, I share here my analysis (also to understand the code better):

    The candidate would be the vsplinepath.cpp here: https://bitbucket.org/dismine/valentina/src/02e312d71477c1e60cb97d86313570a8a4c191f3/src/libs/vgeometry/?at=develop

    And then

    #!c++
    
        VPointF GetP1 () const;
        QPointF GetP2 () const;
        QPointF GetP3 () const;
        VPointF GetP4 () const;
    
    I see that the two control points are Qt's QPointF not VPointF

    I suppose VPointF are well calculated Valentina Points while QPointF are just coordinates. My plan was to make QPointF VPointF for the normal 2-enpoint-spline. A multiple spline is then just a composition and mere convenience.

    At tool definition time, there would then be the selection of optional 4 points, all well defined Valentina Points, there would then be any editing option disabled as the Bezier Curve is well defined by 4 VPointF points. If I wouldn't select the two control handles as Valentina Points (as they would be optional), I would then have a traditional "manual" Bezier.

    However, I didn't understand where the viewport is defined and constructed.

    Can you point me to an example?

  7. David Arnold

    This is by the way a feature which common CAD solutions aren't incorporating, but which is crucial to dynamic designs, in other words, measure driven patterns.

  8. Susan Spencer reporter

    Since this is now a separate tool, the dialog box only needs the begin & end point, and the two points to use as control points.

  9. Log in to comment