Half ellipse geometry

Hi @walter, please generate and share “half ellipse geometry String”, starting from left to rigth and other one from right to left

Do you mean something like the “HalfEllipse” figure in the GoJS Shapes sample?

That, along with all of those other shapes, are defined in https://gojs.net/latest/extensions/Figures.js

In that particular case, it’s:

var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);

go.Shape.defineFigureGenerator("HalfEllipse", function(shape, w, h) {
  return new go.Geometry()
         .add(new go.PathFigure(0, 0, true)
              .add(new go.PathSegment(go.PathSegment.Bezier, w, .5 * h, KAPPA * w, 0, w, (.5 - KAPPA / 2) * h))
              .add(new go.PathSegment(go.PathSegment.Bezier, 0, h, w, (.5 + KAPPA / 2) * h, KAPPA * w, h).close()))
         .setSpots(0, 0.156, 0.844, 0.844);
});

You can adapt this code to define figures for the other three directions.

Hi @walter thanks for reply

I was asking regarding this examples

https://gojs.net/latest/intro/geometry.html

I want to use half ellipse from left to right and othe half from right to left
So In this example go.js shape is showing based on geometryString, half ellipse geometryString I am unable to generate from left to right and from right to left
If it is possible please generate and share

Thanks

Just create a Shape of a desired size with that “HallfEllipse” Shape.figure and then get its Shape.geometryString.