![]() ![]() * Select 'point' from the Type menu and press 'OK'. * In the Metadata window: click the '+' button on the lower left corner. For the moment the node can only receive a shape. Enter 'check/cook' in the 'Function' option. * Select the node and go to the Metadata tab. We can use the filter node to start with since it already imports a shape. I need a node where i can send a shape and a list of points to and which returns a list (of 0 and 1). To call the cook function in checkImage.py i will have to call checkImage/cook. In the case of a rectangle it will say: corevector/rect, meaning that it will call the rect function in the corevector file. If you go to 'Settings' you can find out what function it refers to. It will open a new window with specifications of the node and its ports. Every node calls for a function, you can find out which one by selecting a node and then go to the metadata tab on top of the port/parameters window. The python file is imported now and the function in it can be called for from a node. Browse to check.py * If you can see a reference to it you can close the window. * Press '+' and select Python from the Python / Closure option. It will open a new small window with in the upper right corner a '+' sign. First we need to import the python file in the program. Now that we have a function to call for, it can be implemented into NodeBox. Return 0 save it as a python file called check.py. This is not a build-in function, but NodeBox allows us to use our own code as well. The ones that do have to be stored as 1, the ones that don't have to be stored as 0. the overlap The idea is that we will try to figure out which points of the grid overlap the ellipse. Create an ellipse node and leave it at it's default parameters. the shape The next thing we need is a shape. Create a sort node and connect grid1 to the shapes port. We have to change it so that the first 56 points are the first column of the grid, the second set of 56 points the second column in the grid and so on. This grid of points is sorted on the Y axis. Change the dimensions of it to width 120 and height 300. This will be one vertical line of our image. ![]() the grid Create a grid node with the row parameter set to 56. Below is the description of a simple example but it might be easier to download the baseReader.zip which is included and open it in Nodebox allowing you to see it step by step. Let's start with a simple example that visualises an ellipse on the interface. Nodebox is a great tool for visualising stuff. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |