Nibba2018's Blog

Google Summer of Code Final Work Product

Nibba2018
Published: 08/25/2020

Google Summer of Code Final Work Product

Proposed Objectives

  • ComboBox
  • Tab UI
  • File Dialog Improvements

Modified Objectives

  • ComboBox
  • Tab UI
  • File Dialog Improvements
  • Double Click Callback
  • TextBlock2D Improvements
  • Scrollbars as a Standalone Component
  • Physics Engine Integration

Objectives Completed

  • ComboBox2D UI Component

A combobox is a commonly used graphical user interface widget. Traditionally, it is a combination of a drop-down list or list box and a single-line textbox, allowing the user to select a value from the list. The term "combo box" is sometimes used to mean "drop-down list". Respective components, tests and tutorials were created. 

Pull Requests:

 

  • Tab UI Component

In interface design, a tabbed document interface or Tab is a graphical control element that allows multiple documents or panels to be contained within a single window, using tabs as a navigational widget for switching between sets of documents. Respective components, tests and tutorials were created.

Pull Requests:

 

  • Double Click Callback

Double click callbacks aren't implemented in VTK by default so they need to be implemented manually. With my mentor's help I was able to implement double click callbacks for all the three mouse buttons successfully.

Pull Requests:

 

  • TextBlock2D Improvements

The previous implementation of `TextBlock2D` was lacking a few features such as size arguments and text overflow. There was no specific way to create Texts occupying a said height or width area. Apart from that UI components like `ListBoxItem2D`, `FileMenu2D` etc had an issue where text would overflow from their specified width. In order to tackle these problems, a modification was done to `TextBlock2D` to accept size as an argument and a new method was added to clip overflowing text based on a specified width and to replace the overflowing characters with `...`.

Pull Requests:

 

  • Physics Engine Integration

Optional support for Physics engine integration of Pybullet was added to Fury. Pybullet's engine was used for the simulations and FURY was used for rendering the said simulations. Exhaustive examples were added to demonstrate various types of physics simulations possible using pybullet and fury. The said examples are as follows:

  • Brick Wall Simulation
    • Explains how to render and simulate external forces, objects and gravity.
  • Ball Collision Simulation
    • Explains how collisions work and how to detect said collisions.
  • Chain Simulation
    • Explains how to render and simulate joints.
  • Wrecking Ball Simulation
    • A more complicated simulation that combines concepts explained by the other examples.

Apart from that, a document was created to explain the integration process between pybullet and fury in detail.

Pull Requests:

Objectives in Progress

  • Scrollbars as a standalone component

The previous implementation of scrollbars were hard coded into `ListBox2D`. Therefore, it was not possible to use scrollbars with any other UI component. Apart from that, scrollbars in terms of design were limited. Creating a horizontal scrollbar was not possible. The objective of this PR is to make scrollbars separate so that other UI elements can also make use of it.

Currently, the skeletal and design aspects of the scrollbars are implemented but the combination of scrollbars with other UI components are still in progress.

Pull Requests:

 

  • File Dialog Improvements

Currently, we have access to `FileMenu2D` which allows us to navigate through the filesystem but it does not provide a user friendly Dialog to read and write files in Fury. Hence the idea is to create a file dialog which can easily open or save file at runtime. As of now, `Open` and `Save` operations are implemented. Corresponding tests and tutorials are in progress.

Pull Requests:

Other Objectives

  • Radio Checkbox Tutorial using FURY API

The objects for Radio button and Checkbox tutorial were rendered using VTK's method by a fellow contributor so I decided to replace them with native FURY API. The methods were rewritten keeping the previous commits intact.

Pull Requests:

 

  • GSoC weekly Blogs

Weekly blogs were added for FURY's Website.

Pull Requests:

 

Timeline

