It is currently April 18th, 2024, 3:30 am

Using Roundline to divide a full circle into 6 equal arcs [solution found]

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Using Roundline to divide a full circle into 6 equal arcs [solution found]

Post by Mor3bane »

Hello,

I am having trouble using roundline to divide a circle into 6 equal arcs - each arc will essentially be a button. The divisions will fall where normally the shape of a star's points would be.

I am ok using Roundline to show say a volume arc that changes with a mouse action, but the basic math of this division is confusing me. My hope would be that each arc would be a separate Roundline meter completing an overall circle. So each startangle and rotationangle are what is driving me bonkers - since there is no control measure - other than what I imagine to be a calc measure but the formula per se - I ain't getting it.

Any help gisting this out would be great.
Last edited by Mor3bane on January 15th, 2020, 1:06 pm, edited 1 time in total.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Using Roundline to divide a full circle into 6 equal arcs

Post by mak_kawa »

Something like this?

Code: Select all

[Rainmeter]
Update=-1

[Circle0-60]
Meter=Roundline
X=0
Y=0
W=100
H=100
StartAngle=(Rad(270))
RotationAngle=(Rad(60))
LineLength=40
LineColor=32,32,32,160
Solid=1

[Circle60-120]
Meter=Roundline
X=0
Y=0
W=100
H=100
StartAngle=(Rad(330))
RotationAngle=(Rad(60))
LineLength=40
LineColor=64,64,64,160
Solid=1

[Circle120-180]
Meter=Roundline
X=0
Y=0
W=100
H=100
StartAngle=(Rad(390))
RotationAngle=(Rad(60))
LineLength=40
LineColor=96,96,96,160
Solid=1

[Circle180-240]
Meter=Roundline
X=0
Y=0
W=100
H=100
StartAngle=(Rad(450))
RotationAngle=(Rad(60))
LineLength=40
LineColor=128,128,128,160
Solid=1

[Circle240-300]
Meter=Roundline
X=0
Y=0
W=100
H=100
StartAngle=(Rad(510))
RotationAngle=(Rad(60))
LineLength=40
LineColor=160,160,160,160
Solid=1

[Circle300-360]
Meter=Roundline
X=0
Y=0
W=100
H=100
StartAngle=(Rad(570))
RotationAngle=(Rad(60))
LineLength=40
LineColor=192,192,192,160
Solid=1
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Using Roundline to divide a full circle into 6 equal arcs

Post by Mor3bane »

Beautiful!

THANKS mak_kawa!

Exactly what I needed.

I got hung up on the decimal radians rather than your formulaic way.

:thumbup: :great: :rosegift:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using Roundline to divide a full circle into 6 equal arcs

Post by balala »

Mor3bane wrote: January 15th, 2020, 1:03 pm I got hung up on the decimal radians rather than your formulaic way.
Don't have to. Radians can be easily using, the only thing you have to know is that 1 PI = 180 degrees. So you can use the angles either expressed into degrees, converted to radians with a Rad() function, or expressed directly into radians and in this case you can use the PI constant:
[Circle0-60]
...
StartAngle=((9/2)*(PI/3))
RotationAngle=(PI/3)
;StartAngle=(Rad(270))
;RotationAngle=(Rad(60))
...

[Circle60-120]
...
StartAngle=((11/2)*(PI/3))
RotationAngle=(PI/3)
;StartAngle=(Rad(330))
;RotationAngle=(Rad(60))
...

[Circle120-180]
...
StartAngle=((1/2)*(PI/3))
RotationAngle=(PI/3)
;StartAngle=(Rad(30))
;RotationAngle=(Rad(60))
...

[Circle180-240]
...
StartAngle=((3/2)*(PI/3))
RotationAngle=(PI/3)
;StartAngle=(Rad(90))
;RotationAngle=(Rad(60))
...

[Circle240-300]
...
StartAngle=((5/2)*(PI/3))
RotationAngle=(PI/3)
;StartAngle=(Rad(150))
;RotationAngle=(Rad(60))
...

