### Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

### Author Topic: Compute [Opened | Closed] Spline does not respect EmptyPointF  (Read 1891 times)

#### winni

• Hero Member
• Posts: 1908
##### Compute [Opened | Closed] Spline does not respect EmptyPointF
« on: January 22, 2020, 11:21:35 pm »
@circular

Hi!

I don't know if it is by intention and design or if it is just forgotten.

This fails:
Code: Pascal  [Select][+][-]
1.
2. BGRABitmap.ComputeOpenedSpline(PolyLineWithEmptyPointF, ssSomeOption);

That would be nice to have it, because now I have to do:

separate the arrayOfTPointF into an array of arrayOfTPointF
and then apply the ComputeOpenedSpline on every single  partial polyline.
And finaly I have to concat alle the splines together to one polyline with EmptyPointF inbetween.

Not a must - but nice to have.

Winni

« Last Edit: January 22, 2020, 11:25:22 pm by winni »

#### circular

• Hero Member
• Posts: 3511
##### Re: Compute [Opened | Closed] Spline does not respect EmptyPointF
« Reply #1 on: January 23, 2020, 03:43:41 pm »
That's a good point.

Pun intended.

I may in fact split the array in a similar way to implement that.
Conscience is the debugger of the mind

#### winni

• Hero Member
• Posts: 1908
##### Re: Compute [Opened | Closed] Spline does not respect EmptyPointF
« Reply #2 on: January 23, 2020, 10:55:53 pm »
Hi!

Just for fun: ComputeOpendSpline is a fine tool to make the font Arial look good ( see attachment).

I wrote "HELLO" on a temp bitmap and vectorized it with BGRA.
Then converted the multi-polygon in an array of polygons.
Applied the spline routine with ssCrossing.
And at last put the splines together to a multi-polygon.

And here is the result!

Winni

#### circular

• Hero Member
• Posts: 3511
##### Re: Compute [Opened | Closed] Spline does not respect EmptyPointF
« Reply #3 on: January 23, 2020, 11:03:44 pm »
That's fun indeed.
Conscience is the debugger of the mind

#### circular

• Hero Member
• Posts: 3511
##### Re: Compute [Opened | Closed] Spline does not respect EmptyPointF
« Reply #4 on: January 26, 2020, 05:52:30 pm »
Hi winni,

On dev branch, I have added support for EmptyPointF in compute spline functions.

You can also specify the index range of the sub spline using compute spline functions in BGRAPath.

I've added as well a parameter to insert empty points in between when concatenating with ConcatPointsF.

Regards
Conscience is the debugger of the mind

#### winni

• Hero Member
• Posts: 1908
##### Re: Compute [Opened | Closed] Spline does not respect EmptyPointF
« Reply #5 on: January 27, 2020, 10:33:59 pm »
Hi!

Should I call you Lucky Luke: Fastest gun in the west ......?

Thanx a very lot!

Winni

#### circular

• Hero Member
• Posts: 3511
##### Re: Compute [Opened | Closed] Spline does not respect EmptyPointF
« Reply #6 on: January 28, 2020, 02:48:24 pm »

You're very welcome.

Well sometimes it is not too much work.

I missed something with Easy Bezier curves in doing so, I've just fixed it. So you might need to update if you use them.

Regards
Conscience is the debugger of the mind