Alright, thanks for the effort. Sooner or later I'll post a description to the Bugs section, unless I'm getting a reply here from a dev.Yincognito wrote: ↑June 5th, 2021, 8:44 pm So much for my perfect workaround, LMAO. After the CurveTo experiment, I'm not sure the culprit is the SweepDirection parameter of arcs anymore, since cubic Bezier curves like this lack that parameter in Rainmeter. It seems the problem has a greater extent than I thought, and more shapes are affected, just like death.crafter stated earlier...
It is currently March 28th, 2024, 2:18 pm
Mouth shape question
- balala
- Rainmeter Sage
- Posts: 16109
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Mouth shape question
- Yincognito
- Rainmeter Sage
- Posts: 7022
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mouth shape question
No problem. For the record, swapping the 1st ArcTo with the 2nd doesn't work either. I'm curious about what the devs will find about this and which is the actual culprit, so I'll patiently wait for their answer. It'll be difficult to give up trying to fix this though, it's just not my style of backing off in front of a problem where I feel a reasonable solution is within grasp.
- ikarus1969
- Posts: 571
- Joined: February 28th, 2011, 3:20 pm
- Location: Vienna, Austria
Re: Mouth shape question
When you add the option StrokeLineJoin Round to your Shape then you get the following result. Isn't that what you want?
the code would be:
the code would be:
Code: Select all
[Rainmeter]
Update=-1
BackgroundMode=2
SolidColor=220,220,220
SkinWidth=140
SkinHeight=200
[MeterMouth1]
Meter=Shape
X=0
Y=0
Shape=Path MyPath | StrokeWidth 2 | Stroke Color 0,0,0 | Fill Color 255,255,255 | StrokeLineJoin Round
MyPath=10,65 | ArcTo 130,65,60,20,0,1,0 | ArcTo 10,65,60,80,1,0,0
- Yincognito
- Rainmeter Sage
- Posts: 7022
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mouth shape question
I'll let balala answer that, but for the record, though an excellent alternative workaround, this does pretty much the same as my additional LineTo segment, in that it "just" alleviates the problem and does not "fix" it - something easily seen when one increases the StrokeWidth from 2 to, say, 10 (scroll to see the similarity and the differences between the two current workarounds, i.e. mine and yours):ikarus1969 wrote: ↑June 6th, 2021, 11:49 amWhen you add the option StrokeLineJoin Round to your Shape then you get the following result. Isn't that what you want?
Code: Select all
[Variables]
Style=0
[Rainmeter]
Update=-1
BackgroundMode=2
SolidColor=220,220,220
SkinWidth=140
SkinHeight=200
[Style0]
Shape=Path MyPath | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255
MyPath=10,65 | ArcTo 130,65,60,20,0,1,0 | LineTo 130,65 | ArcTo 10,65,60,80,0,0,0
[Style1]
Shape=Path MyPath | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255 | StrokeLineJoin Round
MyPath=10,65 | ArcTo 130,65,60,20,0,1,0 | ArcTo 10,65,60,80,0,0,0
[MeterMouth]
Meter=Shape
X=0
Y=0
MeterStyle=Style#Style#
MouseScrollUpAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw]
MouseScrollDownAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw]
DynamicVariables=1
P.S. On the upside, at least now we know there is more than one way to achieve the desired outcome for lower StrokeWidth values.
- Yincognito
- Rainmeter Sage
- Posts: 7022
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mouth shape question
Yincognito wrote: ↑June 5th, 2021, 8:44 pmIn the search for the perfect workaround (I like perfection as you probably remember, LOL)...
Well, it seems a good night sleep is a good adviser, after all. I found the perfect workaround, which doesn't produce any unwanted artefacts irrespective of the StrokeWidth value. I knew the key to this was to make the shape parts intersect "better" so that they "fully" cross-over one another and a higher stroke width won't cause loosing the actual intersection point (rounding errors, maybe?) and it was clear the ArcTo and CurveTo in the Path option were not doing any of the above, so I returned to basics. Arcs are simulated in Rainmeter by intersecting two ellipses in various ways, so drawing ellipses and intersecting them instead of drawing arcs is more or less the same, but it makes the problem go away ... as long as those ellipses FULLY cross over one another (optionally taking a bit of StrokeWidth leeway into account):Yincognito wrote: ↑June 5th, 2021, 9:16 pmIt'll be difficult to give up trying to fix this though, it's just not my style of backing off in front of a problem where I feel a reasonable solution is within grasp.
Code: Select all
[Variables]
Style=0
[Rainmeter]
Update=-1
BackgroundMode=2
SolidColor=220,220,220
SkinWidth=140
SkinHeight=200
[Style0]
Shape=Path MyPath | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255
MyPath=10,65 | ArcTo 130,65,60,20,0,1,0 | ArcTo 10,65,60,80,0,0,0
[Style1]
Shape=Ellipse 70,65,60,80 | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255 | StrokeLineJoin Round
Shape2=Ellipse 70,0,100,85
Shape3=Combine Shape | Exclude Shape2
[MeterMouth]
Meter=Shape
X=0
Y=0
MeterStyle=Style#Style#
MouseScrollUpAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw]
MouseScrollDownAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw]
DynamicVariables=1
Comparison - before: Comparison - after: P.S. I took the liberty to use ikarus1969's suggestion regarding rounding the line join in order to "smooth" the intersection points. It works without it too, but I feel it looks better this way.
P.S.S. There's only one possible drawback to this solution, if one has DynamicWindowSize=1 in the [Rainmeter] section and the larger ellipse makes the skin larger as well, but then these things can be fixed by placing stuff in a container. Not that nice, but it will work.
- balala
- Rainmeter Sage
- Posts: 16109
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Mouth shape question
Thanks ikarus, I'm gonna test this tomorrow afternoon (UTC+3), because today had a full day and had no enough time to test it. Hope it'll help, but tomorrow I'll let you know.ikarus1969 wrote: ↑June 6th, 2021, 11:49 am When you add the option StrokeLineJoin Round to your Shape then you get the following result. Isn't that what you want?
Yincognito wrote: ↑June 6th, 2021, 1:29 pm I'll let balala answer that, but for the record, though an excellent alternative workaround, this does pretty much the same as my additional LineTo segment, in that it "just" alleviates the problem and does not "fix" it - something easily seen when one increases the StrokeWidth from 2 to, say, 10 (scroll to see the similarity and the differences between the two current workarounds, i.e. mine and yours):
Will test your codes as well, as said to ikarus today had no time. Sorry...Yincognito wrote: ↑June 6th, 2021, 2:39 pm Well, it seems a good night sleep is a good adviser, after all. I found the perfect workaround, which doesn't produce any unwanted artefacts irrespective of the StrokeWidth value. I knew the key to this was to make the shape parts intersect "better" so that they "fully" cross-over one another and a higher stroke width won't cause loosing the actual intersection point (rounding errors, maybe?) and it was clear the ArcTo and CurveTo in the Path option were not doing any of the above, so I returned to basics. Arcs are simulated in Rainmeter by intersecting two ellipses in various ways, so drawing ellipses and intersecting them instead of drawing arcs is more or less the same, but it makes the problem go away ... as long as those ellipses FULLY cross over one another (optionally taking a bit of StrokeWidth leeway into account):
- Yincognito
- Rainmeter Sage
- Posts: 7022
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
- balala
- Rainmeter Sage
- Posts: 16109
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Mouth shape question
Finally had today enough time to check everything is needed. Your idea seems excelent, it does the job properly, so this is what I'm gonna use. Thank you very much for it.ikarus1969 wrote: ↑June 6th, 2021, 11:49 am When you add the option StrokeLineJoin Round to your Shape then you get the following result. Isn't that what you want?
However I'm posting the description of this issue into the Bugs & Feature Suggestions section as well. I'm curious about what devs will say. Let's see...
- balala
- Rainmeter Sage
- Posts: 16109
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Mouth shape question
Besides ikarus1969's code, yours is interesting as well. However it might be a little bit more complicated (since the drawn mouth I'm realizing will be used into a more complex Shape meter, which will have more other shapes, which will be combined), so I'm gonna use ikarus1969's code. But thank you for the help. It's valuable as well.Yincognito wrote: ↑June 6th, 2021, 2:39 pm Well, it seems a good night sleep is a good adviser, after all. I found the perfect workaround, which doesn't produce any unwanted artefacts irrespective of the StrokeWidth value. I knew the key to this was to make the shape parts intersect "better" so that they "fully" cross-over one another and a higher stroke width won't cause loosing the actual intersection point (rounding errors, maybe?) and it was clear the ArcTo and CurveTo in the Path option were not doing any of the above, so I returned to basics. Arcs are simulated in Rainmeter by intersecting two ellipses in various ways, so drawing ellipses and intersecting them instead of drawing arcs is more or less the same, but it makes the problem go away ... as long as those ellipses FULLY cross over one another (optionally taking a bit of StrokeWidth leeway into account):The default Style0 is the original form of the code with ArcTo-s (no workaround applied), while Style1 is the proper (but temporary, until the devs correct this) fix - mouse scroll to switch from one to another. The 1st ellipse is just the same as the 2nd ArcTo (bar the CenterX that is easy to calculate), but the having the 2nd ellipse larger so that it properly intersects the 1st one - which apparently doesn't happen in the ArcTo scenario - is the thing that does the trick. Using a smaller or a similar ellipse to the 1st ArcTo won't work, simply because due to unknown factors (rounding errors might possibly be the culprit here) the smaller ellipse won't properly "touch" or "cut" the 1st ellipse at the desired intersection points. It changes a bit the parameters one works with, true, but it completely solves the problem.Code: Select all
[Variables] Style=0 [Rainmeter] Update=-1 BackgroundMode=2 SolidColor=220,220,220 SkinWidth=140 SkinHeight=200 [Style0] Shape=Path MyPath | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255 MyPath=10,65 | ArcTo 130,65,60,20,0,1,0 | ArcTo 10,65,60,80,0,0,0 [Style1] Shape=Ellipse 70,65,60,80 | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255 | StrokeLineJoin Round Shape2=Ellipse 70,0,100,85 Shape3=Combine Shape | Exclude Shape2 [MeterMouth] Meter=Shape X=0 Y=0 MeterStyle=Style#Style# MouseScrollUpAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw] MouseScrollDownAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw] DynamicVariables=1
Comparison - before:
Comparison - Before.jpg
Comparison - after:
Comparison - After.jpg
P.S. I took the liberty to use ikarus1969's suggestion regarding rounding the line join in order to "smooth" the intersection points. It works without it too, but I feel it looks better this way.
P.S.S. There's only one possible drawback to this solution, if one has DynamicWindowSize=1 in the [Rainmeter] section and the larger ellipse makes the skin larger as well, but then these things can be fixed by placing stuff in a container. Not that nice, but it will work.
- Yincognito
- Rainmeter Sage
- Posts: 7022
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mouth shape question
Of course - go ahead and use the most suited choice for your case. I only wanted to show that one can workaround in such a way to completely eliminate the problem. In any case, these workarounds will be obsolete once the devs fix the bug, so they only serve as temporary solutions (and challenges).balala wrote: ↑June 8th, 2021, 6:49 pm Besides ikarus1969's code, yours is interesting as well. However it might be a little bit more complicated (since the drawn mouth I'm realizing will be used into a more complex Shape meter, which will have more other shapes, which will be combined), so I'm gonna use ikarus1969's code. But thank you for the help. It's valuable as well.