Code Monkey home page Code Monkey logo

pagoda's Introduction

Buy Me A Coffee

Branch master development
Build Build

You can find Pagoda's documentation here.

What is Pagoda

banner

graph

The goal of Pagoda is to be a procedural modelling framework aimed at supporting researchers and academics in this field. Therefore, it must be flexible enough to allow the implementation of multiple algorithms and methodologies.

Currently, Pagoda implements a graph-based approach since it is considered to be one of the most flexible methods to specify the rules in procedural modelling. The idea is to, eventually, reach a design that allows its users to re-use code from any of the available layers to implement other methodologies.

Building Pagoda

Before building pagoda, you need to install the Boost libraries. Instructions on how to do so can be found on its website.

Pagoda also needs Google Test. However, this dependency is built for you automatically.

Once you have installed Boost execute the following commands in the terminal:

$ git clone https://github.com/diegarjz/pagoda.git pagoda
$ cd pagoda
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ make && make test && make install

If all goes well you will have built and installed the pagoda library, headers and the pagoda executable. The pagoda executable is what allows you to execute a procedural graph in the specified in the pagoda format.

Executing your first procedural graph

The pagoda executable takes a procedural graph file and optionally executes it.

A procedural graph is a directed graph that details the execution of the operations and the flow of procedural objects through the operations.

All sorts of concepts in a procedural graph are represented by nodes. Operations nodes, interfaces between procedural operations, parameter nodes, etc. The reasoning for this approach is that it allows a higher level of flexibility and extensibility while defining procedural graphs. Links between nodes usually represent the flow of procedural objects but different nodes might process the objects in different ways. Some may create new geometry with procedural operations. Other might filter the flow of objects through the nodes.

The most simple procedural graph might be one that just creates a rectangle. This is illustrated in the following snippet:

create_rect = Operation(operation: "CreateRectGeometry") { width: 10, height: 10 }
create_rect_out = OutputInterface(interface: "out")
create_rect -> create_rect_out;

export_in = InputInterface(interface: "in")
export = Operation(operation: "ExportGeometry") { path: "rect.geom" }
export_in -> export;

create_rect_out -> export_in;

Creating a node is similar to constructing an object in object oriented programming. You call the constructor of the node's type (e.g., Operation or OutputInterface) with some parameters inside the round brackets (the construction arguments). Because all nodes can contain parameters (influencing the node's execution) you specify these inside the curly brackets (the execution parameters).

Nodes can be assigned to names which are then used to create links between nodes.

So, for example, in the first line, you create an Operation node whose operation is a CreateRectGeometry. When the node is executed the execution parameters will be passed to the operation, which will create a 10x10 square.

On the second line, an OutputInterface node is created. Since the OutputInterface nodes don't require execution parameters the curly brackets were omitted. The third line links both nodes.

Similarly, lines four to six create an Operation node to export the geometry and its input interface. The final line links the output of the create_rect operation and the export geometry.

To execute this node you can run the following on the command line:

pagoda create_rect.pgd --execute

You will then have a rect.obj file with the square.

pagoda's People

Contributors

diegoarjz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dseeni

pagoda's Issues

Fix the Scheduler

The procedural graph scheduler is not executing the nodes in a correct order.
So far the breadth first approach has worked because there was a pattern in the way nodes were linked.

E.g.:

op1 -> out_interface1 -> in_interface1 -> op2

which balanced the nodes and they were executed correctly.

With the ParameterNode things like the following can happen, where op2 can be executed before any procedural object gets there.

par -> op2
op1 -> out_interface1 -> in_interface1 -> op2

Texture coordinate projection based on geometry's scope

Implement an operation to project texture coordinates to vertices based on the scope.

Parameters:

  • axis: Scope axis along which to project the coordinates.
  • scale_u: How much to scale along the horizontal axis.
  • scale_v: How much to scale along the vertical axis.
  • offset_u: How much to translate along the horizontal axis.
  • offset_v: How much to translate along the vertical axis.

Implement the router node

The router node allows to filter and route incoming procedural objects to different outgoing nodes.

Linking problems in unit tests (gtest and pthreads) for some environments.

In at least one Kubuntu environment, there have been linking issues when building the unit tests:

/usr/bin/ld: ../../libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x24): undefined reference to `pthread_getspecific'

Implement a Parameter node.

The parameter node should allow defining new parameters.
The node should also allow pushing the parameters into its output nodes, overwriting parameters with the same name
This way it is possible to easily define graph level parameters.

Reimplement the graph reader

The current graph reader implementation is made up of remnants of first experiments with selscript and doesn’t support run time expressions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.