Difference between revisions of "User:Regina/MYDrafts4"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Errors in Attribute draw:transform)
Line 118: Line 118:
 
[[File:TranslateX2komma5Y1.png|250px|thumb|left| A rectangle transformed with <tt>translate(2.5cm 1cm)</tt>]]
 
[[File:TranslateX2komma5Y1.png|250px|thumb|left| A rectangle transformed with <tt>translate(2.5cm 1cm)</tt>]]
 
|}
 
|}
 +
 +
== Problems with <tt>draw:gradient</tt>==
 +
 +
=== draw:style="radial" ===
 +
 +
ODF 1.2 specifies in section 19.218.2 <draw:gradient>
 +
 +
"radial: defines a gradient where the colors are blend along the radius from the center of a circle as defined with the draw:cx and draw:cy attributes. The outside of the circle is filled with the end color."
 +
 +
'''Problem'''
 +
 +
It is not clear, how large the circle is. Variants:
 +
 +
(1) The length of the diameter of the circle equals the length of the diameter of the bounding box, independent of the position of the center of the circle
 +
 +
(2) The length of the diameter of the circle equals the length of the shorter edge of the bounding box, independent of the position of the center of the circle
 +
 +
(3) The length of the diameter of the circle equals the length of the larger edge of the bounding box, independent of the position of the center of the circle
 +
 +
(4) The length of the radius of the circle equals the largest distance from the center of the circle to a corner of the bounding box.
 +
 +
(5) The length of the radius of the circle equals the smallest distance from the center of the circle to a corner of the bounding box.
 +
 +
All variants refer to the bounding box. Therefor that has to be defined too, which is especially needed for a path using Bézier-curves. Because the term "bounding box" is used in other places too, a common definition is needed.
 +
 +
Apache OpenOffice uses method (1). FYI, Microsoft PowerPoint 2010 uses the method (4) for the ppt file format.
 +
 +
'''Solution'''
 +
 +
Add sentence (1)

Revision as of 21:41, 11 August 2012

Problems With Angle Definitions in ODF1.2

Missing Definition of Orientation

ODF1.2 specification does not proper define orientation for drawings. Here are two suggestions.

Coordinate System

There are two common ways to orientate a Cartesian coordinate system.

mathematical orientation
screen orientation

Only when the orientation is determined, terms like "clockwise" are unambigious. Such orientation rule is missing in ODF 1.2.

Suggestion:

If a rule refers to a two-dimensional coordinate system, a Cartesian coordinate system in screen orientation (see figure ##) is used. The directions "clockwise", "counter clockwise", and the edge descriptions "left", "top", "right" and "button" are accordingly defined as shown in figures [##] to [##].

clockwise rotation of the vector (5 2) to vector (2 5)
The rectangle has the "top-left" vertex (1│2) and the "bottom-right" vertex (6│5).

Positive Orientation

This proposals is based on comments by Armin Le Grand on the mailing list ooo-dev@incubator.apache.org.

A rotation around the origin has a positive orientation, if it moves the point (1|0) from the positive part of the X-axis over the first quadrant of the coordinate system towards the point (0|1) on the positive part of the Y-axis. A rotation with positive orientation is described by a positive angle.

Advantage: This definition is independent of the orientation of the coordinate system. It leads on a coordinate system with “screen orientation” also to a clockwise rotation for a positive rotation angle.

PositiveDirectionMathematicalOrientation.png
PositiveDirectionScreenOrientation.png
Same definition by "moving from point (1|0) over first quadrant"

Errors in Attribute draw:transform

These suggestions are all about section 19.228. (Because of the Wiki markup I skipped the characters < and >).

I suggest to give for each single transformation value an example with reference to the corresponding transformation matrix and illustrate that example .

Original Problems and Suggestions
rotation by rotate-angle degrees AOO, LO and Microsoft Office use the angle in rad not in deg.

Suggestion: Deprecate the attribute draw:transform and use attribute svg:transform instead.

The whole original text is very near to SVG section 7, but a reference is missing.
matrix(a b c d e f), specifies a transformation in the form of a transformation matrix of six values. "The values describe a standard 3x2 homogeneous transformation matrix in column-major order, where the right column (e, f) describes the translation. Typo: The quotation mark before 'The values' has to be removed.

Problem: A standalone translation needs parameter with units. Here this rule is missing.

Suggestion: Add the sentence:

The values e and f are lengths (18.3.18).

rotate(rotate-angle), specifies a rotation by rotate-angle degrees about the origin of the shapes coordinate system. The orientation of the rotation is missing. I suggest not to use "clockwise" but to define it by an equivalent matrix.

Suggestion:

Example: The value rotate(30) corresponds to the transformation matrix

result of value rotate(30)
scale( sx [ sy ]), specifies a scale operation by sx and sy. It is not clear, that not only the object is scaled.

Suggestion:

Example: The value scale(0.2 0.5) corresponds to the transformation matrix

result of scale(0.2 0.5). Notice that visually the distances to the axes are scaled too.
skewX(skew-angle), specifies a skew transformation by rotate-angle degrees along the x-axis. Typo: "rotate-angle" should be "skew-angle". (Already tracked in OFFICE-3755.)

Here is neither clear between which rays the angle is measured, nor what direction is used.

Suggestion:

Example: The value skewX(25) corresponds to the transformation matrix

A rectangle transformed with skewX(25). This transformation is also known as "shear mapping".
skewY(skew-angle), specifies a skew transformation by rotate-angle degrees along the y-axis. Same as skewX, typo "rotate-angle" and unclear angle.

Suggestion:

Example: The value skewY(15) corresponds to the transformation matrix

A rectangle transformed with skewY(15)
translate( tx [ty]), specifies a translation by tx and ty, where tx and ty are lengths (18.3.18). In contrast to the other transformations, the parameters need a unit here. Therefore an example is useful.

Suggestion:

Example: The value translate(2.5cm 1cm) corresponds to the transformation matrix

A rectangle transformed with translate(2.5cm 1cm)

Problems with draw:gradient

draw:style="radial"

ODF 1.2 specifies in section 19.218.2 <draw:gradient>

"radial: defines a gradient where the colors are blend along the radius from the center of a circle as defined with the draw:cx and draw:cy attributes. The outside of the circle is filled with the end color."

Problem

It is not clear, how large the circle is. Variants:

(1) The length of the diameter of the circle equals the length of the diameter of the bounding box, independent of the position of the center of the circle

(2) The length of the diameter of the circle equals the length of the shorter edge of the bounding box, independent of the position of the center of the circle

(3) The length of the diameter of the circle equals the length of the larger edge of the bounding box, independent of the position of the center of the circle

(4) The length of the radius of the circle equals the largest distance from the center of the circle to a corner of the bounding box.

(5) The length of the radius of the circle equals the smallest distance from the center of the circle to a corner of the bounding box.

All variants refer to the bounding box. Therefor that has to be defined too, which is especially needed for a path using Bézier-curves. Because the term "bounding box" is used in other places too, a common definition is needed.

Apache OpenOffice uses method (1). FYI, Microsoft PowerPoint 2010 uses the method (4) for the ppt file format.

Solution

Add sentence (1)

Personal tools