Giter Club home page Giter Club logo

Comments (13)

lainz avatar lainz commented on June 9, 2024 1

Thanks for your time :)

from lazpaint.

circular17 avatar circular17 commented on June 9, 2024 1

I've added the hypocycloid in the render menu. I've refactored and encapsulated things so that this can be reused to do another rendering.

The principle is to create or update the vector original with the shape. The parameters are stored in the layer registry so that they can be retrieved when rendering again.

I invite you to have a look at the following commit: 5121b62

Many files are changed, this is mainly due to adding the hypocycloid in the menus. The main part is in uhypocycloid.pas.

I would appreciate your feedback on this implementation, especially any suggestions for improvement or if you notice any issues. Thank you in advance!

from lazpaint.

lainz avatar lainz commented on June 9, 2024 1

Hi, I've tested the plugin and works fine. Thanks for this addition :)

from lazpaint.

lainz avatar lainz commented on June 9, 2024 1

I've tried adding the decimals, but I just get a rounded corner. Seems that the code has changed a bit more than I think...
Anyways I understand that is not a normal fillable shape with decimals, so it's ok like it is now.
Let's go with the other plugins!
I've created a thread in BGRABitmap forum:
https://forum.lazarus.freepascal.org/index.php/topic,64708.msg492242/topicseen.html

from lazpaint.

lainz avatar lainz commented on June 9, 2024

Captura de pantalla 2023-09-16 152635
Hi, here is the working code for Pascal
https://github.com/bgrabitmap/demo/blob/master/hypocycloid/umain.pas

I've ported it from JavaScript
https://codepen.io/enxaneta/pen/WQPdvV

from lazpaint.

circular17 avatar circular17 commented on June 9, 2024

Hi Lainz!

So as we have discussed, there is way to implement it without involving to much more coding. The principle would be to have a filter window that would replace the current layer by a vector layer containing the drawing and save information in the layer about the parameters to produce the shape. This way, the filter window would be able to retrieve the information later and the user could update the shape by adjusting the parameters. Saving information in a layer is already implemented and used for example by Python scripts.

I will work on the basics to make this.

Regards

from lazpaint.

lainz avatar lainz commented on June 9, 2024

Thankyou, I will review it on next Sunday. Unfortunatelly I'm having some health problems and I need to cover the days I don't work.

from lazpaint.

circular17 avatar circular17 commented on June 9, 2024

I understand. This can wait. Take care and good luck

from lazpaint.

lainz avatar lainz commented on June 9, 2024

Maybe can be added decimal places without compromising speed...
Like a trackbar with just + 0.1.. 0.9 to limit the complexity but at the same time giving more options.
Just an idea.

from lazpaint.

circular17 avatar circular17 commented on June 9, 2024

The problem though is then to determine when it stops looping. One way to know for sure when it ends looping is to have 2 numbers: a numerator and a denominator (up to 3). The denominator is the number of turns. For example 5/2 will make a star shape with 5 corners in 2 turns. One need to simplify the fraction, as 6/2 will in fact be the same as 3.

You can give it a try if you like by modifying the MakeHypocycloid function.

from lazpaint.

lainz avatar lainz commented on June 9, 2024

Ok I will try
The idea was not a fraction but a simple decimal place.
Like I choose 6 in the spinedit. Then in a slider I choose from 0 to 9. For example if I choose 3 it becomes 3.6 number. These decimal places are computed in more or less time but always computed. And gives nice shapes.

from lazpaint.

circular17 avatar circular17 commented on June 9, 2024

I see the appeal of decimal values for intricate patterns. However, fractions like 3.1 might lead to numerous turns and more vertices, affecting editability of the generated shape by users.

Using denominators of 2 or 3 ensures predictability of the loop. With decimals, one cannot express a precise fraction like 7/3 that nicely loops after 3 turn. I invite you to try to approximate 7/3 = 6.333 and see how it goes.

It is a great idea to open this thread on the forum, it is likely to attract people's attention on a more concrete way of improving LazPaint.

from lazpaint.

lainz avatar lainz commented on June 9, 2024

Ok yes you are way better in math than me. So if you think fractions are better then we need to go that way.
Thank you. Yes I've seen many drawings that can be added as plug in in the forum. But I can't remember where so for that I opened the thread.

from lazpaint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.