Ticket #1987 (new defect)

Opened 14 months ago

Last modified 2 weeks ago

Hatches from DWF files renders poorly using AGG Render

Reported by: fare Owned by:
Priority: low Milestone:
Component: Drawing Service Version: 2.2.0
Severity: trivial Keywords:
Cc: External ID:

Description

Hatches from DWF files renders poorly over AGG. It look to me that this is similar to ticket #1257. I'm providing proof and sample data(DWF is published from AutoCAD Map 2012). Images are served over WMS (EPSG:31276).

Attachments

AggBug.dwf Download (9.7 KB) - added by fare 14 months ago.
Sample DWF file
AggBug.dwg Download (62.0 KB) - added by fare 14 months ago.
Sample DWG file
ServedOverWmsAgg.png Download (254.2 KB) - added by fare 14 months ago.
Poor rendering
Polytriangles.png Download (48.9 KB) - added by fare 14 months ago.
How polytriangles looks
2.4Test2.png Download (35.3 KB) - added by fare 14 months ago.
v2.4 test 2
HatchesFix.png Download (172.0 KB) - added by fare 2 weeks ago.
Sample of rednering with gamma value 0.3
HatchesRendering.patch Download (2.8 KB) - added by fare 2 weeks ago.
Proposed patch - fixed style

Change History

Changed 14 months ago by fare

Sample DWF file

Changed 14 months ago by fare

Sample DWG file

Changed 14 months ago by fare

Poor rendering

Changed 14 months ago by fare

How polytriangles looks

Changed 14 months ago by zspitzer

can you try this out with the 2.4 test release?

In my own testing I found the DWF handling been improved

Changed 14 months ago by fare

v2.4 test 2

Changed 14 months ago by fare

I tried version 2.4 test 2 and result is pretty much same.(see image)

Changed 14 months ago by zspitzer

  • summary changed from DWF render poor in AGG to Hatches from DWF files renders poorly using AGG Render

Changed 2 weeks ago by fare

According to AGG sample page  http://www.antigrain.com/demo/ and "gouraud" sample there are two methods that can be used to hide this kind of problem - dilating the polygons and/or changing the gamma-correction value.

I tried implementing the dilating polygons but didn't manage to remove artifacts. So I switched to gamma correction.

I'm proposing patch that is attached. Drawing polytriangles is separated to another method of AGGRenderer class. Basically method is copy of method that is used to draw polygons but before rendering occurs gamma value is set to low value (test showed that value between 0.3-0.5 gives satisfying results) and then restored to value 1.0 once rendering is done.

Lowering gamma value gives sharper outer edges(less anti-aliasing) but for me this is acceptable trade of.

Changed 2 weeks ago by fare

Sample of rednering with gamma value 0.3

Changed 2 weeks ago by zspitzer

Can you send a post about this patch to mapguide-internals and request a review?

Changed 2 weeks ago by fare

Review request sent.

Thanks for suggestion zspitzer.

Changed 2 weeks ago by fare

Proposed patch - fixed style

Note: See TracTickets for help on using tickets.