You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Regina Henschel <rb...@t-online.de> on 2013/10/21 15:02:32 UTC

[Code] Expand class ImplB2DPolygon

Hi all,

I write to the list, because I think the list is more appropriate to 
discuss an idea than an issue.

Objects of the class ImplB2DPolygon are used to store the points, which 
are read from an svg:d attribute. This attribute is not only used in 
svg-graphics itself, but in dr3d:extrude, dr3d:rotate, draw:connector, 
draw:contour-path, draw:marker and draw:path.

After filled with the points, the information is lost, which part of the 
svg:d string has generated the point. This results in following problems:
* It is currently not possible to distinguish between a closed path and 
an open path, when first and last point coordinates are identical.
* It is not possible to distinguish between a path starting by a moveto 
command or starting with another command after a closepath command.
* It is not possible to notice, that not the whole path is closed, but 
the path ends in an unclosed path segment.
* It is not possible to distinguish between points, that origin in the 
svg:d attribute and those, which are added to draw a curve.

My proposal is to expand the class with a mpCommandVector, which can 
store for each point an additional information about the point's origin, 
for example
the command letter, when the point corresponds directly to a command 
letter in the svg:d string,
or a “internal” flag letter, for example when the point was generated by 
adding points to draw an arc.

With such additional information it would be possible to distinguish between
svg:d="M0,0 h20 v20 h-20 v-20" and svg:d="m0,0 h20 v20 h-20 z" (not 
closed or closed)
svg:d="M0,0 h20 v20 z M0,0 40,0" and svg:d="M0,0 h20 v20 z L40,0" ( 
different direction of markers)
and avoid mid-markers on pseudo vertices in svg:d="m10,50 a40,40 0 1,1 80,0"

Kind regards
Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Code] Expand class ImplB2DPolygon

Posted by Regina Henschel <rb...@t-online.de>.
Hi Andre,

Andre Fischer schrieb:
> On 21.10.2013 15:02, Regina Henschel wrote:
>> Hi all,
>>
>> I write to the list, because I think the list is more appropriate to
>> discuss an idea than an issue.
>>
>> Objects of the class ImplB2DPolygon are used to store the points,
>> which are read from an svg:d attribute. This attribute is not only
>> used in svg-graphics itself, but in dr3d:extrude, dr3d:rotate,
>> draw:connector, draw:contour-path, draw:marker and draw:path.
>>
>> After filled with the points, the information is lost, which part of
>> the svg:d string has generated the point. This results in following
>> problems:
>> * It is currently not possible to distinguish between a closed path
>> and an open path, when first and last point coordinates are identical.
>> * It is not possible to distinguish between a path starting by a
>> moveto command or starting with another command after a closepath
>> command.
>> * It is not possible to notice, that not the whole path is closed, but
>> the path ends in an unclosed path segment.
>> * It is not possible to distinguish between points, that origin in the
>> svg:d attribute and those, which are added to draw a curve.
>
> Can you tell us in what situations these items cause problems?

[SVG] marker-mid missing for empty closepath if first point equals last 
point
https://issues.apache.org/ooo/show_bug.cgi?id=123465

[SVG] marker-mid on pseudo vertices
https://issues.apache.org/ooo/show_bug.cgi?id=123433

[SVG] marker rotation wrong on line close line sequence in d attribute 
in path element
https://issues.apache.org/ooo/show_bug.cgi?id=123410

z command in d attribute in svg sets the 'current point' wrong
https://issues.apache.org/ooo/show_bug.cgi?id=119118

>
>>
>> My proposal is to expand the class with a mpCommandVector, which can
>> store for each point an additional information about the point's
>> origin, for example
>> the command letter, when the point corresponds directly to a command
>> letter in the svg:d string,
>> or a “internal” flag letter, for example when the point was generated
>> by adding points to draw an arc.
>
> Without knowing what the actual problem is, this looks like a hack. Is
> it possible to use a more direct approach, ie. if it is important to
> distinguish between geometrical and structural closedness (item 1) then
> add a flag to the path.  After all, you might be interested in this
> information even when the path was not read from an SVG string.

It has already a flag, but that is not enough to solve the case of 
unclosed path end (item 3).