Date Description Blog Link
30-05-2020 Welcome to my GSoC Blog!! Weekly Check-in #1
07-06-2020 First Week of Coding!! Weekly Check-in #2
14-06-2020 ComboBox2D Progress!! Weekly Check-in #3
21-06-2020 TextBlock2D Progress!! Weekly Check-in #4
28-06-2020 May the Force be with you!! Weekly Check-in #5
05-07-2020 Translation, Reposition, Rotation. Weekly Check-in #6
12-07-2020 Orientation, Sizing, Tab UI. Weekly Check-in #7
19-07-2020 ComboBox2D, TextBlock2D, Clipping Overflow. Weekly Check-in #8
26-07-2020 Tab UI, TabPanel2D, Tab UI Tutorial. Weekly Check-in #9
02-08-2020 Single Actor, Physics, Scrollbars. Weekly Check-in #10
09-08-2020 Chain Simulation, Scrollbar Refactor, Tutorial Update. Weekly Check-in #11
16-08-2020 Wrecking Ball Simulation, Scrollbars Update, Physics Tutorials. Weekly Check-in #12
23-08-2020 Part of the Journey is the end unless its Open Source! Weekly Check-in #13

Detailed weekly tasks and work done can be found here.

View Blog Post

Weekly Check-in #13

Nibba2018
Published: 08/23/2020

Part of the Journey is the end unless its Open Source!

Hello and welcome to my final weekly check-in. Today officially marks the end of  the coding period for GSoC 2020. I enjoyed every bit of it. This was a life-changing experience for me and now I observe and interpret everything from a different perspective altogether. I have grown into a better developer and a person since GSoC. I would like to thank all my mentors and especially Serge for his immense support and mentorship. I would love to contribute to fury even after GSoC is over but unfortunately my semester break is over so I wont be as active as I was during the summer.

Now, regarding work I will be sharing my progress with the File Dialog UI component. The official repository of my sub-org can be found here.

What did you do this week?

This week I worked on the File Dialog UI component. Fury previously had a FileMenu component which could browse through the file system but we needed a dialog like implementation for it so that its easier for the users to read and write files during runtime. I tried implementing a simple design for it. It specifically has two modes, one for saving files and the other for writing files. The implementation can be demonstrated as follows:

Open Dialog:

Save Dialog:

What is coming up next?

Next week I will start with my final GSoC documentation and code submission. I will also try to implement the tests and tutorials for File Dialog or any further changes requested by my mentors. If I am not able to finish it within the next week, I will get it done after GSoC.

Did you get stuck anywhere?

I did not face any major issues this week.

Thank you all for your love and support. ❤️😄
View Blog Post

Weekly Check-in #12

Nibba2018
Published: 08/16/2020

Wrecking Ball Simulation, Scrollbars Update, Physics Tutorials.

Hello and welcome to my 12th weekly check-in. In this blog I will be discussing my progress with the wrecking ball simulation and my scrollbar separation work. Apart from this I have also finalized the physics simulation tutorials and have created a Pull Request to finally get it merged with the official repository. The official repository of my sub-org can be found here.

What did you do this week?

This week I was mainly focusing on the wrecking ball simulation. This simulation is basically the combination of chain simulation and brick wall simulation. A sphere attached to a chain smashes a "NxNxN" brick wall. The simulation is as follows:

There's a rendering bug with the cylinders because of which the chain segments look weird. My mentors confirmed that this bug originated from VTK's `cylinder source` method and they are currently working on it to fix it. The simulation will render correctly once that bug is fixed.

Regarding the scrollbar separation task, I was able to fix those callback issues that I was facing. The mouse callbacks on the scrollbar now work correctly:

I have also created a pull request to add the following physics simulations with proper documentation to the main repository:

  • Brick Wall Simulation
  • Ball Collision Simulation
  • Chain Simulation
  • Wrecking Ball Simulation

What is coming up next?

Currently I am a bit confused with the implementation of scrollbars with UI components. I had a meeting with my mentor and he decided to help me out with this. So most probably I will be working with the scrollbar component and its implementation. Next week will also be the final week for GSoC 2020 before the evaluations start so I would work on getting the final documentation and formalities ready.

Did you get stuck anywhere?

Apart from the scrollbar implementation idea, I did not face any major issues.

Thank you for reading, see you next week!!
View Blog Post

Weekly Check-in #11

Nibba2018
Published: 08/09/2020

Chain Simulation, Scrollbar Refactor, Tutorial Update.

