I am trying to center a triangle inside a circle/rectangle to make a simple video file logo.
I tried to center it using Align and Distribute -> Center x,y (relatively to biggest object) and this is the output:
which is not centered like I want it to.
Is there a way to center it like this:
which is more to the right (it's not accurate using the mouse)
I tried to change the triangle origin and then center it and it didn't even slightly move, and also I couldn't find an option of moving the origin to the shape mass and I had to move it manually which as I said didn't work.
Is there a way to do it? / Is there an option to move object origin to center of mass and making the 'Align and Distribute' take the origin point into account when calculating the center?
it's actually in the middle. It's just a optical illusion. This is a common design problem, there are multiple always to overcome, but the program can't do magic here.
I agree with julionetto. This also happens with the number 1. If you try to align a sequence of numbers, from 1 to 10, each inside a square and using Arial font... the number 1 will look misaligned.
If the triangle is a shape object (polygon tool, not a path object) the rotation center can be used. This is different from the bounding box center on shapes with odd number sides.
Here you can see 2 icons, the first is the real YouTube icon I downloaded, And the second is the same icon but I cropped out the triangle and centered it inside the rectangle using 'Align and Distribute' centering. As you can see the both icons have the same dimensions and bounding box but the first triangle is more to the right
I assume the original icon just used centering by center of mass and not by bounding box and this is what I'm trying to realize how to do.
ariel, there's no such thing as "center of mass". This wouldn't make any sense in graphical design. BTW, you used an equilateral triangle so the "center" is EXACTLY the center.
By default the center of rotation is the center of the object, as so both snaps will have the very same result. It only will be different if you manually change the axis of rotation. Neither option will do what you expect because this is not logically possible, it's a arbitrary perception of position.
@julioneto You are wrong. the center of mass of a triangle ABC is x= (Ax+ Bx + Cx) /3 , y= (Ay+ By+Cy) /3
suppose an equilateral triangle where A = (0,a) , B = (0,-a) , C = (tan(60)*a, 0) = (a√3, 0)
The center of mass is -> y= (a-a+0 /3) = 0 , x = (0+0+a√3) /3 = a / √3 -> COM = (a/√3, 0)
the bounding rectangle of this triangle is (0,a), (0,-a) ,(a√3, a) , (a√3, -a) therefore the center of the bounding box, which is what inkscape works with is ( (0+a√3) /2 , a-a /2) =(a/(2√3) , 0)
I have not seen the video, but can attest to the phenomenon of visual positioning diverging from geometric. It's one of the first things taught in design studies.
Exactly. There are design questions that you can't solve in math. In letter design, for example: if you put even spaces between the letters, it will look weird. This figure shows the ideal spacing between the typefaces... but this should not be taken rigidly: there are fonts that do not follow all these specifications.
@Guerreiro64 it's not an optical illusion, we define centering in different ways, I just solved it using snapping center of rotation to center of bounding box which gives the exact same result as the original logo of YouTube like I originally wanted.
In my opinion that looks better than regular centering.
• ariel tp: I added these yellow and blue figures from your image. See that the first object is not centered according to measurements, but visually. On the second object, it is centered according to measurements, but not visually.
I am trying to center a triangle inside a circle/rectangle to make a simple video file logo.
I tried to center it using
Align and Distribute -> Center x,y (
relatively to biggest object) and this is the output:which is not centered like I want it to.
Is there a way to center it like this:
which is more to the right (it's not accurate using the mouse)
I tried to change the triangle origin and then center it and it didn't even slightly move, and also I couldn't find an option of moving the origin to the shape mass and I had to move it manually which as I said didn't work.
Is there a way to do it? / Is there an option to move object origin to center of mass and making the '
Align and Distribute
' take the origin point into account when calculating the center?Thanks.
it's actually in the middle. It's just a optical illusion. This is a common design problem, there are multiple always to overcome, but the program can't do magic here.
This is not an optical illusion. I know it is centered. But it's not the centering behavior I want.
Currently it centers something like this:
triangle.setX(rectangle.x + rectangle.width/2 - triangle.width/2)
triangle.setY(rectangle.y + rectangle.height/2 - triangle.height/2)
But I want it to be something like this:
triangle.setOrigin(CENTER_OF_MASS) // make the origin in the center of the mass and not in width/2, height/2.
triangle.setX(rectangle.x + rectangle.width/2 - triangle.origin.x)
triangle.setY(rectangle.y + rectangle.height/2 - triangle.origin.y) // center the object relatively to the origin not to the width and the height.
I agree with julionetto. This also happens with the number 1. If you try to align a sequence of numbers, from 1 to 10, each inside a square and using Arial font... the number 1 will look misaligned.
If the triangle is a shape object (polygon tool, not a path object) the rotation center can be used. This is different from the bounding box center on shapes with odd number sides.
@TylerDurden How does this solve my problem?
@Guerreiro64 , @julioneto This is not an optical illusion!
Here you can see 2 icons, the first is the real YouTube icon I downloaded, And the second is the same icon but I cropped out the triangle and centered it inside the rectangle using '
Align and Distribute
' centering. As you can see the both icons have the same dimensions and bounding box but the first triangle is more to the rightI assume the original icon just used centering by center of mass and not by bounding box and this is what I'm trying to realize how to do.
Center of rotation is center of mass.🙄
@TylerDurden but the
Align and Distribute
doesn't take it into account it keeps using the bounding box centerThanks @TylerDurden, I found the solution. one of the snapping option is to snap the center of rotation to center of object,
Do you know how to do this with path object?
ariel, there's no such thing as "center of mass". This wouldn't make any sense in graphical design. BTW, you used an equilateral triangle so the "center" is EXACTLY the center.
By default the center of rotation is the center of the object, as so both snaps will have the very same result. It only will be different if you manually change the axis of rotation. Neither option will do what you expect because this is not logically possible, it's a arbitrary perception of position.
@julioneto You are wrong. the center of mass of a triangle ABC is x= (Ax+ Bx + Cx) /3 , y= (Ay+ By+Cy) /3
suppose an equilateral triangle where A = (0,a) , B = (0,-a) , C = (tan(60)*a, 0) =
(a√3, 0)
The center of mass is ->
y= (a-a+0 /3) = 0 , x = (0+0+a√3) /3
=a / √3 -> COM = (a/√3, 0)
the bounding rectangle of this triangle is (0,a), (0,-a) ,(a√3, a) , (a√3, -a) therefore the center of the bounding box, which is what inkscape works with is ( (0+a√3) /2 , a-a /2) =
(a/(2√3) , 0)
This is not the center of mass.
Maybe this: Extensions>Visualize path>Measure path>Center of Mass
@TylerDurden Thanks!
This tutorial explain the problem with optical illusion in graphic design
https://www.youtube.com/watch?v=S8ciDwLvKDk&t=114s
I have not seen the video, but can attest to the phenomenon of visual positioning diverging from geometric. It's one of the first things taught in design studies.
Exactly. There are design questions that you can't solve in math. In letter design, for example: if you put even spaces between the letters, it will look weird. This figure shows the ideal spacing between the typefaces... but this should not be taken rigidly: there are fonts that do not follow all these specifications.
@Guerreiro64 it's not an optical illusion, we define centering in different ways, I just solved it using snapping center of rotation to center of bounding box which gives the exact same result as the original logo of YouTube like I originally wanted.
In my opinion that looks better than regular centering.
• ariel tp: I added these yellow and blue figures from your image. See that the first object is not centered according to measurements, but visually. On the second object, it is centered according to measurements, but not visually.
That's what I mean...
Those blue blocks are supposed to be centered?
Not even close, but maybe I'm missing the point.
You're right: sorry, I made this scheme a bit hasty. :)
In fact, the blue squares are being useless there and can be disregarded. For our discussion, what matters are the yellow elements...
@Guerreiro64 I think you didn't understand the question. the question is about horizontally centering mot vertically