Kind regards
Regina

>
> -Andre
>
>>
>> With such additional information it would be possible to distinguish
>> between
>> svg:d="M0,0 h20 v20 h-20 v-20" and svg:d="m0,0 h20 v20 h-20 z" (not
>> closed or closed)
>> svg:d="M0,0 h20 v20 z M0,0 40,0" and svg:d="M0,0 h20 v20 z L40,0" (
>> different direction of markers)
>> and avoid mid-markers on pseudo vertices in svg:d="m10,50 a40,40 0 1,1
>> 80,0"
>>
>> Kind regards
>> Regina


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Code] Expand class ImplB2DPolygon

Posted by Andre Fischer <aw...@gmail.com>.
On 21.10.2013 15:02, Regina Henschel wrote:
> Hi all,
>
> I write to the list, because I think the list is more appropriate to 
> discuss an idea than an issue.
>
> Objects of the class ImplB2DPolygon are used to store the points, 
> which are read from an svg:d attribute. This attribute is not only 
> used in svg-graphics itself, but in dr3d:extrude, dr3d:rotate, 
> draw:connector, draw:contour-path, draw:marker and draw:path.
>
> After filled with the points, the information is lost, which part of 
> the svg:d string has generated the point. This results in following 
> problems:
> * It is currently not possible to distinguish between a closed path 
> and an open path, when first and last point coordinates are identical.
> * It is not possible to distinguish between a path starting by a 
> moveto command or starting with another command after a closepath 
> command.
> * It is not possible to notice, that not the whole path is closed, but 
> the path ends in an unclosed path segment.
> * It is not possible to distinguish between points, that origin in the 
> svg:d attribute and those, which are added to draw a curve.

Can you tell us in what situations these items cause problems?

>
> My proposal is to expand the class with a mpCommandVector, which can 
> store for each point an additional information about the point's 
> origin, for example
> the command letter, when the point corresponds directly to a command 
> letter in the svg:d string,
> or a “internal” flag letter, for example when the point was generated 
> by adding points to draw an arc.

Without knowing what the actual problem is, this looks like a hack. Is 
it possible to use a more direct approach, ie. if it is important to 
distinguish between geometrical and structural closedness (item 1) then 
add a flag to the path.  After all, you might be interested in this 
information even when the path was not read from an SVG string.

-Andre

>
> With such additional information it would be possible to distinguish 
> between
> svg:d="M0,0 h20 v20 h-20 v-20" and svg:d="m0,0 h20 v20 h-20 z" (not 
> closed or closed)
> svg:d="M0,0 h20 v20 z M0,0 40,0" and svg:d="M0,0 h20 v20 z L40,0" ( 
> different direction of markers)
> and avoid mid-markers on pseudo vertices in svg:d="m10,50 a40,40 0 1,1 
> 80,0"
>
> Kind regards
> Regina
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Code] Expand class ImplB2DPolygon

Posted by Regina Henschel <rb...@t-online.de>.
Hi Armin,

