Adding a bit more

Even though my final project viva is near I’m still improving and adding on in eCAD.

I tried to correct the ellipse’s pasting problem but I guess I made a hasty commit which should have been made only after some testing.

Today I’ve implemented a radial dimension but haven’t send the PR yet, as it needs some minor improvements. The diametric dimension is almost similar to the radial one, so it’d also be done by tomorrow.

Shooting Down Issues

Apart from working on the Aligned Dimension, I’ve solved two issues today that have been pending for some time.

The flickering issue of ellipse was solved pretty easily, just had to set the code at the correct place.

While the Arc’s selection issue was quite prominent since it has been implemented. Its shape wasn’t set properly. And earlier when I tried to solve this, I always thought I need to do some more calculations to properly define the shape without those minor glitches. But today when I started working on it, after I assigned myself this task once again, a bulb went off in my head. Why do I always over think and try to do everything in complicated way? It was super easy to do with QPainterPathStroker.

Vertical Dimension

I’ve added Vertical Dimension in eCAD today and also made some changes regarding text and arrow.

As far as linear dimensioning is concerned, horizontal and vertical has been done.

Aligned dimension should not be much different and I’m hoping to be done with it by tomorrow.

Next, radial and diametric dimensions are lined up and I’ll be working on them side by side.


After implementing the initial snapping, I’ve tasked the rest of snapping to Kamalpreet. She has implemented Snap to End Points and Snap to Center so far. And is working on Snap to Middle with Snap to Entity coming close behind.

Meanwhile I was busy with trying to do the dimensioning, which I had successfully completed last week but with few glitches and errors popping up now and then.

And today I sent the PR for Horizontal Dimensioning and now working on the Vertical for which I’m still setting up the bounding rectangle.

Snap to Grid

I’ve implemented Snap-to-Grid feature in eCAD today. It was quite easy, just had to round off the mouse position in the scene to the grid points.

So I created a new function to calculate the round off and set a temporary point in the eventFilter() so that it will calculate according to the grid size.

And this temporary point has been used wherever the mouse’s scene position has been used.

Now I’m going to implement dimensioning.

Mouse Axes Disappeared

I observed one little issue, that mouse axes disappeared when we are zoomed in. So on my code walkthrough I saw that the QGraphicsColorizeEffect significantly lowers the performance of QGraphicsView, in short the whole eCAD.

And when I removed that effect the performance shoot up as well as the axes appeared.

So this color of axes must be set in some different manner and for now this issue has been resolved.

Now i’m working on Snap-to-Grid feature that eCAD lacks.

Solving issues back to back

We have been solving eCAD issues back to back. I’ve also added mouse-axes preview while drawing entities which is quite useful for a user working in a CAD environment.

Once again I used eventFilter function to draw those axes preview. And I had to use QGraphicsEffect on them to give a different effect to them.

Solved three issues as well.

  1. Corrected the Menu Check for both script and console widgets
  2. Fixed the issue of grid option for respective view
  3. Changed Origin from qgraphicsitem to a background item.


New Bugs

Every time I work in eCAD, it seems I find one or another bug. Maybe that’s because I’m always on the lookout for something to improve in it.

From last 2 days Kamalpreet and I have been working on correcting the coordinates of our CAD. It has the coordinates as ‘computer graphics’ with origin at the top left of the screen. But we usually work in a CAD software with more ‘drawing’ or ‘graph’ like sense with origin at the bottom left of the screen.

And today we solved it. We had to scale the scene by flipping the y-axis and then two of our entities, i.e Text and Image, had to be flipped as well.

I also solved an issue of empty text items saved in the scene.

Solving Bugs

We are now solving bugs and issues. After helping Kamalpreet in correcting the bounding rect() of ellipse entity, I have fixed the issue of line weight.

Earlier the width/weight of the entities drawn on scene changed as we zoom in/out of the scene.

Now it remains consistent, which is a pretty useful to get an overview of the drawings in CAD.

I’ve also implemented ‘Delete Entity’ feature which lets the user click on the entity to delete it.

Live Preview

At last we have successfully implemented live preview of the entities in eCAD. Kamalpreet and I have looked in this issue on and off since we started this project.

And today we did it. We tried to administer several different logic potions to our patient to get a live preview of an entity. We have searched a lot, asked as well on forums but never got the solution we wanted.

And that solution was gawking right at our faces and we never took notice. Sometimes things are way more simple than we reckon they are.

Now our eCAD looks more lively. 🙂