Anti-Aliasing

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
vanuan
Posts: 504
Joined: Wed Oct 24, 2018 9:49 pm

Re: Anti-Aliasing

Postby vanuan » Wed Jan 20, 2021 3:13 pm

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

Re: Anti-Aliasing

Postby kwahoo » Sun Jan 24, 2021 10:11 pm

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: 504
Joined: Wed Oct 24, 2018 9:49 pm

Re: Anti-Aliasing

Postby vanuan » 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?
Attachments
Screenshot from 2021-01-25 12-39-53.png
Screenshot from 2021-01-25 12-39-53.png (5.13 KiB) Viewed 299 times
kwahoo
Posts: 382
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Anti-Aliasing

Postby kwahoo » Tue Jan 26, 2021 5:26 pm

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
Posts: 546
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Anti-Aliasing

Postby chennes » Tue Jan 26, 2021 6:03 pm

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
User avatar
vanuan
Posts: 504
Joined: Wed Oct 24, 2018 9:49 pm

Re: Anti-Aliasing

Postby vanuan » Wed Jan 27, 2021 11:02 am

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
Posts: 1636
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Anti-Aliasing

Postby Chris_G » Wed Jan 27, 2021 11:28 am

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

Re: Anti-Aliasing

Postby hyarion » Wed Jan 27, 2021 11:16 pm

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.