It is currently April 25th, 2024, 1:25 am

Marking a dynamic position on a shape circle. [solved]

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Marking a dynamic position on a shape circle. [solved]

Post by CodeCode »

I started a thread here: https://forum.rainmeter.net/viewtopic.php?f=5&t=24294&start=420#p195779

But after some thinking, I ventured to guess that the same thing could be accomplished with a round line.

To recap:
A shape:

Code: Select all

[MeterShow]
Meter=Shape
Shape=Rectangle 10,10,193,193,97 | Fill Color 0,0,0,0 | StrokeWidth 6 | Stroke Color 255,255,0,255
I am trying to show the movement in percentile (I have the measure for that) by a segment of black 'line' travelling around the perimeter of the 6 point shape - or rather intersecting it so the segment shows a position on the shape.

If anyone knows how to do that, please drop a reply with some code or a link.
Thanks.
CC
Last edited by CodeCode on August 14th, 2021, 12:44 pm, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Marking a dynamic position on a shape circle.

Post by CodeCode »

CodeCode wrote: August 14th, 2021, 6:34 am I started a thread here: https://forum.rainmeter.net/viewtopic.php?f=5&t=24294&start=420#p195779

But after some thinking, I ventured to guess that the same thing could be accomplished with a round line.

To recap:
A shape:

Code: Select all

[MeterShow]
Meter=Shape
Shape=Rectangle 10,10,193,193,97 | Fill Color 0,0,0,0 | StrokeWidth 6 | Stroke Color 255,255,0,255
I am trying to show the movement in percentile (I have the measure for that) by a segment of black 'line' travelling around the perimeter of the 6 point shape - or rather intersecting it so the segment shows a position on the shape.

If anyone knows how to do that, please drop a reply with some code or a link.
Thanks.
CC
Ok, I think that this may be a way, in a manner of speaking:

Code: Select all

[MeterBlkRotate]
Meter=Shape
Shape=Arc 168,265,172,265,97,97,0,0,0,0 | StrokeWidth 6 | Stroke Color 0,0,0,255 | RotationAngle [MeasureRotation]
It doesn't actually work, but maybe it is more of what is needed than it is not - but I remain unsure...
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Marking a dynamic position on a shape circle.

Post by death.crafter »

Or this:

Code: Select all

[Rainmeter]
Update=50

[Variables]
Radius=97

[Loop]
Measure=Loop
StartValue=1
EndValue=360
Increment=1
MaxValue=360

