Fix Winding in DATHeader

From LDraw.org Wiki
Revision as of 21:51, 21 April 2018 by Steffen (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page describes how to fix winding in a file using DATHeader.

If you have for example a file where at some point the winding is changed:

0 BFC CW
1 16 5.899 86 -55.174 1.029 -0.751882 0 0 0 2 1.1735 1 0 rect2p.dat
5 24 4.8702 88 -56.347 4.8702 84 -56.347 6.9282 88 -54 2.0705 88 -57.7273
5 24 6.9282 88 -54 6.9282 84 -54 4.8702 88 -56.347 10.9282 88 -47.0718
4 16 -4 88 -56.9282 -2.0706 88 -57.7274 -2.0521 88 -55.6382 -3 88 -55.1962
4 16 2.0706 88 -57.7274 4.8702 88 -56.347 3.6526 88 -54.7603 2.0521 88 -55.6382
4 16 4.8702 88 -56.347 6.9282 88 -54 5.1961 88 -53 3.6526 88 -54.7603
0 BFC CCW

Go to the Editor Tab. Mark the lines between both BFC statements. Click the right mouse button and choose from the context menu „Reverse Winding“.

You will got the following code:

0 BFC CW
1 16 5.899 86 -55.174 1.029 -0.751882 0 0 0 2 1.1735 1 0 rect2p.dat
5 24 4.8702 88 -56.347 4.8702 84 -56.347 6.9282 88 -54 2.0705 88 -57.7273
5 24 6.9282 88 -54 6.9282 84 -54 4.8702 88 -56.347 10.9282 88 -47.0718
4 16 -3 88 -55.1962 -2.0521 88 -55.6382 -2.0706 88 -57.7274 -4 88 -56.9282
4 16 2.0521 88 -55.6382 3.6526 88 -54.7603 4.8702 88 -56.347 2.0706 88 -57.7274
4 16 3.6526 88 -54.7603 5.1961 88 -53 6.9282 88 -54 4.8702 88 -56.347
0 BFC CCW

Now delete both BFC statement lines.

1 16 5.899 86 -55.174 1.029 -0.751882 0 0 0 2 1.1735 1 0 rect2p.dat
5 24 4.8702 88 -56.347 4.8702 84 -56.347 6.9282 88 -54 2.0705 88 -57.7273
5 24 6.9282 88 -54 6.9282 84 -54 4.8702 88 -56.347 10.9282 88 -47.0718
4 16 -3 88 -55.1962 -2.0521 88 -55.6382 -2.0706 88 -57.7274 -4 88 -56.9282
4 16 2.0521 88 -55.6382 3.6526 88 -54.7603 4.8702 88 -56.347 2.0706 88 -57.7274
4 16 3.6526 88 -54.7603 5.1961 88 -53 6.9282 88 -54 4.8702 88 -56.347

Now hit the "commit code changes" button. You can now save the file.

Finished. --Mikeheide (talk) 14:17, 13 November 2012 (PST)