Grid and Meta Grid

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Grid and Meta Grid

Post by CVH » Fri Feb 09, 2024 2:18 pm

Chips&Chips wrote:
Fri Feb 09, 2024 4:42 am
After some experimentation I found a custom gray color that seems to work.
FYI: Most (all) QCAD system colors use the RGBA color panel with the A standing for the Alpha channel ... Transparency/opacity.
Where 0 is fully transparent and 255 is full opacity.

Maybe that helps in getting the wavy effect away because the screen driver does some assumptions based values of neighboring pixels.
Less transparent may yield a better visual representation.

I even have a screen driver (NVIDIA) method that will optimize the mathematical approach depending text, film, game, steady picture, and so on.
It is a 8 step process with multiple choose and in the end it told me it was optimized for text and CAD ...
... Big surprise there was that my driver card originally came out the box optimized for gaming purposes.

Regards,
CVH

User avatar
Chips&Chips
Full Member
Posts: 68
Joined: Mon Nov 13, 2023 12:15 pm

Re: Grid and Meta Grid

Post by Chips&Chips » Fri Feb 09, 2024 2:28 pm

It's late again. I have been busy making schematic symbols for my drawing while finishing my pizza. But I took a quick look at my second screen shot with the Meta Grid fading in and out. When you look at the two sets of lines, Grid and Meta Grid, it shows clearly that the Grid lines are on TOP of the Meta Grid lines. So when the two lines are exactly aligned, the Grid lines show but the Meta Grid ones do not. Not at all. And where the Grid lines cross the Meta Grid lines, only the color of the Grid line shows: the Meta Grid line is interrupted. On top of that it appears that the Meta Grid lines are sharp, just one or two pixels wide while the Grid lines are spread out over two, three, or perhaps even four pixels. I believe this is also responsible for the unpredictable results that I was getting when I tried different values for the Grid and Meta Grid spacing.

This tells me that the two line colors are being applied to the screen in SEQUENCE. First the Meta Grid lines are written to the screen memory and then the Grid lines are written on top of that. Where the two coincide, the Grid line color wins and the Meta Grid line color is completely eliminated.

I would think it would be better to either:

A. Write the lighter color first and then the darker one. That way the darker one would always prevail.
or
B. Make the Meta Grid lines two lines (rows of pixels) with a space between for the Grid line pixels. Each would have it's own pixel locations so neither would overwrite the other. This would require that the Grid lines be sharpened to only one or two pixels wide.

I am going to look at this more after some sleep.
Paul A.
SE Texas
Windows 10
QCAD V 3.29.3.0

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Grid and Meta Grid

Post by CVH » Fri Feb 09, 2024 7:18 pm

Chips&Chips wrote:
Fri Feb 09, 2024 2:28 pm
This tells me that the two line colors are being applied to the screen in SEQUENCE. First the Meta Grid lines are written to the screen memory and then the Grid lines are written on top of that. Where the two coincide, the Grid line color wins and the Meta Grid line color is completely eliminated.
Your statement does not explain the oscillating color nature.
Surely everything is added to the screen in sequence, that might change with the use of quantum processors. :lol:
Even the results from modern parallel thread computing is at some point initiated/handled sequentially.
Changing the order of things, double (Meta) Grid lines, considering these things won't happen anytime soon.

Yes, Meta Grid lines are drawn first, followed by Grid points or lines.
https://github.com/qcad/qcad/blob/maste ... #L269-L272
With a round trip via https://github.com/qcad/qcad/blob/maste ... hoGrid.cpp
See Line 467 & 490 but those will bring you somewhat further down.
And there you might remark the it are simple RLine's handled by RGraphicsViewImage.paintGridLine

The sequence alone does not explain why horizontal 4'-8" is dark gray while 5'-0" has almost the color of a Grid line.
Similar for vertical 4'-0" vs 7'-6" and the change is gradual, repeating.
You mention black Meta Grid lines and that explains the dark grey nature compared with the black tick marks of the rulers.
Black is blended with the grey what gives dark gray, all depends on the Alpha channel of the gray color of the Grid line.
Set that to 255 and nothing of the black will shine through.