[MeterShow]
Meter=Shape
X=3
Y=3
DynamicVariables=1
Shape=Ellipse 97,97,97,97 | Fill Color 0,0,0,0 | StrokeWidth 6 | Stroke Color 255,255,0,250
Shape2=Arc (#Radius#+(#Radius#)*cos(rad(90+[Loop]))),(#Radius#+(#Radius#)*sin(rad(90+[Loop]))), (#Radius#+(#Radius#)*cos(rad(90+30+[Loop]))),(#Radius#+(#Radius#)*sin(rad(90+30+[Loop]))), #Radius#, #Radius# | StrokeWidth 3 | StrokeStartCap Round | StrokeEndCap Round
from the Realm of Death
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Marking a dynamic position on a shape circle.

Post by CodeCode »

death.crafter wrote: August 14th, 2021, 8:21 am Or this:

Code: Select all

[Rainmeter]
Update=50

[Variables]
Radius=97

[Loop]
Measure=Loop
StartValue=1
EndValue=360
Increment=1
MaxValue=360

[MeterShow]
Meter=Shape
X=3
Y=3
DynamicVariables=1
Shape=Ellipse 97,97,97,97 | Fill Color 0,0,0,0 | StrokeWidth 6 | Stroke Color 255,255,0,250
Shape2=Arc (#Radius#+(#Radius#)*cos(rad(90+[Loop]))),(#Radius#+(#Radius#)*sin(rad(90+[Loop]))), (#Radius#+(#Radius#)*cos(rad(90+30+[Loop]))),(#Radius#+(#Radius#)*sin(rad(90+30+[Loop]))), #Radius#, #Radius# | StrokeWidth 3 | StrokeStartCap Round | StrokeEndCap Round
Cool!
Which of the numbers decides the black part dimensions?

Haha. I got it. Just some alien territory for me but, ya.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Marking a dynamic position on a shape circle.

Post by death.crafter »

CodeCode wrote: August 14th, 2021, 8:48 am Cool!
Which of the numbers decides the black part dimensions?
The (90+30+[Loop]) part.

30 is how many degrees of width it has. You can replace [Loop] by 360*[Measure:%]/100.

And ofc the StrokeWidth.
from the Realm of Death
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Marking a dynamic position on a shape circle.

Post by CodeCode »

death.crafter wrote: August 14th, 2021, 8:52 am The (90+30+[Loop]) part.

30 is how many degrees of width it has. You can replace [Loop] by 360*[Measure:%]/100.

And ofc the StrokeWidth.
Oh. Maaan.
Thank you so much. That cinched it!

I really should have known that, from those progress bars a while back. But the more I learn... the more I learn.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Marking a dynamic position on a shape circle. [solved]

Post by Yincognito »

Alternatively, if the "line" is short and having a longer arc of the same "path" as the circle is not needed, Roundline can do the job as well:

Code: Select all

[MeterShow2]
Meter=Roundline
MeasureName=Loop
X=100
Y=100
StartAngle=0
RotationAngle=(PI*2)
LineStart=95
LineLength=99
LineWidth=16
LineColor=0,0,255,255
Solid=0
AntiAlias=1
This will actually be a line (or rectangle, if you like), so if it's longer will step outside the circle's path, and for that death.crafter's solution (which would be my favorite as well, as it looks cool and all) is perfect. You can make it as thick as you want it though.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Marking a dynamic position on a shape circle. [solved]

Post by CodeCode »

Yincognito wrote: August 19th, 2021, 1:39 pm Alternatively, if the "line" is short and having a longer arc of the same "path" as the circle is not needed, Roundline can do the job as well:

Code: Select all

[MeterShow2]
Meter=Roundline
MeasureName=Loop
X=100
Y=100
StartAngle=0
RotationAngle=(PI*2)
LineStart=95
LineLength=99
LineWidth=16
LineColor=0,0,255,255
Solid=0
AntiAlias=1
This will actually be a line (or rectangle, if you like), so if it's longer will step outside the circle's path, and for that death.crafter's solution (which would be my favorite as well, as it looks cool and all) is perfect. You can make it as thick as you want it though.
The actual use is simply to avoid using an image in a rotator meter. And since I have been using arc, line, shape in all sorts of ways - it just made sense at the time to use a very relatively small arc to mark a point that is in combination with several arcs and a roundline together.
Just trying to avoid images in this new version of a weather skin. Plus it is fun to get things working, and continue to learn. I am actually a bit shame I did not see the simplicity of the roundline option, but the fancy math is there to stay. :lol:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Marking a dynamic position on a shape circle. [solved]

Post by Yincognito »

CodeCode wrote: August 19th, 2021, 3:27 pm The actual use is simply to avoid using an image in a rotator meter. And since I have been using arc, line, shape in all sorts of ways - it just made sense at the time to use a very relatively small arc to mark a point that is in combination with several arcs and a roundline together.
Just trying to avoid images in this new version of a weather skin. Plus it is fun to get things working, and continue to learn. I am actually a bit shame I did not see the simplicity of the roundline option, but the fancy math is there to stay. :lol:
For sure! ;-) I only posted this because you mentioned trying with Roundline (and the math is simpler here) - other than that, like I said, I prefer death.crafter's approach as well: it has a bit more math, but you learn other ways to do it, and have something cool looking too. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth