Comments (13)
Thanks for your time :)
from lazpaint.
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.
Hi, I've tested the plugin and works fine. Thanks for this addition :)
from lazpaint.
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.
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.
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.
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.
I understand. This can wait. Take care and good luck
from lazpaint.
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.
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.
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.
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.
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)
- Some more transformations HOT 2
- White balance? HOT 7
- Text along a path HOT 3
- Ease of use/help for beginners
- [Request][Suggest] G'mic and vector totaly text. my memes waiting. :) HOT 3
- Polygon/Star HOT 4
- file open with Ctrl + O (perhaps again) yields a widget too wide HOT 4
- suggest: move a link on the landing page HOT 1
- darktable intention HOT 1
- 3D layer
- nixos error unhandled exception HOT 3
- Add 3d objects and image resources HOT 12
- Universal Plugin System using standard IO HOT 12
- AddShow/Hide preview in filters windows to compare with and without the effect HOT 15
- Superformula plugin HOT 2
- Sutcliffe Pentagons plugin HOT 2
- Lazpaint web privacy policy HOT 1
- Implement HTTP API for Plugin Communication HOT 2
- Feature: Clone tool opacity separate from source opacity and brush opacity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazpaint.