mapper icon indicating copy to clipboard operation
mapper copied to clipboard

Automatic Dash Points (Feature Request)

Open arenol opened this issue 9 years ago • 14 comments

I am generally unhappy with the dash point implementation. Generally, I like to draw all lines without dash points, and then set the few dash points needed manually afterwards. However, OOM seem to switch on dash points mode ALLWAYS(?) whenever I select the curve tool in the right-click menu. It is quite annoying.

However, I believe it is possible to have a setting where dash points are added automatically. It should work in the following way:

  • [x] all curves are drawn without dash points (bug solved, see discussion below)
  • [ ] upon finishing a path, dash points are added automatically at points of extremal curvature, such as path bends, spur or reentrant tips and so forth. This is to prevent dash gaps at the these points.
  • [ ] Whenever the user starts or ends another path on an existing path, or the user shift-clicks on the path while drawing a path across it, dash points are automatically added at the junction points.

I don't think this is too difficult to implement, and it would improve the drawing experience a great deal.

Agnar

arenol avatar Jan 09 '16 19:01 arenol

Agree with @arenol . Dash points should be turned off by default for all tools except Rectangle.

yevhenmazur avatar Jan 09 '16 19:01 yevhenmazur

The term "dash point" is little bit overloaded. Which symbols are you referring to?

dg0yt avatar Jan 09 '16 20:01 dg0yt

Hm, you are right. dashed points turned on by default only for symbol 709.2 'Out-of-bounds area' and for my helper symbol (based on 709.2). Any way, can I turn off this behaviour somewhere in symbol settings?

yevhenmazur avatar Jan 09 '16 21:01 yevhenmazur

Dear Kai,

I'm referring to the dash points a long any line (I call lines 'paths' from Adobe Illustrator); those that are marked with a diamond when you select a feature. Automatic dash point generation would be very useful when drawing foot paths, form lines and other dashed features.

I think there's a bug in OOM. For the time beeing, whenever I select the "S" in the right click menu, I allways get dash point mode, meaning that every point I add becomes a dash point. It wasn't like that before, and I don't understand why (I've submitted another ticket for this).

Btw. I experienced a few crashes with 0.57, but 0.6 seems to be stable, although I haven't tested it for a long time.

Kind Regards, Agnar

On 09.01.2016 21:13, Kai Pastor wrote:

The term "dash point" is little bit overloaded. Which symbols are you referring to?

— Reply to this email directly or view it on GitHub https://github.com/OpenOrienteering/mapper/issues/582#issuecomment-170276367.

Agnar Renolen eMap as (www.emap.no) Vegamot 4B. 7049 Trondheim m: 489 50 480

arenol avatar Jan 11 '16 07:01 arenol

Dear Agnar,

I can't reproduce that dash points would always be turned on. As far as I can see, dash points are automatically activated for 516 Powerline (having a "dash point symbol"), but not for 506 Footpath (where the dash point is a particular way of drawing the line). So far the heuristics works as intented.

In addition to the existing behaviour, I understand that you ask for a convenient way for automatically adding junction style dash points at sharp path bends, and when creating a junction by starting a new path.

dg0yt avatar Jan 11 '16 08:01 dg0yt

On 11.01.2016 09:13, Kai Pastor wrote:

Dear Agnar,

I can't reproduce that dash points would /always/ be turned on. As far as I can see, dash points are automatically activated for 516 Powerline (having a "dash point symbol"), but not for 506 Footpath (where the dash point is a particular way of drawing the line). So far the heuristics works as intented.

I did work like that for a while on my computer. But now the logic is completely inverted. It seems that there is variable "toggling" in your code for the dash point mode, and that somehow the variable got inverted, so the code is toggling the variable the wrong way. It persists from session to session.

Maybe you can reproduce the problems by "inverting" the variable in a settings file?

It is really annoying, because I have to press the space bar every time I select the "S".

In addition to the existing behaviour, I understand that you ask for a convenient way for automatically adding junction style dash points at sharp path bends, and when creating a junction by starting a new path.

Yes, on the paths you snap to when starting or ending the new path, or crossing mid way.

Btw. adding dash points on the end of a foot path, will make the path dashing look strange in Ocad if you save to Ocad format.

Agnar

— Reply to this email directly or view it on GitHub https://github.com/OpenOrienteering/mapper/issues/582#issuecomment-170460692.

