Book a Demo

Author Topic: Certain line styles do not honour the shapescript code  (Read 5448 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Certain line styles do not honour the shapescript code
« on: January 16, 2019, 12:33:54 pm »
We are investigating presentation style diagrams (to hopefully, reduce the need for diagrams from presentation software).

We are looking at creating very wide lines (for example Width 25).  We are able to force the value via the DB - so OK.  However, this leaves a rounded end which overlays the origin and destination vertices (as in the incorrect diagram below).  No problem, we can change the Shapescript to reduce the length of the drawn line by the requisite amount.
Code: [Select]
Shape main
{
noshadow = true;
setlinestyle("SOLID");
setpenwidth(getUserPenSize());
setpencolor(0,255,0);
moveto(9,0);
lineto(91,0);
}
For this particulare example, we reduced the visible line by 9 pixels.  To produce the acceptable line shown in the first diagram.  We can then overlay shapes at either end to achieve our desired result.  We tried with direct and custom line styles and "all good".



Imagine our surprise when we tried the other line styles and found they DON'T honour the Shapescript code.



Reported,
Paolo
« Last Edit: January 16, 2019, 12:37:58 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

matthew.james

  • EA User
  • **
  • Posts: 155
  • Karma: +8/-3
  • Am I supposed to say something here ... ?
    • View Profile
Re: Certain line styles do not honour the shapescript code
« Reply #1 on: January 16, 2019, 01:51:02 pm »
@Paolo - I can't help with your problem below (sorry), however I am interested in understanding what you are trying to achieve with presentation style diagrams.

I gather from the issue below that you are looking for a different (simplified) style and perhaps simplified types of diagrams ?
Do you have any examples of the sorts of diagrams you are trying to create?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Certain line styles do not honour the shapescript code
« Reply #2 on: January 16, 2019, 02:11:46 pm »
The "main" shape script corresponds to the "center" segment of any connector.

The other segments are drawn by EA using a style derived from your shape script.

BTW. You didn't reduce the visible line by 9 pixels. You reduced it by 9% of the total length at each end. Even if the script magically knew how to draw your script around a bend it still wouldn't behave like you hoped.
« Last Edit: January 16, 2019, 02:21:11 pm by Eve »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Certain line styles do not honour the shapescript code
« Reply #3 on: January 16, 2019, 05:04:08 pm »
The "main" shape script corresponds to the "center" segment of any connector.

The other segments are drawn by EA using a style derived from your shape script.

BTW. You didn't reduce the visible line by 9 pixels. You reduced it by 9% of the total length at each end. Even if the script magically knew how to draw your script around a bend it still wouldn't behave as you hoped.
Ah yes,... The old "Centre section" problem.

Accepting that "this is the way it is"  :P,  I'll stick to the two working types.

I get confused by the values, sometimes they're pixels and sometimes they're not.

I think I can get it working for the two line styles I have.  I'll check for varying the length of the line.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Certain line styles do not honour the shapescript code
« Reply #4 on: January 25, 2019, 05:48:51 pm »
@Paolo - I can't help with your problem below (sorry), however, I am interested in understanding what you are trying to achieve with presentation style diagrams.

I gather from the issue below that you are looking for a different (simplified) style and perhaps simplified types of diagrams?
Do you have any examples of the sorts of diagrams you are trying to create?
Hi Matthew,
See: Presentation Models and Diagrams

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!