How-to generate this simple shape: a loop?
in
Programming Questions
•
3 years ago
Hey,
I'm already tweaking around since some time, trying to generate an easy loop (a circle with a hole!). Here is my attempt, using the undocumented breakShape() method and bezier-vertices:
Main class: http://www.pastebin.org/770364
Loop class: http://www.pastebin.org/770380 (probably an extreme case of getter/setter encapsulation..)
Unfortunately, the whole thing just doesn't work at all. When using the P2D renderer, I get the error "This renderer cannot handle concave shapes or shapes with holes." what is a bit astonishing because breakShape() is known to only work with P2D. Using any other renderer doesn't show any result at all, there are just two circles, one within the other..
I would be happy if anyone could tell me a good solution for this problem. I think there must be an easy way to get a loop shape? It's also important that it looks smooth in the end, without any edges.
Best wishes,
Christian
I'm already tweaking around since some time, trying to generate an easy loop (a circle with a hole!). Here is my attempt, using the undocumented breakShape() method and bezier-vertices:
Main class: http://www.pastebin.org/770364
Loop class: http://www.pastebin.org/770380 (probably an extreme case of getter/setter encapsulation..)
Unfortunately, the whole thing just doesn't work at all. When using the P2D renderer, I get the error "This renderer cannot handle concave shapes or shapes with holes." what is a bit astonishing because breakShape() is known to only work with P2D. Using any other renderer doesn't show any result at all, there are just two circles, one within the other..
I would be happy if anyone could tell me a good solution for this problem. I think there must be an easy way to get a loop shape? It's also important that it looks smooth in the end, without any edges.
Best wishes,
Christian
1