Tangent on Spline Tool

Good day,

Is it possible to create a tool that will find the tangent on a spline? One can select the tool, the spline, the axis point and drag it around to connect to the section of spline where the tangent point is required? Or, perhaps, select 2 points on the spline between which the tangent is required?

1 Like

Can I assume this is response in how to find the lowest point on a curve / spline? In which case it would be easier to just implement a tool to create a point at the lowest point of a curve / spine.

Yes. But it’s more complicated than an Intersect Arc / Circle & Tangent. Which is why I assume RT never implemented such tool. With a spline there can be multiple tangent points, and we’d have to have a way to select which tangent point we want. Unlike a circle which will have 2 tangent points, where the axis point HAS to be outside the circle. For ex: I did a quick spline with 3 loops and a point outside the spline to show approx where the tangent points are.

spline

Then there’s the question - do we include tangent points when the axis crosses the spline itself - such as the green axis here?

spline2

Then - unlike with Arcs / Circles, there’s all the possibilties if the “Point” is “On” the spline.

2 Likes

I realise that. And the green line’s tangent would be a little to the right of where you have it to be a tangent, so it wouldn’t cross the spline’s line.

Would it be possible to choose only a section of the spline that we would want a tangent point on, instead of the whole spline? For example, we could select the section A2 to A1 instead of A2 to A4.

I know… this was meant as a sketch. not as a precise drawing. I didn’t feel like going back and forth by .05 to put it on the line. Not to mention the curve could be quite different than what I drew. :wink:

At this point - since there is no tool defined - we can do what ever we want. :slight_smile:

Me… I would just find all tangents, create a drop list that you could select from. Actually it’s the same sort of issue we have with the Intersect Curve & Axis, where we can only get the 1st intersect along the curve, when sometimes you may want the second (3rd etc) OR both so you can create a line between the 2. So maybe we could have a radio button First, Last, All? So in my sketch… First would be the Pink (A6) , last would be the Green (A8) , and all would be Pink, Red (A7), and Green. Might have to make the radio button only visible for the 1st time through the dialog, as you couldn’t have it create all the Points, and then at some edit to use the first, where some other tools use other points.

3 Likes

It sounds good to me :star_struck: I don’t mind how it works, but I do think it’s becoming a more & more necessary tool. Unless someone can teach me how to do it manually using the Tan function :laughing:

Unlike with a circle - has nothing to do with the Tan trig function. It has to do with solving for the (slope(s)) of a tangent from a given point to - in this case to a curve. Basically we’re into differntial calculus here.

OR

By brute force using the builtin Qt graphic routines… given some accuracy factor… and just interate through drawing a line from the point starting at 0 degs, and incrementing by the accuracy (.01"?) and testing if it intersects() the curve. If it does, grab and save the intersect point coordinates, and continue until you reach 360 degs.

With a circle you could solve for the angle for the tangent line from an external point using Trig. In a nutshell this is the relationship of sin, cos, and tan.

trig

But there’s an easy way uisng gemetry… finding the intesection(s) of 2 circles using the center, radius and external point. That’s what the app does.

2 Likes

I found a few sites that explain the geometry, but I have no idea of how to put it into practise and even less on how to use it in Seamly :cold_sweat::

oh, maaannn… I’ll have to go back to school & then university :rofl:

3 Likes

You can’t. For one you have to know the equation of the curve - which besides the fact it can change - you can’t get at the internals of the the app.

1 Like

That third reference is doing something quite different, and a lot easier. Given a point along a curve (for which there are existing tools using relative or absolute length) what is the tangent to the curve at that point.

This is something I do quite a lot. Just create a second point a tiny amount further along the curve and draw a line between them. The smaller the step along the curve the more accurate the tangent; you could even create two points a tiny amount to either side of your starting point.

Does that help? Do you have an example use case for this?

1 Like

Hi @MrDoo

I think the best example is the one on this topic: Lowest point of curve? - #21 by Scholli

I’ve been checking through the tools to see if there isn’t a tool, or a formula that one can use to find this point.

1 Like

Since there are no workarounds to find the tangent point(s) of a spline using the other tools of the software, I think this feature is quite useful. I created a Github issue. :blush:

1 Like

I used do draft my pattern in Clo and this is the number one feature that I miss in Seamly2D.

2 Likes

Could you post an example? In 40+ years of drafting pattern I’ve never had a need to draw a tangent to a spline.

As I pointed out way back in the topic this is a complicated issue to implement. In fact even the several CAD applications I have don’t impliment this. A spline has no definitive formula such as an ellipse, circle, parabola, or hyperbola would. Those we can easily solve for the tangent point.

2 Likes

For example, this is part of my process to draft a simple stovepipe collar. I cannot replicate this in seamly2D because there is no easy way to draw perpendicularly to a point that I add to a spline.

esmodpipe

Another example that I recently run into is to create darts perpendicular to a spline, like when drafting this hood.

darthood.jpg

When drafting on paper, this is as simple as using square ruler, but in Seamly2D I really have to plan ahead to make the point a part of the splines, or just eyeball it. This hinders on the fly design and make correction harder.

But I’m aware the difficulties to implement this. Even other softwares like Browzear Vstitcher and Style3D don’t have this tool (yet).

3 Likes

Understood. Thanks for the feedback examples.

1 Like

Understood. Thanks for the feedback examples.

1 Like

Yes there is. Here’s a simple curve spl_A_A2 with Point On Curve A3 . With a Point At Distance and Angle perpendicular to the point A3 on the curve. You simply use an angle formula using the second curve angle of the spline section minus 90 degs:

image

Note: You could also use the 1st angle of spl_A3_A2 + 90degs.

Note2: Internally under the hood the curves are actually a series of short lines… you can see if you zoom in real close. As such, that’s why we can determines the angle at the start and end points of a curve based on the angle of the start and end line segments. Which BTW is what the control points are also based on.

Therefore it’s easy to draw darts on a curve:

If you want the dart on the other side of the curve simply flip the Point A4:

6 Likes

Thank you very much! This is really handy I wish I knew it sooner. Glad I linger in this forum.

3 Likes