Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tangents or normals to a path
#1
A couple of new tools to manipulate paths.

Inkscape can do snapping to paths both tangentially and perpendically. (In Inkscape, see Document Properties > Snap, and tick the two points at the bottom.) Nothing similar exists in Gimp(?). I made a sort of "poor man's snap" to imitate that feature. It is no real snapping as in Inkscape.

The package consists so far of four plugins:
  1. Bounding box
  2. Parallel tangents or normals
  3. Tangents or normals from a point
  4. Tangents or normals from a stroke end of another path
To get the plugins, go to

http://kmarkku.arkku.net/Path_tangents_f...aster.html

and click the Download button at the bottom. That gives you a ZIP file. Unzip it and place the one file it contains (path_tangents.py) in your user's plugins folder. Start Gimp. In the Paths tab, right click some path and follow the link Tools > Tangents and normals > ...

Bounding box does what its name says. Actually the code has been finished for a long time but it was buried in another plugin, and I felt that it deserves to be a plugin on its own right. I placed it in this package since it is, loosely speaking, about tangents.

Of the other plugins I explain here number 3: "Tangents or normals from a point". The rest will follow in another post.

Tangents or normals from a point: Suppose you have a path and you need to draw a tangent to it from some point. In the picture below the Path is in blue. I marked the point with a black dot but that is only for this explanation. It is just some point in the plane. The red line is the tangent you want to draw.

   

You use the plugin as follows. Make a tentative tangent: a line segment (a path with 2 anchors), one end precisely at the point you want, and the other end somewhere close to where the tangential point should be:

   

Then call the plugin by right-clicking at Path (in the Paths tab), follow the link

Tools > Tangents and normals > Tangents or normals from a point

click it, and choose your tentative tangent in the GUI. Otherwise keep the default values. The plugin creates the tangent as a new path:

   

You can think that your tentative tangent is "snapped" to the tangential point.

The plugin offers three other inputs:
  • Tangents or normals?
  • Action
  • Extend
The first enables you to draw normals (perpendiculars) instead of tangents, and the third allows you to draw the tangent or normal with an extension. Please try these two yourself.

I explain now the Action: There are three options:
  • Draw only the closest (default)
  • Draw all for the closest stroke
  • Draw all
In the following pictures I show the meanings of the options. The path is the concentric circles. I made there a tentative tangent.

   

The first option (default) draws one tangent, closest to the tentative tangent. The second draws all possible tangents for one stroke, the closest one (here it is the largest circle). And if you choose "Draw all" you get all possible tangents for the whole path. See the picture:
 
   

If you find any strange behaviours, please report. Or if you have any suggestions, please tell me.

Sorry for the long posting. To be continued...
Reply


Messages In This Thread
Tangents or normals to a path - by Ottia Tuota - 12-19-2020, 04:57 PM
RE: Tangents or normals to a path - by Ofnuts - 12-19-2020, 08:40 PM
RE: Tangents or normals to a path - by denzjos - 12-26-2020, 07:59 AM
RE: Tangents or normals to a path - by denzjos - 01-10-2021, 04:24 PM

Forum Jump: