diff --git a/docs/source/posts/2023/2023-07-08-week-6-praneeth.rst b/docs/source/posts/2023/2023-07-08-week-6-praneeth.rst new file mode 100644 index 000000000..402a137f0 --- /dev/null +++ b/docs/source/posts/2023/2023-07-08-week-6-praneeth.rst @@ -0,0 +1,26 @@ +Week 6: BoundingBox for TextBlock2D! +==================================== + +.. post:: July 08, 2023 + :author: Praneeth Shetty + :tags: google + :category: gsoc + + +What did you do this week? +-------------------------- +This week, I worked on improving the **TextBlock2D** component in the UI system. I started from scratch to address alignment and scaling issues. When resizing the **TextBlock2D**, the text alignment and justification with the background rectangle were inconsistent. To resolve this, I introduced a new "boundingbox" property that calculates the text bounding box based on its content. Additionally, I separated the scaling mode from the resizing action with the new "auto_font_scale" property, enabling automatic font scaling according to the bounding box. This will provide better alignment, justified text, and smoother font scaling for the **TextBlock2D** component. Try it out at `PR #803 `_. + +.. image:: https://github.com/fury-gl/fury/assets/64432063/94212105-7259-48da-8fdc-41ee987bda84 + :align: center + :alt: TextBlock2D will different justifications + +As discussed last week, we also made a decision regarding the scrollbar. After exploring different use cases, we concluded that creating an independent scrollbar is not necessary at the moment. Therefore, we will close the related pull requests. You can find out more about it in the discussion `here `_. + +Did you get stuck anywhere? +--------------------------- +Implementing the bounding box feature took some extra time as I needed to carefully consider its impact on other UI elements that rely on the **TextBlock2D** component. + +What is coming up next? +----------------------- +Next, I will focus on completing the TextBlock2D Bounding Box PR, which will also indirectly finalize the Spinbox PR. diff --git a/docs/source/posts/2023/2023-07-15-week-7-praneeth.rst b/docs/source/posts/2023/2023-07-15-week-7-praneeth.rst new file mode 100644 index 000000000..db375bd7c --- /dev/null +++ b/docs/source/posts/2023/2023-07-15-week-7-praneeth.rst @@ -0,0 +1,36 @@ +Week 7: Sowing the seeds for TreeUI +=================================== + +.. post:: July 15, 2023 + :author: Praneeth Shetty + :tags: google + :category: gsoc + + +What did you do this week? +-------------------------- +This week, I focused on completing the **TextBlock2D** Bounding Box feature. However, the tests were failing due to automatic background resizing based on content and improper text actor alignment during setup. I encountered difficulties while positioning the text, which caused the text to appear offset and led to test failures. + +Text background greater than the actual maximum size: + +.. image:: https://github.com/fury-gl/fury/assets/64432063/aaf4a764-4480-4f96-9adf-29d9e28135a6 + :align: center + :alt: Text background greater than the actual maximum size in ComboBox2D + +Text offset from center: + +.. image:: https://github.com/fury-gl/fury/assets/64432063/0a3bc1e6-a566-4c08-9ca4-a191525b9c97 + :align: center + :alt: Text offset from center in RingSlider2D + +Additionally, I reviewed PR `#814 `_ and noticed that after PR `#769 `_, all demos and examples were merged into a single folder, which affected the paths used in the Scientific Domain Section. To address this, I created PR `#820 `_ to redirect the links to the correct path. + +As I faced issues with the **TextBlock2D** PR, I took the opportunity to rebase and continue working on the **TreeUI** PR since there were no updates from the author. + +Did you get stuck anywhere? +--------------------------- +While fixing the issues with the tests for the **TextBlock2D** bounding box, I encountered a weird behavior in text positioning when using the center alignment. The output varied depending on the sequence of repositioning which we are still investigating. + +What is coming up next? +----------------------- +I will continue working on the **TreeUI** and resolve the **TextBlock2D** error to ensure both PRs progress smoothly. \ No newline at end of file diff --git a/docs/source/posts/2023/2023-07-17-week-7-joaodellagli.rst b/docs/source/posts/2023/2023-07-17-week-7-joaodellagli.rst new file mode 100644 index 000000000..9237ec1d7 --- /dev/null +++ b/docs/source/posts/2023/2023-07-17-week-7-joaodellagli.rst @@ -0,0 +1,65 @@ +Week 7: Experimentation Done +============================ + +.. post:: July 17, 2023 + :author: João Victor Dell Agli Floriano + :tags: google + :category: gsoc + +Hello everyone, welcome to another weekly blogpost! Let's talk about the current status of my project (spoiler: it is beautiful). + +Last Week's Effort +------------------ +Having accomplished a KDE rendering to a billboard last week, I was then tasked with trying a different approach to how the +rendering was done. So, to recap, below was how I was doing it: + +1. Render one point's KDE offscreen to a single billboard, passing its position and sigma to the fragment shader as uniforms. +2. Capture the last rendering's screen as a texture. +3. Render the next point's KDE, and sum it up with the last rendering's texture. +4. Do this until the end of the points. +5. Capture the final render screen as a texture. +6. Apply post processing effects (colormapping). +7. Render the result to the screen. + +This approach was good, but it had some later limitations and issues that would probably take more processing time and attention to details (correct matrix +transformations, etc) than the ideal. The different idea is pretty similar, but with some differences: + +1. Activate additive blending in OpenGL. +2. Render each point's KDE to its own billboard, with position defined by the point's position, all together in one pass. +3. Capture the rendered screen as a texture. +4. Pass this texture to a billboard. +5. Apply post processing effects (colormapping). +6. Render the result to the screen. + +So I needed to basically do that. + +Was it Hard? +------------ +Fortunately, it wasn't so hard to do it in the end. Following those steps turned out pretty smooth, and after some days, +I had the below result: + +.. image:: https://raw.githubusercontent.com/JoaoDell/gsoc_assets/main/images/final_2d_plot.png + :align: center + :alt: Final 2D KDE render + +This is a 2D KDE render of random 1000 points. For this I used the *"viridis"* colormap from `matplotlib`. Some details worth noting: + +* For this to work, I have implemented three texture helper functions: `window_to_texture()`, `texture_to_actor()` and `colormap_to_texture()`. The first one captures a window and pass it as a texture to an actor, the second one passes an imported texture to an actor, and the last one passes a colormap, prior passed as an array, as a texture to an actor. +* The colormap is directly get from `matplotlib`, available in its `colormaps` object. +* This was only a 2D flatten plot. At first, I could not figure out how to make the connection between the offscreen interactor and the onscreen one, so rotating and moving around the render was not happening. After some ponder and talk to my mentors, they told me to use *callback* functions inside the interactor, and after doing that, I managed to make the 3D render work, which had the following result: + +.. image:: https://raw.githubusercontent.com/JoaoDell/gsoc_assets/main/images/3d_kde_gif.gif + :align: center + :alt: 3D KDE render + +After those results, I refactored my PR `#804 `_ to better fit its current status, and it is +now ready for review. Success! + + +This Week's Goals +----------------- +After finishing the first iteration of my experimental program, the next step is to work on an API for KDE rendering. I plan to meet +with my mentors and talk about the details of this API, so expect an update next week. Also, I plan to take a better look on my fellow GSoC FURY +contributors work so when their PRs are ready for review, I will have to be better prepared for it. + +Let's get to work! \ No newline at end of file