Opened 6 years ago

Closed 4 years ago

#1987 closed defect (fixed)

Hatches from DWF files renders poorly using AGG Render

Reported by: fare Owned by: waltweltonlair
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 (7)

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

Download all attachments as: .zip

Change History (15)

Changed 6 years ago by fare

Attachment: AggBug.dwf added

Sample DWF file

Changed 6 years ago by fare

Attachment: AggBug.dwg added

Sample DWG file

Changed 6 years ago by fare

Attachment: ServedOverWmsAgg.png added

Poor rendering

Changed 6 years ago by fare

Attachment: Polytriangles.png added

How polytriangles looks

comment:1 Changed 6 years 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 6 years ago by fare

Attachment: 2.4Test2.png added

v2.4 test 2

comment:2 Changed 6 years ago by fare

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

comment:3 Changed 6 years ago by zspitzer

Summary: DWF render poor in AGGHatches from DWF files renders poorly using AGG Render

comment:4 Changed 5 years 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 5 years ago by fare

Attachment: HatchesFix.png added

Sample of rednering with gamma value 0.3

comment:5 Changed 5 years ago by zspitzer

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

comment:6 Changed 5 years ago by fare

Review request sent.

Thanks for suggestion zspitzer.

Changed 5 years ago by fare

Attachment: HatchesRendering.patch added

Proposed patch - fixed style

comment:7 Changed 4 years ago by waltweltonlair

Owner: set to waltweltonlair
Status: newassigned

comment:8 Changed 4 years ago by waltweltonlair

Resolution: fixed
Status: assignedclosed

Fixed in trunk with r7896.

Note: See TracTickets for help on using tickets.