Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to add primitives. #514

Open
luisvgs opened this issue Aug 14, 2024 · 3 comments
Open

Proposal to add primitives. #514

luisvgs opened this issue Aug 14, 2024 · 3 comments

Comments

@luisvgs
Copy link

luisvgs commented Aug 14, 2024

Hello @JD557, first of all thanks for such a nice library. I've been playing around with it and I like it so far. I was wondering if contributions are currently accepted? I noticed that the library lacks of (correct me if I'm wrong) primitives such as Triangle, Square, Circle, which might be handy for people who just want to experiment and do some quick sketches.

May I ask if I can help with it? If so, any guidelines I should consider?

Kind regards.

@JD557
Copy link
Owner

JD557 commented Aug 14, 2024

Hey there,

I was wondering if contributions are currently accepted?

I haven't thought too much about that, but I would say small contributions are OK.

I wouldn't recommend sending any large PRs without creating an issue, since there's a chance that I might reject it for considering it out of scope of the library, and that sucks 😓

So I think you did the right thing by asking.

I noticed that the library lacks of (correct me if I'm wrong) primitives such as Triangle, Square, Circle, which might be handy for people who just want to experiment and do some quick sketches.

Indeed, this was something that I wanted to do, but didn't because I couldn't find out an API that I liked.

I had an initial implementation, but I really don't like how it turned out.

Having said that, the main problem was that at the time I was trying to have both a mutable and immutable API, and since I removed minart-pure (#407) I think that's not a problem anymore.

May I ask if I can help with it?

Sure.

If so, any guidelines I should consider?

I haven't thought too much about that, but from the top of my head there are two things:

One thing that I would ask you for now is to add the code to a separate package (maybe eu.joaocosta.minart.graphics.geometry or something like that). I think for now it's OK to have that in minart-core, but I might want to extract that to a different module in the future, and having it in a different package makes things a bit cleaner for this.

The other is to make sure that the implementations are platform independent (e.g. you can use methods like MutableSurface#putPixel and MutableSurface#fillRegion, but not something like htmlCanvas.ctx.lineTo). I know that this is a bit annoying, but it's one of the main principles of the library.

As a side note, in general I'm OK if the implementations are not very performant. That can be worked out later and, if someone really needs performance, they should probably use a different library 😛

@JD557
Copy link
Owner

JD557 commented Sep 6, 2024

Hey there, I'm not sure if you ended up picking this up.

Either way, I was playing around with some rasterization algorithms, and I think I'm quite happy with how it turned out, so I might clean up that code and put it in the library.

So, this feature should be available "soon-ish" (knocks on wood).

@luisvgs
Copy link
Author

luisvgs commented Sep 10, 2024

Hello! @JD557 no, unfortunately I was not able to keep up with my proposal due to work however, I'd love to work on any other task that you have in mind? Thanks for the update by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants