Reply to topic

Angle in <draw:custom-shape> in .odg

reginahenschel
Registered Member
Posts
4
Karma
0
Hi,

this is a question to developers, but I do not know how to contact them.

I have get two <draw:custom-shape> objects in an .odg file. The file opens in Karbon and shows the shapes. But the shapes are different, where I think they should look the same.
The essential parts of the shapes are

Shape A
------------
<draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-point-type="segments" draw:type="non-primitive" draw:modifiers="30 75" draw:enhanced-path="V 0 0 21600 21600 ?f1 ?f3 ?f5 ?f7 L 10800 10800 N">
<draw:equation draw:name="f0" draw:formula="10800*cos($0 *(pi/180))"/>
<draw:equation draw:name="f1" draw:formula="?f0 +10800"/>
<draw:equation draw:name="f2" draw:formula="10800*sin($0 *(pi/180))"/>
<draw:equation draw:name="f3" draw:formula="?f2 +10800"/>
<draw:equation draw:name="f4" draw:formula="10800*cos($1 *(pi/180))"/>
<draw:equation draw:name="f5" draw:formula="?f4 +10800"/>
<draw:equation draw:name="f6" draw:formula="10800*sin($1 *(pi/180))"/>
<draw:equation draw:name="f7" draw:formula="?f6 +10800"/>
<draw:handle draw:handle-position="10800 $0" draw:handle-polar="10800 10800"/>
<draw:handle draw:handle-position="10800 $1" draw:handle-polar="10800 10800"/>
</draw:enhanced-geometry>

Shape B
------------
<draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-point-type="segments" draw:type="non-primitive" draw:modifiers="30 75" draw:enhanced-path="U 10800 10800 10800 10800 $0 $1 L 10800 10800 N">
<draw:handle draw:handle-position="10800 $0" draw:handle-polar="10800 10800"/>
<draw:handle draw:handle-position="10800 $1" draw:handle-polar="10800 10800"/>
</draw:enhanced-geometry>


My question is, why they are different.
Do you use for implementation the ODF specification directly? Or do you want to mimic the behavior of other applications? Or is my opinion, that the shapes look the same, wrong; and if yes, why?
danders
Registered Member
Posts
24
Karma
0
Yes, seems you are right, we do the same as LO and I know they've got rotation and skew wrong, so...
I'll have a look as soon as I find the time.
danders
Registered Member
Posts
24
Karma
0
Ok, had a look at this, even checked out if there were any relevant LO bugs, and found one that a certain reginahenschel had worked on :)
Assuming that is you, you probably know a lot more about this than I do.
But here is my findings so far:
1) Calligra draws the U (and T) commands counter-clockwise, which should be clockwise according to spec.
I think this is because OO did this, but it was implemented so long ago in calligra that it is difficult to trace.
2) Angles in functions (like cos()) is assumed to be in radians, but should be degrees according to spec.
3) Polar handles seems to assume angles are clockwise, so specifying a handle at 90 deg will draw it at -90 deg.

My assumption here is that coordinate systems should operate counter-clockwise as I have not found anything else in the odf spec.
(I know rotation/skew is different but that is specified in the svg spec)

Any comments on how to handle this?
reginahenschel
Registered Member
Posts
4
Karma
0
I personally want to change it in LibreOffice so that the arc is drawn clockwise and the angles in the arc are interpreted the same way as in polar handles. But I still gather information and opinions. Therefore the report here.
danders
Registered Member
Posts
24
Karma
0
+10 from me ;)

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], everwaerde, Google [Bot], hiteshshah, Mamarok, millaan, philippea, raphaelra, Sanette, Vangelis62, Yahoo [Bot]

cron