dhermes / bezier

Helper for Bézier Curves, Triangles, and Higher Order Objects
Apache License 2.0
266 stars 36 forks source link

[QUESTION] How to get outline shape of multiple shape? #299

Closed moi15moi closed 2 years ago

moi15moi commented 2 years ago

Is it possible to get the outline of an bezier shape with this tool?

If yes, it there an example available somewhere?

dhermes commented 2 years ago

@moi15moi I don't fully understand what you are asking. Two possible interpretations come to mind:

Do either of these seem like what you're asking?

moi15moi commented 2 years ago

Sure! Let's suppose I have a bezier that represent the white of my letter: image

Now, I would like to get the outline shape of this shape, so it is almost everything in red (I don't want to include the "semi circle").

Is that clearer ?

dhermes commented 2 years ago

@moi15moi It is somewhat clearer, yes. As far as I can tell you are asking if this library will "scan" your image and spit out the curves that define the boundary. No it will not do that.

Also keep in mind that Bézier curve splines are used for complex shapes, typically not a single (high degree) Bézier curve.

I am going to preemptively close this issue since (I think) I have answered your question. If I have mistakenly closed this issue, let me know and I am happy to re-open.

moi15moi commented 2 years ago

@dhermes

As far as I can tell you are asking if this library will "scan" your image and spit out the curves that define the boundary.

No, I show an image to help you visualize what can of bezier I have: Let's suppose I have a bezier that represent the white of my letter So, by that I mean that I have a node list that represent the white of the character e.

In reality, I can have a multiple list of linear bezier and quadratic bezier. Why? Because, in the case of the letter e, I have 2 lists. One for the outline shape and one for the inline shape. But, for the character w, I would only have 1 list.

Example:

"Complex" shape: image

What I want: I want to get the shape the outline, so a shape of everything in yellow. How can I do that?

moi15moi commented 2 years ago

@dhermes Hi, is there a problem with my last message?

dhermes commented 2 years ago

No nothing was wrong with it, sorry for missing a reply from me.

From your response I think I can conclude you are looking for something to process an image but this library does not do that. It can produce an image via matplotlib and allows you to do lots of math on curve objects.