Armin Le Grand schrieb:
>      Hi Regina,
>
> On 21.10.2013 15:02, Regina Henschel wrote:
>> Hi all,
>>
>> I write to the list, because I think the list is more appropriate to
>> discuss an idea than an issue.
>>
>> Objects of the class ImplB2DPolygon are used to store the points,
>> which are read from an svg:d attribute. This attribute is not only
>> used in svg-graphics itself, but in dr3d:extrude, dr3d:rotate,
>> draw:connector, draw:contour-path, draw:marker and draw:path.
>>
>> After filled with the points, the information is lost, which part of
>> the svg:d string has generated the point. This results in following
>> problems:
>> * It is currently not possible to distinguish between a closed path
>> and an open path, when first and last point coordinates are identical.
>> * It is not possible to distinguish between a path starting by a
>> moveto command or starting with another command after a closepath
>> command.
>> * It is not possible to notice, that not the whole path is closed, but
>> the path ends in an unclosed path segment.
>> * It is not possible to distinguish between points, that origin in the
>> svg:d attribute and those, which are added to draw a curve.
>>
>> My proposal is to expand the class with a mpCommandVector, which can
>> store for each point an additional information about the point's
>> origin, for example
>> the command letter, when the point corresponds directly to a command
>> letter in the svg:d string,
>> or a “internal” flag letter, for example when the point was generated
>> by adding points to draw an arc.
>>
>> With such additional information it would be possible to distinguish
>> between
>> svg:d="M0,0 h20 v20 h-20 v-20" and svg:d="m0,0 h20 v20 h-20 z" (not
>> closed or closed)
>> svg:d="M0,0 h20 v20 z M0,0 40,0" and svg:d="M0,0 h20 v20 z L40,0" (
>> different direction of markers)
>> and avoid mid-markers on pseudo vertices in svg:d="m10,50 a40,40 0 1,1
>> 80,0"
>
> It would be possible to do so, but B2DPolygon is a low-level tooling
> class and used in many places and should stay as simple as possible,
> while there is only one place where knowledge about the source of a
> created point is needed: Inside the SVG import. I already thought about
> this (you wrote a task for it, I saw and know it ;-) and the easiest way
> to solve this currently would be to extend the svg:d importer in basegfx
> to return a B2DPolyPolygon and (on demand evetually) a sequence of
> sequence of flags. The only use of this currently is to create markers
> for SVG, thus I would keep it to the places where it is needed.

That are good reasons.

>
> I would also like to wait to aw080, as I already said, the svg:d import
> is unified there and there is only one single svg:d importer left.
>
> HTH!

I'll be patient. I'm looking forward to the next round of testing aw080.

Kind regards
Regina


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Code] Expand class ImplB2DPolygon

Posted by Armin Le Grand <Ar...@me.com>.
     Hi Regina,

On 21.10.2013 15:02, Regina Henschel wrote:
> Hi all,
>
> I write to the list, because I think the list is more appropriate to 
> discuss an idea than an issue.
>
> Objects of the class ImplB2DPolygon are used to store the points, 
> which are read from an svg:d attribute. This attribute is not only 
> used in svg-graphics itself, but in dr3d:extrude, dr3d:rotate, 
> draw:connector, draw:contour-path, draw:marker and draw:path.
>
> After filled with the points, the information is lost, which part of 
> the svg:d string has generated the point. This results in following 
> problems:
> * It is currently not possible to distinguish between a closed path 
> and an open path, when first and last point coordinates are identical.
> * It is not possible to distinguish between a path starting by a 
> moveto command or starting with another command after a closepath 
> command.
> * It is not possible to notice, that not the whole path is closed, but 
> the path ends in an unclosed path segment.
> * It is not possible to distinguish between points, that origin in the 
> svg:d attribute and those, which are added to draw a curve.
>
> My proposal is to expand the class with a mpCommandVector, which can 
> store for each point an additional information about the point's 
> origin, for example
> the command letter, when the point corresponds directly to a command 
> letter in the svg:d string,
> or a “internal” flag letter, for example when the point was generated 
> by adding points to draw an arc.
>
> With such additional information it would be possible to distinguish 
> between
> svg:d="M0,0 h20 v20 h-20 v-20" and svg:d="m0,0 h20 v20 h-20 z" (not 
> closed or closed)
> svg:d="M0,0 h20 v20 z M0,0 40,0" and svg:d="M0,0 h20 v20 z L40,0" ( 
> different direction of markers)
> and avoid mid-markers on pseudo vertices in svg:d="m10,50 a40,40 0 1,1 
> 80,0"

It would be possible to do so, but B2DPolygon is a low-level tooling 
class and used in many places and should stay as simple as possible, 
while there is only one place where knowledge about the source of a 
created point is needed: Inside the SVG import. I already thought about 
this (you wrote a task for it, I saw and know it ;-) and the easiest way 
to solve this currently would be to extend the svg:d importer in basegfx 
to return a B2DPolyPolygon and (on demand evetually) a sequence of 
sequence of flags. The only use of this currently is to create markers 
for SVG, thus I would keep it to the places where it is needed.

I would also like to wait to aw080, as I already said, the svg:d import 
is unified there and there is only one single svg:d importer left.

HTH!

>
> Kind regards
> Regina
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org