Anti-Aliasing

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
vanuan
Posts: 539
Joined: Wed Oct 24, 2018 9:49 pm

Re: Anti-Aliasing

Post by vanuan »

Circles still look kind of jagged. Any idea why?
User avatar
kwahoo
Posts: 688
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Anti-Aliasing

Post by kwahoo »

vanuan wrote: Wed Jan 20, 2021 3:13 pm Circles still look kind of jagged. Any idea why?
Could you post a screenshot? They look fine for me.
User avatar
vanuan
Posts: 539
Joined: Wed Oct 24, 2018 9:49 pm

Re: Anti-Aliasing

Post by vanuan »

Here's a magnified image. As you can see, there's no anti-aliasing, it's not blurred at all. Maybe it's not vector?
Attachments
Screenshot from 2021-01-25 12-39-53.png
Screenshot from 2021-01-25 12-39-53.png (5.13 KiB) Viewed 1060 times
User avatar
kwahoo
Posts: 688
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Anti-Aliasing

Post by kwahoo »

Is this from Sketcher? Mine "dot" is bit blurred, but it's not perfect AA indeed.
Image
I use MSAAx8

Code: Select all

OS: Ubuntu 20.04.1 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2020.1230.23076 +3055 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: c7f24fa0eb98232200ab5cae1ac3be8786a22c2c
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Polish/Poland (pl_PL)
User avatar
chennes
Veteran
Posts: 3914
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Anti-Aliasing

Post by chennes »

The occurrence of the word "bitmaps" on line 3827 of ViewProviderSketch.cpp seems to point to the likely culprit:

Code: Select all

    edit->PointSet->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex("CIRCLE_FILLED", edit->MarkerSize);
I'd guess that vertices are bitmaps in Inventor, based on this snippet. I have no idea if that can be addressed.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
vanuan
Posts: 539
Joined: Wed Oct 24, 2018 9:49 pm

Re: Anti-Aliasing

Post by vanuan »

Yeah, the issue seems to be the raster graphics
https://github.com/FreeCAD/FreeCAD/blob ... itmaps.cpp

So it first should be converted to SVG and then scaled according to DPI as it's done for cursors: https://forum.freecadweb.org/viewtopic.php?&t=48719

After that, anti-aliasing could be applied, as it can't be applied to raster images.

But it's a bit complicated since SoMarkerSet is a part of Coin/Inventor API
https://coin3d.github.io/Coin/html/clas ... erSet.html
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Anti-Aliasing

Post by Chris_G »

Would this help : Add marker from SVG ?
hyarion
Posts: 139
Joined: Fri Jun 26, 2020 6:08 pm

Re: Anti-Aliasing

Post by hyarion »

vanuan wrote: Mon Jan 25, 2021 10:41 am Here's a magnified image. As you can see, there's no anti-aliasing, it's not blurred at all. Maybe it's not vector?
The marker in your magnified image was so ugly that I had do something about it...
https://github.com/FreeCAD/FreeCAD/pull/4323
It only tweaks the pixels in the bitmaps though.
Post Reply