Gimp-Forum.net
center point of circle path - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: center point of circle path (/Thread-center-point-of-circle-path)

Pages: 1 2


RE: center point of circle path - Krikor - 10-08-2023

(10-08-2023, 03:56 AM)sallyanne Wrote:
my gimp has guides for the rectangle and elipse select - would that help?

Hi Sally,

You made a great observation, I don't remember ever noticing this form of centralization before. Really simple and without the need for plugins!  Smile

However, in this technique, the demarcation lines signaling the center are ephemeral, fleeting, lasting only as long as the selection is active, and disappearing as soon as another tool is selected.

It is still possible to register the central points by checking, for example, the information in the Pointer window (yellow circle in the attached figures)

Another way is a plugin I have (I don't know the name of this plugin/script), which is found via the menus: Image - Guides - Center of selection, which creates guides whose intersection is the central point of the selection box.

An interesting point to note is that a path that originated from a selection made by the Ellipse Select Tool will possibly (or always, I can't say) create a false center when submitted to the "ofn-path-to-shape and is" plugin. called Shapes > On Strokes > Circle > Crosshair" - As seen in the attached image.
[attachment=10462]
However, for a path originating from the ofn-path-shape plugin, the generated Crosshair (in red) correctly points to the center of this circle.
[attachment=10463]



RE: center point of circle path - PixLab - 10-08-2023

Alignment tool will do it, it's all natural  Big Grin

Drag a guide from the ruler on the left and one from the top -> you don't care where you drop them
Now select the Alignment tool, in the tool option select "Relative to Selection" then click on the guide you want to align (2 little white square will appear one on each end of the guide) then just click to the center button and voila..

[attachment=10466]


RE: center point of circle path - Ofnuts - 10-08-2023

(10-08-2023, 11:43 AM): "Krikor Wrote:
(10-08-2023, 03:56 AM)sallyanne Wrote:
my gimp has guides for the rectangle and elipse select - would that help?

Hi Sally,

You made a great observation, I don't remember ever noticing this form of centralization before. Really simple and without the need for plugins!  Smile

However, in this technique, the demarcation lines signaling the center are ephemeral, fleeting, lasting only as long as the selection is active, and disappearing as soon as another tool is selected.

It is still possible to register the central points by checking, for example, the information in the Pointer window (yellow circle in the attached figures)

Another way is a plugin I have (I don't know the name of this plugin/script), which is found via the menus: Image - Guides - Center of selection, which creates guides whose intersection is the central point of the selection box.

An interesting point to note is that a path that originated from a selection made by the Ellipse Select Tool will possibly (or always, I can't say) create a false center when submitted to the "ofn-path-to-shape and is" plugin. called Shapes > On Strokes > Circle > Crosshair" - As seen in the attached image.

However, for a path originating from the ofn-path-shape plugin, the generated Crosshair (in red) correctly points to the center of this circle.

This is because the first three points of the ellipse are too close to each other to there are round-off errors (try to do the same with a compass and you will have the same problem).

If you do the same by making a stroke with sufficiently spaced anchors placed on the circle then the crosshair is accurate. As the doc says for the sibling Circumcircle function: "For best accuracy, the three points should be as much spread apart as possible.". Of course circles created by OPTS itself are made of 4 anchors so these are by design sufficiently well spaced (and the crosshair's anchors will be the same as the circle. I could improve the script by trying to find the three most distant anchors.


RE: center point of circle path - Krikor - 10-09-2023

(10-08-2023, 04:03 PM)PixLab Wrote: Alignment tool will do it, it's all natural  Big Grin

Drag a guide from the ruler on the left and one from the top -> you don't care where you drop them
Now select the Alignment tool, in the tool option select "Relative to Selection" then click on the guide you want to align (2 little white square will appear one on each end of the guide) then just click to the center button and voila..

Patrice, with the advantage of not needing a plugin :-)
The Alignment Tool is much more versatile than it seems.
This reminds me of this post:
https://www.gimp-forum.net/Thread-Align-function-can-you-arrange-layers-side-by-side-left-edge-of-2-to-right-of-1?pid= 17612#pid17612

(10-08-2023, 04:17 PM)Ofnuts Wrote: This is because the first three points of the ellipse are too close to each other to there are round-off errors (try to do the same with a compass and you will have the same problem).

If you do the same by making a stroke with sufficiently spaced anchors placed on the circle then the crosshair is accurate. As the doc says for the sibling Circumcircle function: "For best accuracy, the three points should be as much spread apart as possible.". Of course circles created by OPTS itself are made of 4 anchors so these are by design sufficiently well spaced (and the crosshair's anchors will be the same as the circle. I could improve the script by trying to find the three most distant anchors.

I have a vague memory of having problems with circles created with the Ellipse Tool in the past. That's when I started using plugins for this purpose.

An example is what happened to this circle seen in the first image. Created with the Elipse Tool and then converted to path, and then again from path to selection.

When the initial selection is still active, the XY values for selection and W/H are correct:
Selection x/y = 274 and W/H = 250
But after path to selection:
Selection:
x=274 ; y 275 / W=251 ; H=250

For the circle created directly for the path, this deviation does not occur, as seen in the second image of my previous post.


RE: center point of circle path - denzjos - 10-09-2023

I have already experienced that when I rotate and move a circle path in Gimp, the 'selection from path' gives a different result than 'stroke path'. Probably a rounding or interpolation of path values to pixel values that is done in a different way. This story reminds me of a problem that I had when I wrote a program to convert 2D NC programs of contours that only consisted of ISO codes G01, G02 and G03 to DXF files. They were old files of complicated contours that needed to be corrected in a CAD system. After conversion, the various entities on the CAD system were not closed. This was because the CAD-CAM conversion rounded the intersection values to 3 decimal places. After converting to DXF, those values were included. With an NC machine this does not pose a problem because you can enter a parameter in the machine after which it bridges these gaps in the contour. The CAD user then had to close all openings of the contour with the CAD program before he could correct the contour for new use.

Circle path drawing in gimp convert to 'path to selection' and 'stroke path' :

 [attachment=10469]


RE: center point of circle path - Krikor - 10-10-2023

In this image you can see another problem when creating a circle using the Ellipse select tool --> Irregularities in its contour when painted (strokes)

Just remember that having two equal circles in paths, your strokes will have different thicknesses if they are stroked in the selection (Path to selection - Fig 01) or directly on the path (Stroke Path - Fig 02).
[attachment=10472]
In case 01, only half the thickness will be stroked.


RE: center point of circle path - Ofnuts - 10-10-2023

(10-10-2023, 06:45 AM)Krikor Wrote: In this image you can see another problem when creating a circle using the Ellipse select tool --> Irregularities in its contour when painted (strokes)

Just remember that having two equal circles in paths, your strokes will have different thicknesses if they are stroked in the selection (Path to selection - Fig 01) or directly on the path (Stroke Path - Fig 02).

In case 01, only half the thickness will be stroked.

You get half the thickness because you keep the selection, so the stroke is constrained to the selection. If you to Select > From path and then Select > None, the stroked path has the required width. If you think you need the selection later, then Select > Save to channel first (and make the layer active again otherwise the path will be stroked on the saved channel).