blackjack icon indicating copy to clipboard operation
blackjack copied to clipboard

No polygon node

Open Zireael07 opened this issue 2 years ago • 2 comments

I wanted to extrude a polygon, but so far it's not possible (workaround: merge several boxes)

A polygon could be represented with a vector of 2D positions pretty easily.

Zireael07 avatar Mar 16 '22 08:03 Zireael07

EDIT: Please see my other comment below.

A polygon node sounds like a good idea, and it shouldn't be difficult to make. I can give this a go (might take a bit). Or in case you're feeling adventurous, I'd be happy to guide you (or anyone reading this!) through it so you can contribute :smile:

Just for reference, here's here the primitives are defined: Adding a "polygon" primitive should be quite straightforward https://github.com/setzer22/blackjack/blob/main/src/mesh/halfedge/primitives.rs

Here's where node types are defined: https://github.com/setzer22/blackjack/blob/ad3be0758a795211d235da38324c07db276c3cdf/src/graph/node_graph_custom/node_templates.rs#L143

And this PR is a good example of the whole "creating a node" process: https://github.com/setzer22/blackjack/pull/12

setzer22 avatar Mar 16 '22 10:03 setzer22

In case someone decides to work on this, please bear in mind that the way to define new nodes in blackjack has changed a lot and none of what I said in my comment applies anymore. I will take some time to document the new way after I finish working on some new features in the upcoming weeks.

setzer22 avatar Mar 25 '22 13:03 setzer22