You are practically inverting the Drawing panel color scheme.
I stick to all auto Grid step values, auto scaling.
With my background color set to a very light gray #e8e8e8 (232,232,232) and this has no Alpha channel. (Sure, 255, fully saturated)
Knowing that for each Meta Grid Line there is also a Grid Line I would set the Meta color black with the Alpha higher than 25%, rather 75% or 192.
I kept my Grid color as default what was #c0c0c0 (192,192,192) with the same Alpha value 75%, only opted for lines.

The result looks perfectly OK, no variation in Grid + Meta Grid colors and that in any zoom state.

Gray+DarkGray_GridOnGrayBack.png
Ignore the forum preview, view the image at 100% (1539 by 859px)
Gray+DarkGray_GridOnGrayBack.png (68.52 KiB) Viewed 610 times
I know, the forum preview looks quite poor ... :wink:

The why of this test:
At some point one starts to wonder if all that Math forth and back would place Grid lines exactly over Meta Grid lines.
Pixel based >> Real world size >> Ceil, log, round, conversion factors >> Eventually displayed pixel based.
This standard gray+black on light gray test excludes that it is a mathematical issue introduced by QCAD & Qt.
With no trial combination I can replicate the oscillating color saturation issue.

How does my (not scaled) pattern looks on your screen?

Regards,
CVH,

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4943
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Grid and Meta Grid

Post by Husky » Fri Feb 09, 2024 10:23 pm

As a matter of fact not many proffecionals are using grid to design a CAD drawing. For me it is comparable in this area of expertise like coloring by numbers. I understand that this feature doesn't get more attention from the Qcad developer.

This said, it doesn't mean that for one or an another drafter this feature is very important. Even if it is a minority. In such situation I recomment to get creative on your own. You already (over the last 20 or so forum threads) figured out what would work best for your personal situation. Color, spacing meta etc etc. - everything what you need.
Why not just design your own grid with points and/or lines and use it as locked but snappable layer for your particular case? Color, spacing, linetype can be exactly as you like/need it.

Don't hold your breath to get a for you perfect working solution from Ripponsoft. There are much more important things on the todo list with a much higher priority. :wink:
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

User avatar
Chips&Chips
Full Member
Posts: 68
Joined: Mon Nov 13, 2023 12:15 pm

Re: Grid and Meta Grid

Post by Chips&Chips » Sat Feb 10, 2024 2:01 am

I have not pushed for any new features or revisions of existing ones. I think I am far too new to QCAD to formulate any realistic suggestions.

This and the other threads that I have participated in are only an effort to UNDERSTAND how things DO, presently work in QCAD. I seek that knowledge so I can better use the program.

IIRC, before I purchased QCAD Pro, I had a discussion in the forum for that and someone else asked questions aimed at possibly making improvements to QCAD. I did answer those questions as best as I could. But again, I was not asking for any changes there, just knowledge.

An excellent example of this is my thread about having a real-time mirror reverse of an area of my current drawing. I did not have high hopes, but it turned out that there was a way to do that in QCAD. I did not ask for any changes; just a knowledge of how things did already work. Again, someone else jumped in with another suggestion that, apparently would require such changes. Frankly I think I like the existing method better.

I have been making engineering drawings since the late 1960s and have been using CAD since the 1980s, IIRC. I used AutoCAD back in the MS DOS days but quickly switched to a more affordable program. QCAD is not my first rodeo. So I probably come to it with a lot of baggage. But, having learned to use numerous CAD programs over the years, I do realize that there will be new ways of doing things; some good and some not so much so. Often I/we must accept the good with the bad.

As for making suggestions or requests for changes, when I do have something to suggest I will use the board here that has been designated for that.

I DO GREATLY APPRECIATE this BB and the people here who are so willing to read my posts and answer my questions. I found a similar situation when I switched away from AutoCAD back in the 80s. And, IMHO, there is no better reason for choosing a CAD program than this. As far as I am concerned, the people behind QCAD are doing a great job and I salute you.
Paul A.
SE Texas
Windows 10
QCAD V 3.29.3.0

Post Reply

Return to “QCAD 'How Do I' Questions”