Welcome! Log In Create A New Profile

Advanced
Rectifier version 1.9
avatarDecember 13, 2012 08:07AM
When converting quads + lines into rect primitives, Rectifier sometimes provided values near but not equal to 1. I delved into my code and soon found a bug causing this behaviour... then found an even better method that provides tidier and more compact LDraw code.

Get new version 1.9.

Here is a sample output with Rectifier 1.8:
1 16 0 0 0 0 0 10 -1.73648 0.9848078 0 -9.84808 -1 0 rect.dat
1 16 30 -0.5 0 0 0 10 0.5 20 0 -10 1 0 rect.dat
1 16 -30 -0.555555 0 0 0 10 0.555555 0.9984604 0 -10 0.9999999 0 rect.dat
1 16 -60 -0.555555 1 0 0.005546911 10 0.555555 0.9984604 0 -10 0.9999999 -1 rect.dat
1 16 -90 -2.055555 1 0 -0.1427451 10 0.555555 0.9984604 1.5 -10 0.9999999 -1 rect.dat
1 16 -111.2485 -0.555555 -44.99815 3.827 -0.01610229 9.6215 0.555555 0.9985745 0 -9.2388 0.9999999 2.90295 rect.dat
And the output obtained with Rectifier 1.9:
1 16 0 0 0 0 0 10 -1.73648 1 0 -9.84808 0 0 rect.dat
1 16 30 -0.5 0 0 0 10 0.5 1 0 -10 0 0 rect.dat
1 16 -30 -0.555555 0 0 0 10 0.555555 1 0 -10 0 0 rect.dat
1 16 -60 -0.555555 1 0 0 10 0.555555 1 0 -10 0 -1 rect.dat
1 16 -90 -2.055555 1 0 0 10 0.555555 1 1.5 -10 0 -1 rect.dat
1 16 -111.2485 -0.555555 -44.99815 3.827 0 9.6215 0.555555 1 0 -9.2388 0 2.90295 rect.dat
In this example, LDraw code was shrunk at 37% with 1.8, it's now only 29%.
Note that there was nothing wrong with 1.8 result, as inlining back both versions gives exactly the same lines and quads.
Attachments:
open | download - source.dat (1.3 KB)
open | download - oldrect.dat (477 bytes)
open | download - newrect.dat (374 bytes)
SubjectAuthorViewsPosted
Rectifier version 1.9 Attachments Philippe Hurbain662December 13, 2012 08:07AM
Re: Rectifier version 1.9 Michael Heidemann372December 13, 2012 11:24AM



Sorry, only registered users may post in this forum.

Click here to login