Agnar Renolen eMap as (www.emap.no) Vegamot 4B. 7049 Trondheim m: 489 50 480

arenol avatar Jan 11 '16 09:01 arenol

I can't see how it could be inverted: dash points are set in src/tool_draw_path.cpp, when a particular flag is set:

    if (draw_dash_points)
        coord.setDashPoint(true);

This flag is activated when the symbol is a line symbol and it has a dash symbol (and it is toggled by the space key):

void DrawPathTool::updateDashPointDrawing()
{
    if (is_helper_tool)
        return;

    Symbol* symbol = editor->activeSymbol();
    if (symbol && symbol->getType() == Symbol::Line)
    {
        // Auto-activate dash points depending on if the selected symbol has a dash symbol.
        // TODO: instead of just looking if it is a line symbol with dash points,
        // could also check for combined symbols containing lines with dash points
        draw_dash_points = (symbol->asLine()->getDashSymbol() != NULL);

        updateStatusText();
    }
    else if (symbol &&
        (symbol->getType() == Symbol::Area ||
         symbol->getType() == Symbol::Combined))
    {
        draw_dash_points = false;
    }
}

So there is no setting involved...

dg0yt avatar Jan 12 '16 05:01 dg0yt

The above code probably doesn't take properly into account the case that a dash symbol might be defined (!= NULL) but invisible: If I modify one of the 506 Footpath dash symbol dimensions, I end up with dash point mode defaulting to being activated. We need to clear the dash symbol when it is invisible.

dg0yt avatar Jan 12 '16 07:01 dg0yt

Makes sense...

Agnar

On 12.01.2016 08:39, Kai Pastor wrote:

The above code probably doesn't take properly into account the case that a dash symbol might be defined (|!= NULL|) but invisible: If I modify one of the 506 Footpath dash symbol dimensions, I end up with dash point mode defaulting to being activated. We need to clear the dash symbol when it is invisible.

— Reply to this email directly or view it on GitHub https://github.com/OpenOrienteering/mapper/issues/582#issuecomment-170825804.

Agnar Renolen eMap as (www.emap.no) Vegamot 4B. 7049 Trondheim m: 489 50 480

arenol avatar Jan 12 '16 08:01 arenol

You may now test the unstable build if it solves the problem with unwanted dash points for 709.2 and other line symbols. There are no dangerous changes since 0.6.1 in yesterday's build.

I edited the original post to reflect sub-issues. It will need more consideration: The new automatism could be unwanted for some other symbols. In the end, we could need additional settings.

dg0yt avatar Jan 14 '16 06:01 dg0yt

I'll look into it late this evening.

Agnar

Agnar Renolen eMap as (www.emap.no) Vegamot 4B, 7049 Trondheim tlf: 489 50 480 (dir)

On 14.01.2016 07:26, Kai Pastor wrote:

You may now test the unstable build if it solves the problem with unwanted dash points for 709.2 and other line symbols. There are no dangerous changes since 0.6.1 in yesterday's build.

I edited the original post to reflect sub-issues. It will need more consideration: The new automatism could be unwanted for some other symbols. In the end, we could need additional settings.

— Reply to this email directly or view it on GitHub https://github.com/OpenOrienteering/mapper/issues/582#issuecomment-171546798.

arenol avatar Jan 14 '16 13:01 arenol

That's better :-)

Agnar

On 14.01.2016 07:26, Kai Pastor wrote:

You may now test the unstable build if it solves the problem with unwanted dash points for 709.2 and other line symbols. There are no dangerous changes since 0.6.1 in yesterday's build.

I edited the original post to reflect sub-issues. It will need more consideration: The new automatism could be unwanted for some other symbols. In the end, we could need additional settings.

— Reply to this email directly or view it on GitHub https://github.com/OpenOrienteering/mapper/issues/582#issuecomment-171546798.

arenol avatar Jan 15 '16 19:01 arenol

I would welcome automatic dash points also on elipses. On the first point of input and also on the opposite side of elipse. As it is now - I must add dash points in these places anyway afterwards.

ollesmaps avatar Feb 06 '18 09:02 ollesmaps

Symbols (with mid symbols) and with many possible acute angles (fences, walls) would also benefit from automatic dash points.

ollesmaps avatar Feb 12 '21 10:02 ollesmaps