Author Topic: Improve Shape Script!  (Read 5194 times)

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Improve Shape Script!
« 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!
Screwtape

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Improve Shape Script!
« Reply #1 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.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1324
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Improve Shape Script!
« Reply #2 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.  :)
Happy to help
:)

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Improve Shape Script!
« Reply #3 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);
}
The Sparx Team
[email protected]

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Improve Shape Script!
« Reply #4 on: November 10, 2014, 06:33:00 pm »
Sure, but the OP wants one with fixed aspect ratio (as icon inside a shape).

q.

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Re: Improve Shape Script!
« Reply #5 on: November 12, 2014, 03:03:37 am »
Thanks for the example KP - it's made demonstrating my issue much easier.



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!
Screwtape