lilypond-auto
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5307 Skyline


From: Auto mailings of changes to Lily Issues via Testlilyissues-auto
Subject: [Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5307 Skyline Refinements (Rounded Boxes and Rotated Ellipses)
Date: Fri, 20 Apr 2018 15:12:07 -0000

(1) Rotating Ellipses

This was rather a side-effect when working on boxes with rounded corners.
Ellipse skylines are built out of a number of rectangular boxes and the number of boxes needed is depending on the circumference: the longer the line, the more intermediate points are needed.

Where's the problem in the current code?
The calculation of the circumference takes care of scaling, because, naturally, a larger ellipse needs more intermediate points than a smaller one.
In the current circumference calculation, the radii (in x and y direction) are scaled by just using the xx resp. yy value of the transformation matrix, which actually results in the projection on the x or y axis.
If there is any rotation involved, the calculation of the scaled radii is wrong because using the projection on one axis only gives back a shortened radius length.

Consequently, the estimated circumference is too short, even becoming 0 when 90° are approached, so that rotating decreases the number of points used for drawing the skyline.
But the circumference of an ellipse does not change when just being rotated.

There is a PNG file attached comparing the original scale factors (2.19.81) and corrected scale factors (from my 2.21.0 development branch). You can see how the number of intermediate points decreases as the angle increases, resulting in a total collapse of the skyline.

Solution
Use the length of the transformed x/y unit vectors as scaling factors. With the corrected scale factors, the skylines are stable and consistent even when rotated.

Attachments:


[issues:#5307] Skyline Refinements (Rounded Boxes and Rotated Ellipses)

Status: Started
Labels: re
Created: Sun Apr 15, 2018 09:46 PM UTC by Torsten Hämmerle
Last Updated: Mon Apr 16, 2018 03:39 AM UTC
Owner: Torsten Hämmerle
Attachments:

Recently, there have been some discussions about mysterious spacing of \rounded-box markup.

Harm identified skyline problems as the cause and submitted the following bug report:
Possible regression with box-markup/rounded-box-markup
Before Mike Solomon's new skyline handling, there were no such uninteded extra margins.

Rounded Box Skylines

The skyline of boxes with rounded corners do not tightly wrap the boxes but there's an unintentional margin (as wide as the corner radius).

Apart from that here are a few other shortcomings and so I have decided to create a more general box-and-rotated-ellipses skyline issue.

Other issues

When working on this case, I came across a few other things that call for improvement and so I've included them into the test file. Most notably, there is a general problem with rotation. And it would be nice to recreate the rounded corners for large boxes/radii.
At the same time, one should keep run-of-the-mill stuff like ledger lines as simple and fast as possible.

Test file

A file with 'debug-skylines switched on and TextScript padding values set to 0 in order to be able to check how the markup objects are fitted together.
I have tried to demonstrate about everything you cold do with boxes (including scaling, rotating, cominations thereof).

#(ly:set-option 'debug-skylines #t)

{
  \set Staff.instrumentName = \markup #(lilypond-version)
  \override Staff.TextScript.padding = 0
  \override Staff.TextScript.outside-staff-padding = 0
  \override Staff.TextScript.outside-staff-horizontal-padding = 0
  \override Staff.TextScript.self-alignment-X = #CENTER
  \override Staff.TextScript.layer = 0
  f'''4
  c'' ^\markup \override #'(thickness . 4) \box \teeny 1
      _\markup \with-color #grey \filled-box #'(-1 . 4) #'(1 . 4) #1
  b'  ^\markup \rounded-box "2!" ^\markup \rounded-box "3"
  d'' ^\markup \circle "*" ^\markup \rotate #90 \ellipse "Elli"
      _\markup \with-color #grey \rotate #10 \filled-box #'(-2 . 5) #'(1 . 4) #10
      _ \markup \rotate #36 \override #'(corner-radius . 20) \scale #'(1 . 0.4)
                \rotate #-68 \scale #'(1.6 . 1) \rounded-box "dop"
  f'' _\markup \override #'(corner-radius . 0.5) \rounded-box "."
  a'  ^\markup \rotate #30 \rounded-box "rotated a"
      _\markup \scale #'(1 . 1.5) \rotate #45 \override #'(thickness . 5)
               \rounded-box \rotate #-45 \scale #'(2 . 1) \bold "!"
  d'' _\markup \override #'(corner-radius . 20) \rounded-box "4"
  a'' ^\markup \rotate #-165 \box "rotated b"
      _\markup \rotate #180 \override #'(corner-radius . 20) \rounded-box \teeny
               \override #'(baseline-skip . 0) \center-column { "Upside" "Down" }
}

(see attached PNG file)


Sent from sourceforge.net because address@hidden is subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/testlilyissues/admin/issues/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Testlilyissues-auto mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto

reply via email to

[Prev in Thread] Current Thread [Next in Thread]