I'm wondering if there is any method to create a curve that automatically has the lines coming off of it to be tangent.
In AutoCAD, I can draw a circle, and then attach two lines to it as tangents. This creates a shape of a straight line going in one direction, curving in a perfect circle, and then proceeding in a straight line toward its next point.
Depending on what various attributes are locked on the object, I could grab the further edge of one of those lines and move it around, and the program automatically will adjust where on the circular curve that line connects to, so that it will always be tangent. For example in the image above, if I grabbed the left point of the upper line and moved it up, the exact spot where it connects to the rounded edge would be brought in a little, making the rounded edge "shorter" so that the line is perfectly tangent to the circle.
Or, I could grab the center point of the circle and move it around, and the size of the circle would change to keep those two lines tangent. For example in the image above, if I moved the center of the circle toward the bottom-left corner, the rounded edge would enlarge, and if I moved it toward the upper right hand corner, the rounded edge would contract until it was just a tiny bevel.
I'm drawing a shape where I want to have such a function. I want to have a perfectly circular rounded edge with smooth nodes. So I have two smooth nodes. But I can't get the bezier curves to be anywhere near a perfect circle without accidentally changing the angle of line into something I don't want. And when I try to fix the other side of the node, I change the angle again, destroying the circle. (Not like I have yet managed to get the bezier curve to look adequately circular, but still...
Tangent lines?
Re: Tangent lines?
Hi.
In the upcoming 0.91 it is a somewhat adressed feature.
Depending on the design, snapping tangentially might not be that precise.
Because the paths themselves differ from a geometrical circle, only nodes can be calculated accurately.
To be honest I only know of a manual guesswork-like way to construct the coincident tagged point in your image, which, will be more accurate than by trying to construct the old fashioned way from two circles.
Or to calculate the coordinates.
That's the dark side of the Bézier.
In the upcoming 0.91 it is a somewhat adressed feature.
- Inkscape now also snaps perpendicularly and tangentialy to paths, when creating paths in the pen tool, when dragging nodes, or when manipulating guides. Newly created guides (dragged off the ruler) will snap perpendicularly or tangentialy to any curve that is being snapped to. Two checkboxes have been added to the document properties dialog (on the snapping tab). Please note that snapping perpendicularly or tangetialy will not work in the selector tool when transforming an object or a selection of objects.
Depending on the design, snapping tangentially might not be that precise.
Because the paths themselves differ from a geometrical circle, only nodes can be calculated accurately.
To be honest I only know of a manual guesswork-like way to construct the coincident tagged point in your image, which, will be more accurate than by trying to construct the old fashioned way from two circles.
Or to calculate the coordinates.
That's the dark side of the Bézier.
Re: Tangent lines?
I found this post thru a google search, but I did not find an answer to the question.
So I spent some time and wrote an extension for drawing tangent lines from a point to a circle, or tangent lines between two circles.
You need to draw the red dash lines as path, select the path, and choose menu Extensions -> Render -> Draw Rectangle. The extension read the coordinates of points on the auxiliary path and draw the tangent lines.
It is easy to draw the auxiliary path by turning on the "Snap smooth nodes" and "Snap Centers of objects" buttons on snap bar.
[img]g5481.png[/img]
So I spent some time and wrote an extension for drawing tangent lines from a point to a circle, or tangent lines between two circles.
You need to draw the red dash lines as path, select the path, and choose menu Extensions -> Render -> Draw Rectangle. The extension read the coordinates of points on the auxiliary path and draw the tangent lines.
It is easy to draw the auxiliary path by turning on the "Snap smooth nodes" and "Snap Centers of objects" buttons on snap bar.
[img]g5481.png[/img]
- Attachments
-
- g5481.png (55.19 KiB) Viewed 6483 times
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Tangent lines?
Very nice... thank you!
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
Re: Tangent lines?
You're welcome to upload to the Inkscape website, if you like: https://inkscape.org/en/gallery/=extens ... er=-edited
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Tangent lines?
June 2018, added code to handle two circles with equal radii. The original version reports an error.
Here is how to use the extension.
1. Draw an auxiliary line from 1 to 2 to 3, or a line from 4 to 5 to 6 to 7.
2. With the line selected, select menu item Extensions > Render > Draw Tangent.
3. Select an option on the popup menu, click apply.
Now the extension can handle two equal radii circles.
Here is how to use the extension.
1. Draw an auxiliary line from 1 to 2 to 3, or a line from 4 to 5 to 6 to 7.
2. With the line selected, select menu item Extensions > Render > Draw Tangent.
3. Select an option on the popup menu, click apply.
Now the extension can handle two equal radii circles.
- Attachments
-
- draw_tangent_1.2.zip
- (3.12 KiB) Downloaded 278 times
Last edited by GeorgeZ on Wed Jun 27, 2018 9:34 am, edited 1 time in total.
Re: Tangent lines?
George, is this already online on the inkscape.org website? If it isn't, please share it there!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Tangent lines?
Hi
Very Nice !!
"Difficult" to find in the "Render" extension group - might be worth making it's own "CAD_Tools" or something similar?
Might also be useful to catch input errors which now result in "math domain error"?
Nice Code!
Very Nice !!
"Difficult" to find in the "Render" extension group - might be worth making it's own "CAD_Tools" or something similar?
Might also be useful to catch input errors which now result in "math domain error"?
Nice Code!
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Tangent lines?
Thanks, @GeorgeZ for your work. Nice extension.
I would love to see more such geometric and CAD-like functions like this.
Let me just mention:
a) creating a tangent from a point to a circle (or more general any shape) is already implemented in Inkscape .
1. go to: File | Document Properties (or Shift+Ctrl+D)
2. go to: Snap tab
3. go to: Miscellaneous, check "Snap perpendicular" and "Snap tangentially"
4. on the "Snap bar" enable snap to path
b) for those who are interested in creating tangents between arbitrary shaped objects you can use snap tangentially (see a)) and get well approximated tangents as follows:
1.-4. set perpenticular and tangential snapping, see a)
5. start to draw a freehand line (F6) from the approximated (by eye) tangent point of the 1st shape
6. drag and move it to the 2nd shape until it snaps tangentially
7. select node tool (F2) and move the 1st node of the line until it snaps tangentially to the 1st shape
8. select the 2nd node and move it until it snaps tagentially to the 2nd shape
9. repeat step 7. and 8. until the coordinates of the the 1st and 2nd nodes do not change anymore (maybe 2-3 times should be good enough)
More elegant and efficient methods for b) are welcome.
I would love to see more such geometric and CAD-like functions like this.
Let me just mention:
a) creating a tangent from a point to a circle (or more general any shape) is already implemented in Inkscape .
1. go to: File | Document Properties (or Shift+Ctrl+D)
2. go to: Snap tab
3. go to: Miscellaneous, check "Snap perpendicular" and "Snap tangentially"
4. on the "Snap bar" enable snap to path
b) for those who are interested in creating tangents between arbitrary shaped objects you can use snap tangentially (see a)) and get well approximated tangents as follows:
1.-4. set perpenticular and tangential snapping, see a)
5. start to draw a freehand line (F6) from the approximated (by eye) tangent point of the 1st shape
6. drag and move it to the 2nd shape until it snaps tangentially
7. select node tool (F2) and move the 1st node of the line until it snaps tangentially to the 1st shape
8. select the 2nd node and move it until it snaps tagentially to the 2nd shape
9. repeat step 7. and 8. until the coordinates of the the 1st and 2nd nodes do not change anymore (maybe 2-3 times should be good enough)
More elegant and efficient methods for b) are welcome.
Win7/64, Inkscape 0.92.2
Re: Tangent lines?
A very limited in application method - which is to say it has drawing utility but no mathematical rigor* - is to select both objects, display the bounding box and start rotating until both objects are touching one side of the bounding box. Now draw a horizontal or vertical line snap it to the bounding box and then rotate all back to where they were before. Make sense?
*Okay, so if you really want to get into the calculus it has some mathematical rigor since the tangent and its perpendicular define a rotated coordinate plane etc. but really who wants to go there
*Okay, so if you really want to get into the calculus it has some mathematical rigor since the tangent and its perpendicular define a rotated coordinate plane etc. but really who wants to go there
Your mind is what you think it is.
Re: Tangent lines?
GeorgeZ, does your extension work for you on 0.92.4? I wanted to try it, but sadly I was unsuccessful…
Re: Tangent lines?
Does this one work:
https://inkscape.org/~pacogarcia/%E2%98 ... ew-version ?
https://inkscape.org/~pacogarcia/%E2%98 ... ew-version ?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)