Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: Screwtape on November 08, 2014, 02:40:32 am

Title: Improve Shape Script!
Post by: Screwtape on November 08, 2014, 02:40:32 am
Hi!

I'm trying to improve on the embarrassing "cylinder" used for servicebus stereotypes.

However, having read the shapescript documentation, I can't see any way of finding out the size or aspect ratio of the object being laid-out.

You also can set scaling either on, fixed aspect, or off. I've even tried to add a sub-shape with fixed aspect, within a non-fixed main shape, but that doesn't work either.

I'm told on the forum, that shapescript doesn't have any arithmetic or the ability to scale components of the shape differently from the whole.

This makes it impossible to define any usable shapes that scale in non-linear or aspect dependant way. It means you couldn't, for example, use shapescript to create a "Node" box, which scales relating to the size of the front face, but not the "depth" of the box.

This really need to be improved! Please give me a way of showing a professional looking cylinder!
Title: Re: Improve Shape Script!
Post by: qwerty on November 08, 2014, 03:15:44 am
It would simply help if shape script had basic arithmetics. That would en passant allow to calculate aspect ratio (and much more).

q.
Title: Re: Improve Shape Script!
Post by: Sunshine on November 10, 2014, 07:51:08 am
I agree that it needs improving. As the shapescript is c-like language it would be good if the shape script language could be added as an extension/library to one of the scripting languages already supported like jscript or javascript. That way you get the arithmetic and logic features of these languages we've learned to love of the years. Just a thought.  :)
Title: Re: Improve Shape Script!
Post by: KP on November 10, 2014, 09:16:00 am
Here's a cylinder:

Code: [Select]
shape main
{
      startpath();
      moveto(90,0);
      lineto(15,0);
      arcto(0,0,30,100,15,0,15,100);
      lineto(90,100);
      endpath();
      fillandstrokepath();
      ellipse(80,0,100,100);
}
Title: Re: Improve Shape Script!
Post by: qwerty on November 10, 2014, 06:33:00 pm
Sure, but the OP wants one with fixed aspect ratio (as icon inside a shape).

q.
Title: Re: Improve Shape Script!
Post by: Screwtape on November 12, 2014, 03:03:37 am
Thanks for the example KP - it's made demonstrating my issue much easier.

(http://s21.postimg.org/bg9jwtxlz/Cylinder_Example.png)

In order to make a good looking service bus cylinder it is necessary that the curves of the shape are related only to the height of the shape and not the width. Since by definition, service bus shapes are often long and narrow, they look rather stupid on EA if they look like the bottom one.

It would seem that this can't be done with Shape Script at present, which really rather limits what it can do with it. As Sunshine says, there are already fully functional scripting engines in EA, so use them for drawing too!