Spline: tangency to another line.

Spline: tangency to another line.

Anonymous
Not applicable
5,935 Views
26 Replies
Message 1 of 27

Spline: tangency to another line.

Anonymous
Not applicable

Dear Forum,

 

How to identify in a spline the point(s) where it is tangent to another line?

 

I have a spline, and I want to find its points of tangency to the horizontal.

 

Object Snap "Tangent" option seems unhelpful here.

 

Sorry for the naivety. I can't find the way.

 

Michele

Accepted solutions (1)
5,936 Views
26 Replies
Replies (26)
Message 21 of 27

zbysogi
Contributor
Contributor

Hi,

 

This lisp works great but what about using it to identify non tangent points within the spline to fix them later?

Let say I have a spline like the one attached and You can clearly see it is not perfect, especially on the arcs (top left and top right). Is there a way to globally identify those areas so I would not miss them? I create an entity with arcs, lines and splines, join them together and make offset to the inside and a spline, like the one attached, is created. Then I need to amend it by fixing the nontangent areas. There is a lot of them and recently I missed 2 areas like that. The problem is the design was sent to a ploter and f***ed up the element that was cut.

0 Likes
Message 22 of 27

j.palmeL29YX
Mentor
Mentor

@leeminardi wrote:

@j.palmeL29YX   Too bad AutoCAD's parametric features do not include splines for constraints or you could make the solution more automatic. 

 

 


 

My above shown graphic method can in a little modified manner solve all that asked.
Assuming we have a given spline. (See >>video<<). To avoid that the further steps will change the spline I lock the geometry of the spline using a Fix constraint.
Now:
- draw a Line_1 and add Coincident constraints between their endpoints and the spline object.
- Add a Length d1 to this line. For demonstration I used for now a value of 25. In later steps we will see, the smaller this value of d1 the more precise will be the result. I can drag this line along the spline.
- draw a Line_2. Add a Coincident constraint midpoint to midpoint and a perpendicular constraint to Line_1. I'd suggest also to fix its length to any value (here I used 30). While dragging the lines along the spline the Line_2 will always stay perpendicular to the spline.
- draw a Line_3, add a horizontal constraint and a coincident constraint to the intersection between Line_2 and this Line_3 (as reference line for the following angular dimensions).
- Now we can add an angular dimension to show the angle of Line_2. But this is not what we need.
- As graphical representative of the spline's slope add a Line_4 parallel and coincident to Line_1 (red). You can now move the lines to any point along the spline and see the slope value.
- Assuming you need the slope at any given point you should add a coincident constraint between the Line_2 object and this point.

- If you move the lines to a point where the spline is not symmetrical in the range between the endpoints of Line_1 you can see, that Line_2 is not perpendicular to the spline (and Line_4 not tangential to the spline at this point). You can increase the accuracy of the result by decreasing the value of d1. In the video I got a precision of three digits with a d1 of 0.01.

 

What also can you do:
You search the point along the spline, where the slope has a given value.
- Because there may be several solutions you should first drag the lines near to the whished position. (e.g. in the shown example we find 5 points with a slope of 135°).
- Now we add a dimensional constraint (dcangular) with the whished value and the lines will snap to the right place. the intersection between Line_2 and the spline is the asked point. Be aware: the smaller d1 the more accurate will be the result.)
- If you want to drag the lines to another place, you first must either delete the dimensional constraint or convert it to a Reference Dimension (as done in the video).

 

This is only a rough description of the basic idea. Of course you can refine the workflow to meet your requirements closer. 

 

HTH

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 23 of 27

leeminardi
Mentor
Mentor

@j.palmeL29YX  I think the main issue for the OP is that he has an poorly defined spline!  There are way too many CVs defining the radius at the corner.  The more CV's you have the more likely you will get ripples in the resulting spline.  In the image below the bottom curve is the OP's spline and the upper curve (green) is one I created using 5 CV's to approximate the arc.   The "arc" portion of my spline is precisely tangent to the straight line adjoining section.

image.png

To get an exact arc with a spline the weights of the knots for the CVs must be  changed from their default value of 1 (yielding a NURBS rather than the default B-spline).

 

Creating a spline with smooth transitions (no abrupt changes in slope) from one segment to the next is not difficult.   All you need to do is make sure the first two, or last two, CVs of the spline segment define the tangent vector.  It is more difficult to create an exact arc by appropriately locating the CVs and their weights.  Depending on the application I think approximating the arcs with a default AutoCAD spline (B-Spline) could yield satisfactory results for the precision of the arcs.  The tangents can could be exact.

 

If I have time,  I'll try to make a Screencast of creating a spline from a polyline with arcs.

lee.minardi
Message 24 of 27

zbysogi
Contributor
Contributor
"make sure the first two, or last two, CVs of the spline segment define the tangent vector"

How do I do that?
0 Likes
Message 25 of 27

j.palmeL29YX
Mentor
Mentor

Drag the first vertex next to each endpoint to any point in the extension of the given lines. 

 

>>Demo<< 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 26 of 27

leeminardi
Mentor
Mentor

@zbysogi   Here's a detailed Screencast of how to create a spline that matches (closely) a polyline with arcs.

 

https://autode.sk/3hcekEf

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lee.minardi
Message 27 of 27

zbysogi
Contributor
Contributor
that is awesome. Thank You!
0 Likes