CodeCode wrote: ↑August 26th, 2021, 7:49 amThe thing I am struggling with is your variable MinMaxAngle is considering the full 360 for the max to rotate into, where my goal is only to use a 270 degree arc with, the aforementioned left side being both zero for celsius and 32 for fahrenheit, and the bottom center to be the max.
Well, I understood things the wrong way, since you'd actually be using the whole 360° circle arc, where the 270° part would only be from 0°C (at left center) to TMax°C (center bottom), but that had the benefit of adjusting things to work with partial "valid" arcs, through the AllCAngle variable (i.e. the total interval between TMin°C and TMax°C, in circle °). Anyway, what you envision is not impossible, but would involve either using a different arc length for a negative temp unit compared to a positive one, or changing the TMax°C and TMax°C to suit the arc length of the negative and positive temp intervals. The explanation is simple:
- you say that from 0°C to TMax°C you'd like a
270° arc (left center to center bottom) on the circle, therefore...
- what's left for the TMin°C to 0°C would be the remaining
90° arc (center bottom to left center) on the circle...
- but then, the total interval from TMin°C (-38°C) to TMax°C (60°C) in Celsius units is 98°C, meaning that when applied on the circle, the negative Celsius temps would take an arc of roughly (38/98)*360 =
140°, while the positive Celsius temps would take an arc of roughly (60/98)*360 =
220°
So, basically, the ratio between your expected 90° and 270° arcs will never be the same as the real 140° and 220° arcs corresponding to the TMin°C and TMax°C (i.e. -38°C and 60°C, respectively). To replicate the desired arc lengths would require, as I said, either changing TMin°C and TMax°C to something like -25°C and 75°C, -20°C and 60°C, -35°C and 105°C, or -40°C and 120°C (same 1/3 ratio like the expected arc lengths), or using different length arcs for negative temp units compared to positive temp units.
That being said, that's what 0°C to left center yields for the [-38°C ... 60°C] interval (notice how TMin°C & TMax°C are not at 270° compared to the 0°C, but about 50° less):
Code: Select all
[Variables]
Radius=97
MinC=-38
MaxC=60
AllCAngle=360
MinCAngle=40.4082
MaxCAngle=(#MinCAngle#+#AllCAngle#)
ZeroCAngle=(#MinCAngle#+Abs(#MinC#)/(Abs(#MinC#)+Abs(#MaxC#))*#AllCAngle#)
[Rainmeter]
Update=25
DynamicWindowSize=1
AccurateText=1
---Measures---
[TempC]
Measure=Loop
StartValue=#MinC#
EndValue=#MaxC#
Increment=1
MinValue=#MinC#
MaxValue=#MaxC#
DynamicVariables=1
[TempF]
Measure=Calc
Formula=(TempC*9/5+32)
MinValue=(#MinC#*9/5+32)
MaxValue=(#MaxC#*9/5+32)
DynamicVariables=1
---Meters---
[TempCircle]
Meter=Shape
X=3
Y=3
DynamicVariables=1
Shape=Ellipse 97,97,97,97 | Fill Color 0,0,0,1 | StrokeWidth 6 | Stroke Color 255,255,0,255
Shape2=Arc (#Radius#+#Radius#*Cos(Rad(#MinCAngle#-0.1))),(#Radius#+#Radius#*Sin(Rad(#MinCAngle#-0.1))), (#Radius#+#Radius#*Cos(Rad(#MinCAngle#+0.1))),(#Radius#+#Radius#*Sin(Rad(#MinCAngle#+0.1))), #Radius#, #Radius# | StrokeWidth 6 | Stroke Color 0,0,0,255 | StrokeStartCap Square | StrokeEndCap Square
Shape3=Arc (#Radius#+#Radius#*Cos(Rad(#MaxCAngle#-0.1))),(#Radius#+#Radius#*Sin(Rad(#MaxCAngle#-0.1))), (#Radius#+#Radius#*Cos(Rad(#MaxCAngle#+0.1))),(#Radius#+#Radius#*Sin(Rad(#MaxCAngle#+0.1))), #Radius#, #Radius# | StrokeWidth 6 | Stroke Color 128,128,128,255 | StrokeStartCap Square | StrokeEndCap Square
Shape4=Arc (#Radius#+#Radius#*Cos(Rad(#ZeroCAngle#-0.1))),(#Radius#+#Radius#*Sin(Rad(#ZeroCAngle#-0.1))), (#Radius#+#Radius#*Cos(Rad(#ZeroCAngle#+0.1))),(#Radius#+#Radius#*Sin(Rad(#ZeroCAngle#+0.1))), #Radius#, #Radius# | StrokeWidth 6 | Stroke Color 64,64,64,255 | StrokeStartCap Square | StrokeEndCap Square
Shape5=Arc (#Radius#+#Radius#*Cos(Rad(#MinCAngle#+#AllCAngle#*[TempC:%]/100-0.3))),(#Radius#+#Radius#*Sin(Rad(#MinCAngle#+#AllCAngle#*[TempC:%]/100-0.3))), (#Radius#+#Radius#*Cos(Rad(#MinCAngle#+#AllCAngle#*[TempC:%]/100+0.3))),(#Radius#+#Radius#*Sin(Rad(#MinCAngle#+#AllCAngle#*[TempC:%]/100+0.3))), #Radius#, #Radius# | StrokeWidth 6 | Stroke Color 0,0,255,255 | StrokeStartCap Round | StrokeEndCap Round
Shape6=Arc (#Radius#+#Radius#*Cos(Rad(#MinCAngle#+#AllCAngle#*[TempF:%]/100-0.2))),(#Radius#+#Radius#*Sin(Rad(#MinCAngle#+#AllCAngle#*[TempF:%]/100-0.2))), (#Radius#+#Radius#*Cos(Rad(#MinCAngle#+#AllCAngle#*[TempF:%]/100+0.2))),(#Radius#+#Radius#*Sin(Rad(#MinCAngle#+#AllCAngle#*[TempF:%]/100+0.2))), #Radius#, #Radius# | StrokeWidth 4 | Stroke Color 255,0,0,255 | StrokeStartCap Round | StrokeEndCap Round
LeftMouseUpAction=[!TogglePauseMeasure TempC]
DynamicVariables=1
[TempText]
Meter=String
X=100r
Y=100r
FontFace=Consolas
FontColor=255,255,255,255
FontSize=16
AntiAlias=1
StringAlign=CenterCenter
MeasureName=TempC
MeasureName2=TempF
NumOfDecimals=0
Text="Temperature#CRLF#%1°C#CRLF#%2°F"
DynamicVariables=1
Temp -38C to 60C.jpg
and this is what an interval of [-35°C ... 105°C] looks like:
Code: Select all
MinC=-35
MaxC=105
AllCAngle=360
MinCAngle=90
Temp -35C to 105C.jpg
or, for just a 270° total valid circle interval (see how TMin and TMax are separated below), and [-40°C ... 80°C] temp interval (can be any negative-positive interval with a 1/2 ratio, like [-30°C ... 60°C], since 90° on the circle are negative temps and 180° are positive ones):
Code: Select all
MinC=-40
MaxC=80
AllCAngle=270
MinCAngle=90
Temp -40C to 80C, 270 degrees total arc.jpg
The above goes for Fahrenheit as well - I wouldn't even bother to consider different negative and positive unit lengths on the circle, that just feels so wrong. In your skin you only need to get the C temp and have a Calc measure to convert it to F (or viceversa, but the measures would have to be swapped / adjusted acordingly), and the desired Shapes - I let the the hiding / showing meters in your care, as you know best how you want it to look and behave.