-
-
Notifications
You must be signed in to change notification settings - Fork 959
GSoC 2025: Meticulous tool polishing and adding new gizmos #2653
-
Hey guys,
My name is Pratyush Harigovind (@0SlowPoke0), and I’ve been selected as a GSoC 2025 student developer to work on Graphite. This summer I will be working on enhancing the Polygon Tool by introducing a wide array of new shapes and designing unique gizmos for intuitive shape manipulation.
Synopsis
Graphite currently has a limited selection of predefined shapes in the Polygon Tool and supports only basic gizmo operations. This project aims to introduce a broader variety of geometric shapes—such as the Trapezoid, Star, Donut, and Pie—each accompanied by its own unique gizmo. These shape-specific gizmos will enable users to create more intricate and expressive vector designs.
To support this, a centralized Gizmo Manager will be developed to manage both generic and shape-specific gizmo behaviors. This includes integration with the Select Tool, allowing seamless shape manipulation and transformation via intuitive visual controls.
Benefits
- A wide selection of new predefined shapes will be available for users.
- Unique gizmos tailored to each shape will allow for more precise and creative editing.
- Enhanced user experience through more interactive and intuitive shape manipulation.
Deliverables
-
A centralized Gizmo Manager system to manage and coordinate gizmos associated with shapes created using the Polygon Tool.
-
Seamless integration with the Select Tool, allowing users to transform shapes using an intuitive interface.
-
Implementation of unique gizmo points for custom shapes including:
- Polygon, Trapezoid, Triangle, Star, Donut, Pie, Diamond, Segment, Crescent, and more.
-
Support for transformation features such as:
-
Editing edge curvature
-
Adjusting segment lengths
-
Modifying radii and angles
-
Moving and refining vertex positions
-
Final Report
The central focus of my project was redesigning and extending the Shape Tool, building a flexible Gizmo Manager API, and introducing a new Operation Tool. Together, these improvements lay the groundwork for a more powerful, modular, and intuitive editing experience in Graphite.
Toward the final weeks, I felt my progress slowed somewhat because I often explored multiple approaches on my own before seeking input. While this gave me a deeper understanding of the problem space, it sometimes delayed implementation. Looking back, I realize that reaching out earlier for feedback could have helped me move faster.
That said, I’m very glad to have contributed to this ambitious project. Working on Graphite has been a valuable learning experience, and I’m motivated to continue contributing in the future.
Unified Ellipse ,Polygon, Rectangle ,Line into a unified Shape-tool
Instead of maintaining separate handlers for each shape, we now have a single Shape Tool that lets users select and switch between different shapes. Ellipse, rectangle, and line are provided as aliases within this tool. It also integrates transform cage overlays, enabling users to select and modify shapes directly. In short, the Shape Tool is now the central hub for creating and editing shapes, with gizmos assisting in precise modifications.
New Shapes
Some shapes like Circle, Arc, and Grid already existed but had not yet been integrated into the Shape Tool for direct user drawing. Support for these has now been added, along with a new Spiral node capable of generating both Archimedean and logarithmic spirals. Implementing the spiral involved researching academic papers and experimenting with different efficient algorithms to balance accuracy and performance. In addition, the Shape Tool now supports adjustable parameters while drawing such as polygon sides, star points, grid rows and columns, and spiral turns, giving users more control over their shapes.
Gizmo Manager
This was the most important milestone of the project, since all further work depends on it. I redesigned and iterated on the gizmo API to make it modular and easy to extend, so new gizmos can be added and integrated without friction.
The Shape Tool now delegates input handling to the Gizmo Manager, which decides which gizmo is hovered, manages activation when multiple gizmos are nearby, and controls overlays (e.g., hiding the transform cage when a gizmo is active). This makes the system more robust and reusable—any other tool can also make use of the Gizmo Manager.
Screenshot 2025年09月01日 123538
New Gizmos
- Star/Polygon – A radius gizmo for adjusting size with snapping support, plus a gizmo to change the number of points/sides.
Untitled.video.-.Made.with.Clipchamp.24.mp4
- Arc/Circle – The Arc now has a turns handler for adjusting start and sweep angles, along with a radius gizmo.
Untitled.video.-.Made.with.Clipchamp.25.mp4
- Spiral – Includes three gizmos: inner/outer radius control, number of turns, and tightness adjustment.
Untitled.video.-.Made.with.Clipchamp.26.mp4
- Grid – Provides a rectangular gizmo for modifying X and Y spacing, an isometric gizmo for adjusting X spacing, and row/column gizmos to control the number of rows and columns.
cc-4.1.mp4
Screen-Recording.28.1.2.mp4
Screen-Recording.27.1.2.mp4
New Operation tool
By the end of the week, I began working on a new tool similar to the Shape Tool, but focused on adding nodes such as Circular Repeat (already implemented) and, in the future, Repeat. This tool allows users to click and drag to adjust the radius and create circular repeat instances. By reusing the already implemented gizmos—such as the number-of-points and radius gizmos—we extended them to the Circular Repeat node, enabling users to modify both the radius and the instance count in an intuitive way.
Untitled.video.-.Made.with.Clipchamp.27.mp4
Challenges and Learnings
-
Gizmo Manager API Design – The first challenge I faced was figuring out what the Gizmo Manager API should look like. I spent several days iterating through different versions, discussing with my mentor, and refining the design. Initially, it was a bit disappointing to realize that my earlier attempts could have been better, but this was an important part of the learning process. In the end, I’m glad I arrived at a cleaner and more extensible interface.
-
Math for Gizmos – Another major hurdle was the math involved in implementing certain gizmos. For the Star shape, I had to derive how one radius should change when keeping the other constant so that a set of points become collinear. This required working with polar coordinates and applying the Cartesian area-of-triangle formula to establish a relationship. It turned out to be a fun exercise in applied math, something I hadn’t done before. Similarly, reverse-engineering the math for isometric gizmos was also quite tricky.
-
Spiral Approximation Algorithm – Finding and implementing an efficient algorithm for spirals was another tricky part. The goal was to achieve a good approximation while keeping the computation lightweight. The current approach works, but when the arc of the spiral is adjusted, the approximation breaks down. I still need to develop a more robust algorithm to address this.
-
These were the main areas where I got stuck and ended up spending more time than I initially expected, but they were also the points where I learned the most.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 12 comments
-
Week 1
- Unified Shape Tool: Aliased the Line, Ellipse, and Rectangle tools to a new Shape Tool (formerly the Polygon Tool) and added transform cage support, enabling resize, skew, and rotation for created shapes.
progress.6.mp4
- Implemented Point handle gizmo for Star Shape
test-63.mp4
Next week targets
Implementing polishing and adding more gizmos to the star shape
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 2
- Implemented point radius handle gizmo complete with snapping and overlays
test-75.mp4
- Implemented no of point gizmo
73.mp4
- Added an outline overlay for the original shape to visualize what the gizmo are actually affecting
test-74.mp4
Next week targets
- will be working on implementing above two gizmo for the polygon shape
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week-3
- Implemented point-radius handle and number of point handle for polygon shape, shape outlines for the polygon shape
test-76.mp4
- Added 'Arc' as one of the shapes that can be drawn by the shape tool
test-77.mp4
-
Implemented [ / ] keys to decrease/increase the Number of sides when drawing the star or polygon shape
-
worked on refactoring the gizmo system and merging the pr
Next-week target
- Add a gizmo to rotate the arcs for the Arc shape
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 4
- Completed and opened a pull request introducing a new, modular gizmo handler system.
- Implemented arc gizmos
test-79.mp4
- fixed some path-tool bugs
- started working on spiral node
80.mp4
Next week targets -
- Add new spiral types (e.g., logarithmic, Euler, etc.) and integrate them into the Shape Tool.
- Also fix the angle wrapping issue is arc-shape
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 5
- Implemented log and Archimedean and integrated it in the shape tool
discord-week-5.mp4
- tried different algorithms for making the spirals
- fixed arc sweep angle gizmo wrapping issue
- started working on the spiral gizmos (small preview)
github-update.mp4
Next Week targets
- fix some small bugs in arc-gizmos
- complete the spiral gizmos
- start working on grid node gizmos
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 6
- Almost Done with Spiral gizmos
- Fixed arc-gizmos bug and opened a pr
test-9.mp4
Next Week Targets
- Complete Spiral gizmos
- Start working on grid-node gizmos
- Start working on circle shape and circle gizmos
Beta Was this translation helpful? Give feedback.
All reactions
-
Week 7
- Added Circle in shape tool and implemented radius gizmo for arc and circle
- Did testing of all art showcases this year on master to check if it breaks and find which commit broke it
test-17.mp4
Beta Was this translation helpful? Give feedback.
All reactions
-
Week 8
- Integrated grid shape in shape tool (isometric is fixed later)
- working on grid gizmos
cc-2.mp4
Beta Was this translation helpful? Give feedback.
All reactions
-
Week 9
- Fixed bugs in radius gizmo in circle and arc where click detection was not correct
- fixed drag behavior when the radii are negative in star shape
Could not give enough time due to family emergency will make up in upcoming weeks
Beta Was this translation helpful? Give feedback.
All reactions
-
Week 10
- Implemented Isometric grid drawing
- fixed spiral gizmos
- working on isometric grid gizmos
28.1.mp4
Beta Was this translation helpful? Give feedback.
All reactions
-
Week 11
- Implemented the x- spacing gizmo
- working on the changing the y-spacing as shown in the video
Screen-Recording.28.1.1.mp4
Screen-Recording.27.1.1.mp4
Beta Was this translation helpful? Give feedback.
All reactions
-
Week 12
- moved line gizmo into the gizmo manager(working on the pr)
- completed grid gizmos including isometric grid
e5ccecaab3c5fbf8.1.mp4
- Started work on a new Operation Tool and integrating count and radius gizmos
Untitled.video.-.Made.with.Clipchamp.23.mp4
Untitled.video.-.Made.with.Clipchamp.22.mp4
Untitled_video_-_Made_with_Clipchamp_20.1.mp4
Beta Was this translation helpful? Give feedback.