[Circle300-360]
...
StartAngle=((7/2)*(PI/3))
RotationAngle=(PI/3)
;StartAngle=(Rad(210))
;RotationAngle=(Rad(60))
...
Note that besides rewriting the angles into radians, I also decreased the values of StartAngle on the meters from [Circle120-180] to [Circle300-360], because the initial values have been going above 360. Definitely works this way as well, however not needed or useful, because from the point of view of the trigonometry, any angle is the same as the angle added with 360. For instance the StartAngle of the initial [Circle120-180] meter is StartAngle=(Rad(390)), which is the same as StartAngle=(Rad(390-360)) = StartAngle=(Rad(30)). So I reduced the angles which are larger than 360 degrees.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Using Roundline to divide a full circle into 6 equal arcs [solution found]

Post by mak_kawa »

Hi Mor3bane

Sorry for bringing up solved thread.

In the Roundline meter, apparent "fill" color of a sector is in fact defined by LineColor option. That is, maybe, the outline and "fill" colors of a sector can not be drawn separately.

So, I have made a code displaying sectors with independent outline and fill colors using the Shape meter.
Untitled-1.png

Code: Select all

[Rainmeter]
Update=-1

[Variables]
ArcRadius=50

[Circle0-60]
Meter=Shape
Shape=Path MyPath | Fill Color 32,32,32,192
MyPath=#ArcRadius#,0 | ArcTo (#ArcRadius#+(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#-(#ArcRadius#*Cos(Rad(60)))),#ArcRadius# | LineTo #ArcRadius#,#ArcRadius# | LineTo #ArcRadius#,0 | ClosePath 1

[Circle60-120]
Meter=Shape
Shape=Path MyPath | Fill Color 64,64,64,192
MyPath=(#ArcRadius#+(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#-(#ArcRadius#*Cos(Rad(60)))) | ArcTo (#ArcRadius#+(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#+(#ArcRadius#*Cos(Rad(60)))),#ArcRadius# | LineTo #ArcRadius#,#ArcRadius# | LineTo (#ArcRadius#+(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#-(#ArcRadius#*Cos(Rad(60)))) | ClosePath 1

[Circle120-180]
Meter=Shape
Shape=Path MyPath | Fill Color 96,96,96,192
MyPath=(#ArcRadius#+(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#+(#ArcRadius#*Cos(Rad(60)))) | ArcTo #ArcRadius#,100,#ArcRadius# | LineTo #ArcRadius#,100 | LineTo #ArcRadius#,#ArcRadius# | ClosePath 1

[Circle180-240]
Meter=Shape
Shape=Path MyPath | Fill Color 128,128,128,192
MyPath=#ArcRadius#,100 | ArcTo (#ArcRadius#-(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#+(#ArcRadius#*Cos(Rad(60)))),#ArcRadius# | LineTo #ArcRadius#,#ArcRadius# | LineTo #ArcRadius#,0 | ClosePath 1

[Circle240-300]
Meter=Shape
Shape=Path MyPath | Fill Color 160,160,160,192
MyPath=(#ArcRadius#-(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#+(#ArcRadius#*Cos(Rad(60)))) | ArcTo (#ArcRadius#-(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#-(#ArcRadius#*Cos(Rad(60)))),#ArcRadius# | LineTo #ArcRadius#,#ArcRadius# | LineTo (#ArcRadius#-(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#+(#ArcRadius#*Cos(Rad(60)))) | ClosePath 1

[Circle300-360]
Meter=Shape
Shape=Path MyPath | Fill Color 192,192,192,192
MyPath=(#ArcRadius#-(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#-(#ArcRadius#*Cos(Rad(60)))) | ArcTo #ArcRadius#,0,#ArcRadius# | LineTo #ArcRadius#,#ArcRadius# | LineTo (#ArcRadius#-(#ArcRadius#*Sin(Rad(60)))),(#ArcRadius#-(#ArcRadius#*Cos(Rad(60)))) | ClosePath 1
Possibly, this code can be written more smart...:-)

balala, I have not used PI constant with no reason... maybe I am lazy. :D
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using Roundline to divide a full circle into 6 equal arcs [solution found]

Post by balala »

mak_kawa wrote: January 16th, 2020, 12:42 am balala, I have not used PI constant with no reason... maybe I am lazy. :D
No, you are not. Probably it is not obvious for everyone it can be used, however it can easier very much the work you have to do.