Hello and welcome to my 11th weekly check-in. In this blog I will be discussing my progress with multiple topics related to physics and ui components. I was actively working on a couple of things, specifically Joint simulations in pyBullet and scrollbar UI component. I also took up the responsibility to complete an incomplete Pull Request which was pending for quite a while. The official repository of my sub-org can be found here.

What did you do this week?

The first thing that I did this week was to figure out joint simulations in pybullet. Due to lack of proper documentation I was not aware that Joints are kept stiff by default, hence I had no idea what was wrong with my simulations. Thankfully, while I was browsing pybullet forums, I found this post regarding rope simulations when I realized that I had to explicitly set the friction force to prevent stiffness among the Joints. Keeping this point in mind I was able to simulate the following Chain of hexagonal prisms:

This week I was mainly supposed to  work on refactoring scrollbars as a standalone component. I have made some progress for now. I am able to render the scrollbars properly, with proper size, orientation and color but I am having some issues regarding its scrolling callbacks. I need to look further into it. Here's a brief glimpse:

This particular PR by a fellow contributor was pending for quite a while, so I decided to look into it and complete it. The objective of the PR was to add examples for the CheckBox and RadioButton UI components, but the problem was that the objects were not rendered using FURY API in the tutorial, so I decided to complete that. It was already a well made tutorial. I only had to replace the appropriate functions with FURY's API calls.

The CheckBox tutorial:

There's still some internal issues while updating the colors of the cube which is currently being worked on by my mentors.

The RadioButton tutorial:

What is coming up next?

Next week I will continue working on the scrollbar component and try to fix the issues that I am having with its callbacks. I will also try to work on the wrecking ball simulation.

Did you get stuck anywhere?

Apart from the scrollbar callbacks and stiff joints, I did not face any major issues.

Thank you for reading, see you next week!!
View Blog Post

Weekly Check-in #10

Nibba2018
Published: 08/02/2020

Single Actor, Physics, Scrollbars.

Hello and welcome to my 10th weekly check-in. Second evaluation ended this week and now we move on to our 3rd and final coding period. In today's check-in I will be sharing my progress with the single actor physics simulation that I facing some issues with and I will also be discussing my future plans regarding UI components. The official repository of my sub-org, FURY can always be found here.

What did you do this week?

This week I was able to figure out the uncontrollable spinning problem that I was facing while rendering physics simulations. Specifically the simulation where a brick wall was rendered by a single actor. The spinning problem was as follows:

Here's how the fixed simulation looks like:

I was facing this particular issue because I was directly syncing the orientation of the objects in pyBullet world to the objects in the Fury world. So I decided to apply the change in orientation instead and it worked. In order to achieve this I had to keep track of the bricks' orientation at each step of the simulation, sync the change and then update the tracked orientation. Thankfully, pybullet had convenient tools to achieve this. Here's a snippet on how to update individual objects rendered by a single actor:

def sync_brick(object_index, multibody):
    pos, orn = p.getBasePositionAndOrientation(multibody)

    rot_mat = np.reshape(
        p.getMatrixFromQuaternion(
            p.getDifferenceQuaternion(orn, brick_orns[object_index])),
        (3, 3))

    vertices[object_index * sec: object_index * sec + sec] = \
        (vertices[object_index * sec: object_index * sec + sec] -
         brick_centers[object_index])@rot_mat + pos

    brick_centers[object_index] = pos
    brick_orns[object_index] = orn

All the necessary information is updated here.

What is coming up next?

Currently, the scrollbars are native to ListBox2D only. We are planning to separate scrollbars from ListBox2D to create a standalone UI component. This was in progress previously but was later discontinued, so I was given the responsibility to complete it. After this we plan to improve File Dialog capabilities later on.

Did you get stuck anywhere?

I did not face any major issues but it took me some time to understand and evaluate the existing discontinued PR regarding scrollbar separation.

Thank you for reading, see you next week!!
View Blog Post
DJDT

Versions

Time

Settings from gsoc.settings

Headers

Request

SQL queries from 1 connection

Static files (2312 found, 3 used)

Templates (28 rendered)

Cache calls from 1 backend

Signals

Log messages