Book a Demo

Author Topic: Arc and arcto in shape script  (Read 3839 times)

MichelV

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Arc and arcto in shape script
« on: June 17, 2013, 05:46:28 pm »
I created a new profile with a new stereotype and I'm now trying to create a shape using shape script, as described on http://www.sparxsystems.com/enterprise_architect_user_guide/10/extending_uml_models/add_shape_scripts_to_uml_profi.html

I now have the following:
Code: [Select]
shape main
{
  moveto(85,0);
  lineto(15,0);
  arc(0,0,30,60,15,0,15,60);
  moveto(15,60);
  lineto(85,60);
  arc(70,0,100,60,85,60,85,0);
}

Instead of using "arc" I would like to use arcto so I can use startpath(), endpath() and fill the shape using fillandstrokepath(). But it seems that arcto results in a completely different arc than the arc function.

Why does
Code: [Select]
moveto(15,0);
arcto(0,0,30,60,15,0,15,60);
result in a completely different arc line than:
Code: [Select]
arc(0,0,30,60,15,0,15,60);
Who can help me rewriting my shape script using arcto instead of arc, so I can have a filled shape?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Arc and arcto in shape script
« Reply #1 on: June 18, 2013, 08:57:34 am »
It looks like an issue with the preview window.

If I put in your script and replace arc with arcto it looks as you would expect on a diagram.

MichelV

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Arc and arcto in shape script
« Reply #2 on: June 18, 2013, 04:30:18 pm »
Thanks Simon. You're absolutely right. It is indeed only a problem with the preview window of the Shape Editor. If I use the new stereotype in a diagram the shape looks fine. Good to know!