Recent

Author Topic: Superformula  (Read 1884 times)

circular

  • Hero Member
  • *****
  • Posts: 4300
    • Personal webpage
Superformula
« on: June 16, 2024, 12:37:45 pm »
I've updated the original code of lainz to handle multiple turns and high resolution.

The superformula is a shape some kind of regular polygon with spike / roundness control.

Code: https://github.com/bgrabitmap/demo/tree/master/superformula_ui

Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4300
    • Personal webpage
Re: Superformula
« Reply #1 on: June 16, 2024, 12:39:48 pm »
More complex images
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4572
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Superformula
« Reply #2 on: June 16, 2024, 12:53:17 pm »
 :)

Thanks for the improvements!!

paweld

  • Hero Member
  • *****
  • Posts: 1090
Re: Superformula
« Reply #3 on: June 16, 2024, 02:07:05 pm »
great project. @lainz and @circular - tahnks for sharing.
Best regards / Pozdrawiam
paweld

Boleeman

  • Hero Member
  • *****
  • Posts: 572
Re: Superformula
« Reply #4 on: June 16, 2024, 04:17:17 pm »
Very cool Circular.

« Last Edit: June 17, 2024, 08:06:19 am by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 572
Re: Superformula
« Reply #5 on: June 17, 2024, 09:15:08 am »
I wonder if anyone can help out.

I wanted to be able to save the settings to a listbox as comma delimited and load and save to a small txt file (or anything similar).

I tried to add some command buttons and a listbox to the TPanel as show in the attached file, but all the controls keep on resizing.

What's the trick to widen the TPanel and add those extra controls? (Wanted the same anchoring and alignment)
I added another TPanel but the alignment has all gone.
Could see that the Childresizing and constraints were there in Circular original version.
Kinda going round in circles.

« Last Edit: June 17, 2024, 09:28:57 am by Boleeman »

circular

  • Hero Member
  • *****
  • Posts: 4300
    • Personal webpage
Re: Superformula
« Reply #6 on: June 17, 2024, 11:22:03 am »
I am glad you like the project  :)

About 3D superformula, that's a good idea for a new project.

Regarding the panel, indeed, the Childsizing is enabled. It was in fact in Lainz original version.

As far as I understand it, it works bit like a table with columns and rows. So if you want to add something like a list, probably it would be simpler to reduce the original panel and add your new panel to its right.
Conscience is the debugger of the mind

Boleeman

  • Hero Member
  • *****
  • Posts: 572
Re: Superformula
« Reply #7 on: June 17, 2024, 04:22:46 pm »
Hey Circular, here is a load and save settings version.

I like your upgrade very much.


Superformula Curves are ... so COOL.

Load the small text file and click on listbox row entries.

Getting some really nice curves.

Please re-download superformula_ui circular save settings V2a.zip as I forgot to include a unit file.
Now with 27 Presets.
« Last Edit: June 18, 2024, 09:00:23 am by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 572
Re: Superformula
« Reply #8 on: June 18, 2024, 01:24:41 pm »
I found if you make the TSpinedit increments smaller you get more variations in the curves.

Also added Save to Transparent PNG and save PNG to Background Color.

Lastly, added more saved preset curves.
« Last Edit: June 18, 2024, 02:12:55 pm by Boleeman »

circular

  • Hero Member
  • *****
  • Posts: 4300
    • Personal webpage
Re: Superformula
« Reply #9 on: June 18, 2024, 10:49:20 pm »
Very nice indeed  :)

I will include your changes. Maybe you can make a pull request on bgrabitmap/demo repository? If you need guidance on how to do that, feel free to ask.

In all cases, thank you very much adding the settings!
Conscience is the debugger of the mind

Boleeman

  • Hero Member
  • *****
  • Posts: 572
Re: Superformula
« Reply #10 on: June 19, 2024, 07:44:49 am »
Circular, I hope you did not mind me adding the save and load settings, as I thought it may be a good feature to remember the settings to each curve, instead of inputting them separately each time.

I realized I also forgot to store and retrieve the background color, so just a minor update attached below.

With "make a pull request on bgrabitmap/demo repository" not really sure how to do it?

circular

  • Hero Member
  • *****
  • Posts: 4300
    • Personal webpage
Re: Superformula
« Reply #11 on: June 19, 2024, 01:36:31 pm »
It's perfectly fine to add new feature to this project.  :)

About the pull request, the idea is that the code is on a Git repository and that there is a history of changes and that you can propose new changes. To do that, you need a (free) GitHub account and make a fork of the repository bgrabitmap/demo. You will then have a copy on your account, where you can make changes.

To do the changes on a repository, it is easier to have a graphical user interface like GitKraken. This will make it easy for you to retrieve your forked repository, and when you make changes to save them (commit and push). Then you can make a pull request and someone else can review your changes, as have two pairs of eyes is always better, and then merge into the source repository.

Note that we may simplify this process a bit. For this demo repository, we could give you access to the Git repository, so you would not need to fork it. If you're new to Git, this could make it easier for you to get the hands on it. You would still need a (free) GitHub account, but there would not be a pull request, so you would just need to check that your code is robust before pushing it to the repository.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018