Fixing rounding errors in primitives


Fixing rounding errors in primitives
#1
This is a continuation of this thread. The thread pointed out rounding errors in existing primitives. I have briefly discussed the issue with Chris, and what has to be done in order to fix the issue. He proposed that not only are fixed parts submitted, but also all official parts which have to be updated due to the changes.

Primitives are used very often in the LDraw library, so each change to a primitive will be associated with a large amount of affected files.

I encourage separate posts in this thread for each fixed primitive. Each post should contain:

- What the fix of the primitive is.
- An overview of all parts that use the primitive.
- Proposed fix of all parts that use the primitive and are affected.

This is my workflow. If you want to contribute to this, then I recommend using it as a starting point (and please find ways to optimize it, since this is taking a lot of time)

1) Use a primitive generator and tester like this to find a primitive with rounding errors.
2) Manually verify and document the error.
3) Fix the file (and the 8/ and 48/ version as well if affected)
4) Find files that use the primitive (I use "grep -ir primitive.dat ." since I use Linux tools, such as cygwin)
5) Go through each file and check all the points from lines of type 2, 3, 4 and 5. If any point lies next to a fixed point, then that point has to be updated. I have made a tool to find these points. If you are interested, I can share the tool with you. Right now it is a bit too technical to be released.
Reply
Fix of 1-4ring5.dat
#2
This post is for fixing 1-4ring5.dat.



The problem with the file was stated in the original thread, and I repost it here for completeness: 



1-4ring5.dat consists of quads based on the points from 1-4edge.dat.



The points in 1-4edge.dat are those of the quarter circle with diameter 1:

1 0 0

0.9239 0 0.3827

0.7071 0 0.7071

0.3827 0 0.9239

0 0 1



1-4ring5.dat spans from the quarter circle of diameter 5 to the quarter circle of diameter 6. It consists of the following points:



5 0 0

4.6195 0 1.9135

3.5355 0 3.5355

1.9135 0 4.6195

0 0 5



6 0 0

5.5433 0 2.2961

4.2426 0 4.2426

2.2961 0 5.5433

0 0 6



By scaling the points from 1-4edge.dat with 5 and 6, respectively, we get:



5 0 0

4.6195 0 1.9135

3.5355 0 3.5355

1.9135 0 4.6195

0 0 5



6 0 0

5.5434 0 2.2962

4.2426 0 4.2426

2.2962 0 5.5434

0 0 6



Which differ from the points in the official file where highlighted.


Calculations done in JS console, by:
'1 0 0 0.9239 0 0.3827 0.7071 0 0.7071 0.3827 0 0.9239 0 0 1'.split(' ').map(x => 5*x).join(' ');
'1 0 0 0.9239 0 0.3827 0.7071 0 0.7071 0.3827 0 0.9239 0 0 1'.split(' ').map(x => 6*x).join(' ');

The numbers in 1-4ring5.dat have to be updated as follows:
2.2961 to 2.2962
5.5433 to 5.5434

The file 48/1-4ring5.dat has been updated with the same changes to the points.

The files below all use 1-4ring5.dat or the 48/-version. They are handled as follows:
- Check out where 1-4ring5.dat is used.
- Find any geometries that match up to 1-4ring5.dat.
- Since the corrected points of 1-4ring5.dat are those between the ends, only points that intersect the points between the two ends are relevant for corrections.

The files that have overlaps with 1-4ring5.dat are typically safe, since the overlap hides any corrections made to the points. However. Overlaps should be avoided, as they cause issues for rendering engines. Overlaps are easily detected using Harlequin mode.

----------------------------------------------------------------------------
parts/30141.dat:1 16 -1.5 -6 -10 0 1 0 1 0 0 0 0 -1 1-4ring5.dat
parts/30141.dat:1 16 1.5 -6 -10 0 -1 0 1 0 0 0 0 -1 1-4ring5.dat

Hits two 1-4cylo.dat to form the trigger guard. 1-4cylo.dat contains only 1-4edge.dat and 1-4cyli.dat, which are both without the error.

----------------------------------------------------------------------------
parts/53790.dat:1 16 72 -82 -20.2 2.83333 0 0 0 0 -2.83333 0 -1 0 1-4ring5.dat
parts/53790.dat:1 16 72 -82 -18.2 2.83333 0 0 0 0 -2.83333 0 1 0 1-4ring5.dat
parts/53790.dat:1 16 72 -82 -7.4 2.83333 0 0 0 0 -2.83333 0 -1 0 1-4ring5.dat
parts/53790.dat:1 16 72 -82 -5.4 2.83333 0 0 0 0 -2.83333 0 1 0 1-4ring5.dat
parts/53790.dat:1 16 72 -82 5.4 2.83333 0 0 0 0 -2.83333 0 -1 0 1-4ring5.dat
parts/53790.dat:1 16 72 -82 7.4 2.83333 0 0 0 0 -2.83333 0 1 0 1-4ring5.dat
parts/53790.dat:1 16 72 -82 18.2 2.83333 0 0 0 0 -2.83333 0 -1 0 1-4ring5.dat
parts/53790.dat:1 16 72 -82 20.2 2.83333 0 0 0 0 -2.83333 0 1 0 1-4ring5.dat

Used by the sound holes in combination with:
1-4cyli.dat, 1-4edge.dat, and 1-4rin11.dat.
1-4rin11.dat has errors and will also be taken up.

----------------------------------------------------------------------------
parts/2884.dat:1 16 0 0 0 -7.2444 0 1.9411 0 1 0 -1.9411 0 -7.2444 48\1-4ring5.dat
parts/2884.dat:1 16 0 4 0 -7.2444 0 1.9411 0 -1 0 -1.9411 0 -7.2444 48\1-4ring5.dat

Hits 1-4ring6.dat on the outside and 48/1-4cyli.dat on the inside. Both are OK.

----------------------------------------------------------------------------
parts/61904.dat:1 16 0 0 20 2.121 0 2.121 2.121 0 -2.121 0 -1 0 1-4ring5.dat

Hits s/61904s01.dat on the outside and 3-4cyli.dat on the inside. Since s/61904s01.dat is used twice, and hits a 2-4ring5.dat instead of a 1-4ring5.dat on the second usage, the points therein should not be corrected.

----------------------------------------------------------------------------
parts/613p01.dat:1 7 -320 0 -320 66 0 0 0 1 0 0 0 66 48\1-4ring5.dat

Overlaps 48/1-4rin18.dat on the outside and 1-4rin65.dat on the inside. The overlap in this part should most likely be fixed, but it is not affected by changes to 1-4ring5.dat as is.

----------------------------------------------------------------------------
parts/35574.dat:1 16 0 10.5 0 2 0 0 0 -1 0 0 0 -2 1-4ring5.dat

Hits 4-4ring4.dat and 1-4cylo.dat at the inside indent. Both are OK.

----------------------------------------------------------------------------
parts/6002.dat:1 16 20 208 -20 12 0 0 0 1 0 0 0 -12 48\1-4ring5.dat

Hits 48/1-4rin18.dat on the outside and 48/1-4cyli.dat on the inside. Both of these have correct points.

----------------------------------------------------------------------------
parts/762.dat:1 16 -14 -6 -1 1 0 0 0 0 -1 0 1 0 1-4ring5.dat
parts/762.dat:1 16 -14 -6 1 0 0 1 -1 0 0 0 -1 0 1-4ring5.dat

Mirrored usages. They hit 1-4ring4.dat on the inside and 1-4cyli.dat on the outside. 1-4ring4.dat has correct points, while 1-4cyli.dat has the correct points, although the control points are unusual with y=0 instead of y=1, which is unconvensional.

----------------------------------------------------------------------------
parts/30368.dat:1 16 -6 9.5 -18.45 .75 0 0 0 0 -.75 -.26 1 0 1-4ring5.dat
parts/30368.dat:1 16 -6 9.5 -18.45 -.75 0 0 0 0 -.75 .26 1 0 1-4ring5.dat
parts/30368.dat:1 16 -6 9.5 -18.45 .75 0 0 0 0 .25 -.26 1 0 1-4ring5.dat
parts/30368.dat:1 16 -6 9.5 -18.45 -.75 0 0 0 0 .25 .26 1 0 1-4ring5.dat
parts/30368.dat:1 16 6 9.5 -18.45 -.75 0 0 0 0 -.75 -.26 1 0 1-4ring5.dat
parts/30368.dat:1 16 6 9.5 -18.45 .75 0 0 0 0 -.75 .26 1 0 1-4ring5.dat
parts/30368.dat:1 16 6 9.5 -18.45 -.75 0 0 0 0 .25 -.26 1 0 1-4ring5.dat
parts/30368.dat:1 16 6 9.5 -18.45 .75 0 0 0 0 .25 .26 1 0 1-4ring5.dat

File contains overlapping geometries, which should be fixed. 1-4ring5.dat is used in the eyes. However. None of the 26 point misalignments are involving 1-4ring5.dat, so all is OK.

----------------------------------------------------------------------------
parts/2359p01.dat:1 16 -320 0 -320 30 0 0 0 1 0 0 0 30 48\1-4ring5.dat
parts/2359p01.dat:1 16 -320 0 -320 66 0 0 0 1 0 0 0 66 48\1-4ring5.dat

Hits 2359p01.dat on the inside and 48/1-4rin45.dat on the outside of the first usage.
Hits 48/1-4rin65.dat on the inside and 48/1-4rin18.dat on the outside of the second usage. While the usages of 1-4ring5.dat is fine in the file, it does contain overlaps, which should be fixed.

----------------------------------------------------------------------------
parts/u1852p03.dat:1 0 2.4 -60 -2.1 0.6 0 0 0 0 -0.6 0 1 0 1-4ring5.dat

Hits 1-4ring2.dat on the inside and 1-4ndis.dat on the outside. All is OK.

----------------------------------------------------------------------------
parts/47455.dat:1 16 0 5 0 1.3435 0 1.3435 0 -1 0 1.3435 0 -1.3435 48\1-4ring5.dat
parts/47455.dat:1 16 0 -5 0 1.15665 0 1.50737 0 1 0 1.50737 0 -1.15665 48\1-4ring5.dat

Overlaps several other geometries on the outside, which should be fixed. The file also has BFC errors, which should be fixed. Correcting 48\1-4ring5.dat for now should not be an issue.

----------------------------------------------------------------------------
parts/2431pw1.dat:1 0 -6.3 0 -2.5 0 0 0.2 0 1 0 -0.25 0 0 1-4ring5.dat
parts/2431pw1.dat:1 0 33.3 0 -2.5 0 0 0.2 0 1 0 -0.25 0 0 1-4ring5.dat

File contains overlaps. Used in the black inner circle of the O's in "LEGOREDO" where there are multiple overlaps with adjacent geometries.

----------------------------------------------------------------------------
parts/31002.dat:1 16 166 82 46 2 0 0 0 -1 0 0 0 2 1-4ring5.dat
parts/31002.dat:1 16 -166 82 -46 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat
parts/31002.dat:1 16 166 82 -46 0 0 2 0 -1 0 -2 0 0 1-4ring5.dat
parts/31002.dat:1 16 -166 82 46 0 0 -2 0 -1 0 2 0 0 1-4ring5.dat

Hits 1-4ring6.dat on the outsides and 1-4cyli.dat on the insides. All OK.

----------------------------------------------------------------------------
parts/32324.dat:1 16 12 24 28 1 0 0 0 -1 0 0 0 -1 1-4ring5.dat
parts/32324.dat:1 16 12 24 -28 0 0 1 0 -1 0 1 0 0 1-4ring5.dat
parts/32324.dat:1 16 -12 24 -28 -1 0 0 0 -1 0 0 0 1 1-4ring5.dat
parts/32324.dat:1 16 -12 24 28 0 0 -1 0 -1 0 -1 0 0 1-4ring5.dat

Hits 1-4ring3.dat on the outside and 1-4cyli.dat on the inside. All OK.

----------------------------------------------------------------------------
parts/3039p0u.dat:1 4 -10 11.314 -21.314 -1 0 0 0 0.707107 0.848528 0 0.707107 -0.848528 1-4ring5.dat
parts/3039p0u.dat:1 4 10 11.314 -21.314 0 0 1 0.848528 0.707107 0 -0.848528 0.707107 0 1-4ring5.dat

Hits 1-4ring3.dat on the outside and 1-4ring3.dat on the inside. All OK.

----------------------------------------------------------------------------
parts/31001.dat:1 16 106 82 46 2 0 0 0 -1 0 0 0 2 1-4ring5.dat
parts/31001.dat:1 16 -106 82 -46 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat
parts/31001.dat:1 16 106 82 -46 0 0 2 0 -1 0 -2 0 0 1-4ring5.dat
parts/31001.dat:1 16 -106 82 46 0 0 -2 0 -1 0 2 0 0 1-4ring5.dat

Same as the other Primo parts. OK.

----------------------------------------------------------------------------
parts/449.dat:1 16 -95 -154 2 -4 0 0 0 0 -4 0 -4 0  1-4ring5.dat
parts/449.dat:1 16 95 -154 2 0 0 4 -4 0 0 0 -4 0  1-4ring5.dat
parts/449.dat:1 16 95 -154 -2 4 0 0 0 0 -4 0 4 0  1-4ring5.dat
parts/449.dat:1 16 -95 -154 -2 0 0 -4 -4 0 0 0 4 0  1-4ring5.dat

Hits 1-4ring1.dat on the insides and 1-4ring6.dat on the outsides. All OK.

----------------------------------------------------------------------------
parts/31149.dat:1 16 166 82 106 2 0 0 0 -1 0 0 0 2 1-4ring5.dat
parts/31149.dat:1 16 -166 82 -106 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat
parts/31149.dat:1 16 166 82 -106 0 0 2 0 -1 0 -2 0 0 1-4ring5.dat
parts/31149.dat:1 16 -166 82 106 0 0 -2 0 -1 0 2 0 0 1-4ring5.dat

Same as the other Primo parts. OK.

----------------------------------------------------------------------------
parts/973p1q.dat:1 0 5.5 1.5 -10 0 0 0.5 0.5 0 0 0 1 0 1-4ring5.dat

Use in upper black collar clip on the right side. Hits 1-4ring6.dat on the outside and 1-4disc.dat on the inside. All OK for 1-4ring5.dat, but the 1-4disc.dat has a T-section on the left, which should be avoided.

----------------------------------------------------------------------------
parts/43086.dat:1 16 0 0 0 40 0 0 0 1 0 0 0 40 48\1-4ring5.dat

Used as the big upper flat area between the studs. Hits 48/1-4cylo.dat on the outside and 48/1-4cylo.dat on the inside as well. That primitive has no incorrect points.

----------------------------------------------------------------------------
parts/31148.dat:1 16 106 82 106 2 0 0 0 -1 0 0 0 2 1-4ring5.dat
parts/31148.dat:1 16 -106 82 -106 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat
parts/31148.dat:1 16 106 82 -106 0 0 2 0 -1 0 -2 0 0 1-4ring5.dat
parts/31148.dat:1 16 -106 82 106 0 0 -2 0 -1 0 2 0 0 1-4ring5.dat

Same as the other Primo parts. OK.

----------------------------------------------------------------------------
parts/32531.dat:1 16 32 24 28 1 0 0 0 -1 0 0 0 -1 1-4ring5.dat
parts/32531.dat:1 16 -32 24 28 0 0 -1 0 -1 0 -1 0 0 1-4ring5.dat
parts/32531.dat:1 16 -32 24 -28 -1 0 0 0 -1 0 0 0 1 1-4ring5.dat
parts/32531.dat:1 16 32 24 -28 0 0 1 0 -1 0 1 0 0 1-4ring5.dat

Same usage as in the other Technic frame 32324.dat by the same author, so all OK.

----------------------------------------------------------------------------
parts/609p01.dat:1 16 -320 0 -320 74 0 0 0 1 0 0 0 74 48\1-4ring5.dat

Hits 48/1-4rin37.dat on the outside and 48/1-4rin36.dat on the inside. All OK, but the file has overlaps elsewhere, which should be fixed.

----------------------------------------------------------------------------
parts/3298p73.dat:1 15 0 12.3976 -34.7952 0 0 1 -.4472 .8944 0 .8944 .4472 0 1-4ring5.dat
parts/3298p73.dat:1 15 0 6.3604 -22.7208 0 0 .5 .2236 .8944 0 -.4472 .4472 0 1-4ring5.dat
parts/3298p73.dat:1 16 0 6.3604 -22.7208 0 0 1 .4472 .8944 0 -.8944 .4472 0 1-4ring5.dat

The first usage hits 2-4disc.dat on the inside and quads on the outside. The quads need realignment after fixing 1-4ring5.dat. The other usages hit 2-4disc.dat on the inside and other ring primitives on the outside, which is OK.

The file has 33 misaligned points in the triangles and quads. 3 of these involve 1-4ring5.dat.
The points "4.2426 10.5003 -31.0006" have been changed to "4.2426 10.5003 -31.0006" in the file.

----------------------------------------------------------------------------
parts/41680.dat:1 16 0 7 0 1.3435 0 1.3435 0 -1 0 -1.3435 0 1.3435 48\1-4ring5.dat
parts/41680.dat:1 16 0 -7 0 1.3435 0 1.3435 0 1 0 1.3435 0 -1.3435 48\1-4ring5.dat

They both hit a single 48/1-4cyli.dat on the inside and two 48/1-4cyli.dat on the outside. All OK.

----------------------------------------------------------------------------
parts/6059.dat:1 16 0 136 0 0 0 8 0 1 0 -8 0 0 1-4ring5.dat

Hits 1-4ring6.dat on the outside and quads on the inside. The quads have to be realigned after changing 1-4ring5.dat.

----------------------------------------------------------------------------
parts/32532.dat:1 16 68 24 -32 0 0 -1 0 -1 0 -1 0 0 1-4ring5.dat
parts/32532.dat:1 16 68 24 32 -1 0 0 0 -1 0 0 0 1 1-4ring5.dat
parts/32532.dat:1 16 -68 24 32 0 0 1 0 -1 0 1 0 0 1-4ring5.dat
parts/32532.dat:1 16 -68 24 -32 1 0 0 0 -1 0 0 0 -1 1-4ring5.dat

Same usage as in the other Technic frames, so all OK.

----------------------------------------------------------------------------
parts/31007.dat:1 16 46 82 46 2 0 0 0 -1 0 0 0 2 1-4ring5.dat
parts/31007.dat:1 16 -46 82 -46 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat
parts/31007.dat:1 16 46 82 -46 0 0 2 0 -1 0 -2 0 0 1-4ring5.dat
parts/31007.dat:1 16 -46 82 46 0 0 -2 0 -1 0 2 0 0 1-4ring5.dat

Same as the other Primo bricks. OK.

----------------------------------------------------------------------------
parts/s/54713s01.dat:1 16 72 -82 -117 2 0 0 0 0 -2 0 -1 0 1-4ring5.dat

Hits 1-4rin12.dat on the outside and 1-4cyli.dat on the inside. All OK.

----------------------------------------------------------------------------
parts/s/685s01.dat:1 16 0 14 0 1 0 0 0 -1 0 0 0 -1 1-4ring5.dat
parts/s/685s01.dat:1 16 0 14 0 -1 0 0 0 -1 0 0 0 1 1-4ring5.dat
parts/s/685s01.dat:1 16 0 14 0 0 0 1 0 -1 0 1 0 0 1-4ring5.dat
parts/s/685s01.dat:1 16 0 14 0 0 0 -1 0 -1 0 -1 0 0 1-4ring5.dat

A 4-4ring5.dat should have been used instead. The four prinmitives hit a single 4-4ring4.dat on the inside and four 1-4ring6.dat's on the outside. Here a single 4-4ring6.dat should also have been used instead. All OK from the perspective of 1-4ring5.dat.

----------------------------------------------------------------------------
parts/s/3070batb.dat:1 16 0.5 0 -3 .5 0 0 0 1 0 0 0 -.5 1-4ring5.dat

No other part hits the fauly points within this sub-model.

----------------------------------------------------------------------------
parts/s/41857s01.dat:1 16 0 40 58 0 0 1 0 -1 0 1 0 0 1-4ring5.dat

Hits 1-4cyli.dat on the outside and 1-4cyli.dat on the inside. All OK.

----------------------------------------------------------------------------
parts/s/93568s02.dat:1 16 0 -5.5 0 0 0 2.5 0 -1 0 -2.5 0 0 1-4ring5.dat

Used as the bottom. Hit by quads. Although there are 117 point misalignments in this file, none of them are against the 1-4ring5.dat after correction. That is, the points of the quads are differing less than 0.00005 from those of 1-4ring5.dat.

----------------------------------------------------------------------------
parts/s/3070batr.dat:1 16 0.5 0 -4 0.5 0 0 0 1 0 0 0 0.5 1-4ring5.dat

Overlaps with other geometries. Hits a 1-4ring3.dat on the outside and nothing on the inside. All OK, but the overlaps should be fixed.

----------------------------------------------------------------------------
parts/s/918s01.dat:1 16 -40 -40 2 0 0 -2 -2 0 0 0 1 0 1-4ring5.dat
parts/s/918s01.dat:1 16 57 -40 2 0 0 2 -2 0 0 0 1 0 1-4ring5.dat

Hits cylinders on both the inside and outside. All OK.

----------------------------------------------------------------------------
parts/s/56891s02.dat:1 16 0 0 -17.5 0 0 5.56 -5.56 0 0 0 -1 0 1-4ring5.dat
parts/s/56891s02.dat:1 16 0 0 -27.5 5.56 0 0 0 0 -5.56 0 1 0 1-4ring5.dat

First usage hits 1-4cyli.dat on the inside and Overlaps with 1-4ring9.dat on the outside. The 1-4ring9.dat also overlaps with yet another geometry on its outside. The owerlaps should be fixed.

Second usage overlaps with 1-4ring9.dat on the outside and 1-4con7.dat on the inside. All OK for 1-4ring5.dat.

----------------------------------------------------------------------------
parts/s/4750s1.dat:1 16 94 16 10 2 0 0 0 1 0 0 0 2 1-4RING5.DAT
parts/s/4750s1.dat:1 16 94 16 42.5 0 0 0.5 0 1 0 -0.5 0 0 1-4RING5.DAT

Both usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/s/u9181s01.dat:1 16 -30 -50 36 0 1 0 0.707107 0 -0.707107 -0.707107 0 -0.707107 1-4ring5.dat
parts/s/u9181s01.dat:1 16 -30 -50 36 0 1 0 -0.965926 0 -0.258819 -0.258819 0 0.965926 1-4ring5.dat
parts/s/u9181s01.dat:1 16 -30 -50 36 0 1 0 0.258819 0 0.965926 0.965926 0 -0.258819 1-4ring5.dat

All three are symmetrically used. They hit standard primitives on the inside and overlap with standard primitives on the outside. The overlaps should be fixed. Otherwise OK.

----------------------------------------------------------------------------
parts/s/30109s01.dat:1 16 0 -34.5 21 0.5 0 0 0 0 0.5 0 1 0 1-4ring5.dat

Hits standard primitives only. All OK.

----------------------------------------------------------------------------
parts/s/43446s01.dat:1 16 -130 0 -30 -2 0 0 0 0 -2 0 1 0 1-4ring5.dat

Hits standard primitives only. All OK.

----------------------------------------------------------------------------
parts/s/18912s01.dat:1 16 -110 16 110 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat

Hits standard primitives only. All OK.

----------------------------------------------------------------------------
parts/s/32498s01.dat:1 16 0 20 1.5 2 0 0 0 0 2 0 -1 0 1-4ring5.dat
parts/s/32498s01.dat:1 16 20 0 1.5 0 0 2 2 0 0 0 -1 0 1-4ring5.dat

First usage hits standard primitives only.
Second usage also hits standard primitives. However, on the outside, it hits and overlaps several standard geometries at the misaligned point. There are no gaps due to the overlaps, but the overlaps should really be removed.

----------------------------------------------------------------------------
parts/s/31000s01.dat:1 16 46 82 46 2 0 0 0 -1 0 0 0 2 1-4ring5.dat
parts/s/31000s01.dat:1 16 -46 82 -46 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat
parts/s/31000s01.dat:1 16 46 82 -46 0 0 2 0 -1 0 -2 0 0 1-4ring5.dat
parts/s/31000s01.dat:1 16 -46 82 46 0 0 -2 0 -1 0 2 0 0 1-4ring5.dat

Same as the other Primo bricks. OK.

----------------------------------------------------------------------------
parts/s/2431pt2c.dat:1 16 303 0 -3 6.4 0 0 0 1 0 0 0 8 1-4ring5.dat

Hits standard primitive on outside and nothing on the inside, so all OK, but there are unnecessary overlaps in the file, which should be fixed.

----------------------------------------------------------------------------
parts/s/581s03.dat:1 16 0 8 0 -1 0 0 0 -2 0 0 0 1 1-4ring5.dat
parts/s/581s03.dat:1 16 0 8 0 0 0 1 0 -2 0 1 0 0 1-4ring5.dat
parts/s/581s03.dat:1 16 0 8 0 1 0 0 0 -2 0 0 0 -1 1-4ring5.dat
parts/s/581s03.dat:1 16 0 8 0 0 0 -1 0 -2 0 -1 0 0 1-4ring5.dat

The four usages are in a ring where a 4-4ring5.dat should have been used instead. Otherwise OK.

----------------------------------------------------------------------------
parts/s/30562s01.dat:1 16 0 4 0 12 0 0 0 -1 0 0 0 -12 48\1-4ring5.dat
parts/s/30562s01.dat:1 16 0 136 0 12 0 0 0 1 0 0 0 -12 48\1-4ring5.dat

First usage hits only high-res primitived, so all OK.
Second usage hits high-res primitive on the outside and quads and conditional lines on the inside.
There were originally 8 point misalignments in the file due to 48/1-4ring5.dat. However. After the issue by Travis was pointed out, these were found to be false positives. The file remains unchanged.

----------------------------------------------------------------------------
parts/s/2587s01.dat:1 16 15.379 8 0 0 0 0.9742 0 -0.2 -1.4 -2 0 0 1-4ring5.dat
parts/s/2587s01.dat:1 16 15.379 8 0 0 0 0.9742 0 -0.2 -1.4 2 0 0 1-4ring5.dat
parts/s/2587s01.dat:1 16 -15.379 8 0 0 0 -0.9742 0 -0.2 -1.4 -2 0 0 1-4ring5.dat
parts/s/2587s01.dat:1 16 -15.379 8 0 0 0 -0.9742 0 -0.2 -1.4 2 0 0 1-4ring5.dat

Used as sleeve ends as pairs, where 2-4ring5.dat should have been used instead.
Hits triangles, quads and lines on both the inside and outside. There are 64 point misalignments due to this, but they all seem to be caused by differing decimal precisions.

The following points have been corrected:
-15.38 8 -10 -> -15.379 8 -10 (4 instances. Going from 2 to 3 decimals)
-15.38 8 -12 -> -15.379 8 -12 (2 instances. Going from 2 to 3 decimals)

The other points are not changed, as they are misaligned on the fourth decimal, where only 3 significant digits are generally used in the file.

----------------------------------------------------------------------------
parts/s/98613s01.dat:1 16 0 0 -30.6 0 0 1 -1 0 0 0 1 0 1-4ring5.dat

Hits standard primitives only. All OK.

----------------------------------------------------------------------------
parts/s/6292s02.dat:1 16 0 0 -28 6.4 0 0 0 0 6.4 0 -1 0 1-4ring5.dat

Hits standard primitives only. All OK.

----------------------------------------------------------------------------
parts/s/93216s01.dat:1 16 0 -40 3 0 0 2.37 -3 0 0 0 -1 0 1-4ring5.dat
parts/s/93216s01.dat:1 16 0 -40 -3 2.37 0 0 0 0 -3 0 1 0 1-4ring5.dat

Hits standard primitives on the inside, and quads on the outside.
However. No point misalignments caused by 1-4ring5.dat. All OK.

----------------------------------------------------------------------------
parts/s/43447s02.dat:1 16 130 -13.143 -40 -1 0 0 0.5142 1 0 0 0 1 1-4ring5.dat
parts/s/43447s02.dat:1 16 130 0 -40 1 0 0 0 -1 0 0 0 -1 1-4ring5.dat

Both usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/31012.dat:1 16 166 34 166 2 0 0 0 -1 0 0 0 2 1-4ring5.dat
parts/31012.dat:1 16 -166 34 -166 -2 0 0 0 -1 0 0 0 -2 1-4ring5.dat
parts/31012.dat:1 16 166 34 -166 0 0 2 0 -1 0 -2 0 0 1-4ring5.dat
parts/31012.dat:1 16 -166 34 166 0 0 -2 0 -1 0 2 0 0 1-4ring5.dat

Same as the other Primo bricks. OK.

----------------------------------------------------------------------------
parts/55966.dat:1 16 -16 14 -39 0 0 -2 -2 0 0 0 78 0 1-4ring5.dat
parts/55966.dat:1 16 16 14 -39 2 0 0 0 0 -2 0 78 0 1-4ring5.dat
parts/55966.dat:1 16 16 14 39 0 0 2 -2 0 0 0 -78 0 1-4ring5.dat
parts/55966.dat:1 16 -16 14 39 -2 0 0 0 0 -2 0 -78 0 1-4ring5.dat

All usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/4112957a.dat:1 8 -82.5 -0.25 -5 -1 0 0 0 1 0 0 0 1 1-4ring5.dat
parts/4112957a.dat:1 8 102.5 -0.25 -5 1 0 0 0 1 0 0 0 1 1-4ring5.dat

Both usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/4088ap01.dat:1 0 -13 8 -10 -1 0 0 0 0 -1 0 1 0 1-4ring5.dat
parts/4088ap01.dat:1 0 13 8 -10 1 0 0 0 0 -1 0 1 0 1-4ring5.dat

Both usages hit standard primitives on the outside and triangles on the inside. There are 12 point misalignments due to differences in significant digits.

The following points are corrected:
-17.619 6.086 -10  ->  -17.620 6.087 -10 (2 instances. Fixed rounding on 3rd digit)
-16.535 4.465 -10  ->  -16.536 4.465 -10 (2 instances. Fixed rounding on 3rd digit)
17.619 6.086 -10  ->  17.620 6.087 -10 (2 instances. Fixed rounding on 3rd digit)
16.535 4.465 -10  ->  16.536 4.465 -10 (2 instances. Fixed rounding on 3rd digit)

(List of updated points changes after Travis' input)

----------------------------------------------------------------------------
parts/41895.dat:1 16 0 0 4 -1.41421 0 -1.41421 -1.41421 0 1.41421 0 -1 0 1-4ring5.dat
parts/41895.dat:1 16 0 0 4 1.41421 0 1.41421 1.41421 0 -1.41421 0 -1 0 1-4ring5.dat

Both usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/2838.dat:1 16 0 26 -48 1.76777 0 -1.76777 1.76777 0 1.76777 0 1 0 1-4ring5.dat

Hits standard primitives only. All OK.

----------------------------------------------------------------------------
parts/4088ap02.dat:1 0 -13 8 -10 -1 0 0 0 0 -1 0 1 0 1-4ring5.dat
parts/4088ap02.dat:1 0 13 8 -10 1 0 0 0 0 -1 0 1 0 1-4ring5.dat

Same as 4088ap01.dat: There same corrections have been made.

(List of updated points changes after Travis' input)

----------------------------------------------------------------------------
parts/56468.dat:1 16 -55 14 -39 0 0 -2 -2 0 0 0 78 0 1-4ring5.dat
parts/56468.dat:1 16 55 14 -39 2 0 0 0 0 -2 0 78 0 1-4ring5.dat
parts/56468.dat:1 16 16 14 39 0 0 2 -2 0 0 0 -78 0 1-4ring5.dat
parts/56468.dat:1 16 -16 14 39 -2 0 0 0 0 -2 0 -78 0 1-4ring5.dat

All usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/3005pwf.dat:1 9 0 14 -10 1 0 0 0 0 1 0 1 0 1-4ring5.dat
parts/3005pwf.dat:1 9 0 14 -10 -1 0 0 0 0 1 0 1 0 1-4ring5.dat

Notice: Error on buildinginstructions.js display of part title has to be fixed.
The two usages should be replace by a 2-4ring5.dat. They hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/3005pvu.dat:1 9 0 14 -10 1 0 0 0 0 1 0 1 0 1-4ring5.dat
parts/3005pvu.dat:1 9 0 14 -10 -1 0 0 0 0 1 0 1 0 1-4ring5.dat

The two usages should be replace by a 2-4ring5.dat. They only hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/12818.dat:1 16 0 136 0 0 0 8 0 1 0 -8 0 0 1-4ring5.dat

Retracted: The new unofficial version on the parts tracker does not use 1-4ring5.dat

----------------------------------------------------------------------------
parts/30273.dat:1 16 0 8 0 -1.9092 0 1.9092 0 -1 0 -1.9092 0 -1.9092 1-4ring5.dat

Hits standard primitive on outside and overlaps with a 1-4ring9.dat on the inside. The overlap should be fixed. Otherwise OK.

----------------------------------------------------------------------------
parts/518.dat:1 16 0 0 -70 -2 0 0 0 0 2 0 1 0 1-4ring5.dat
parts/518.dat:1 16 0 0 -70 0 0 -2 -2 0 0 0 1 0 1-4ring5.dat
parts/518.dat:1 16 0 0 -70 0 0 2 2 0 0 0 1 0 1-4ring5.dat
parts/518.dat:1 16 0 0 -70 2 0 0 0 0 -2 0 1 0 1-4ring5.dat

The four usages are in a ring where a 4-4ring5.dat should have been used instead. Otherwise OK, as the primitives just hit other standard primitives.

----------------------------------------------------------------------------
parts/54872p01.dat:1 16 13 45 -14.5 0 0 0.5 0.5 0 0 0 0.5 0 1-4ring5.dat
parts/54872p01.dat:1 16 -13 45 -14.5 -0.5 0 0 0 0 0.5 0 0.5 0 1-4ring5.dat

Both usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/973p2d.dat:1 25 0 19.3 -10 0 0 -1.53 -1.53 0 0 0 1.53 0 1-4ring5.dat

Hits standard primitive on the outside, but quads on the inside. However. None of the 4 point misalignments are due to 1-4ring5.dat, so all OK.

----------------------------------------------------------------------------
parts/30175.dat:1 16 0 6 0 0 0 2.7 0 -1 0 -2.7 0 0 1-4ring5.dat
parts/30175.dat:1 16 0 6 0 0 0 -2.7 0 -1 0 -2.7 0 0 1-4ring5.dat

Quads are hit. There were 4 point misalignments due to this. These were no longer an issue after the update pointed out by Travis, and the file has been reverted.

----------------------------------------------------------------------------
parts/4159998b.dat:1 80 -33 -0.25 -22.5 1 0 0 0 1 0 0 0 1 1-4ring5.dat
parts/4159998b.dat:1 80 -33 -0.25 22.5 1 0 0 0 1 0 0 0 -1 1-4ring5.dat
parts/4159998b.dat:1 80 33 -0.25 -22.5 -1 0 0 0 1 0 0 0 1 1-4ring5.dat
parts/4159998b.dat:1 80 33 -0.25 22.5 -1 0 0 0 1 0 0 0 -1 1-4ring5.dat

All usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/32012.dat:1 16 1.5 0 0 0 -1 0 -1.41421 0 -1.41421 -1.41421 0 1.41421 1-4ring5.dat
parts/32012.dat:1 16 -1.5 0 0 0 1 0 -1.41421 0 -1.41421 -1.41421 0 1.41421 1-4ring5.dat

Both usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/947b.dat:1 16 20 6 -19 0 -1 0 -1 0 0 0 0 -1 1-4ring5.dat
parts/947b.dat:1 16 -20 6 -19 0 1 0 0 0 -1 -1 0 0 1-4ring5.dat

Both usages hit standard primitive on the outside, and overlap with one on the inside. All OK, but the overlaps should be avoided.

----------------------------------------------------------------------------
parts/778.dat:1 16 7 -52 -156 0 1 0 -4 0 0 0 0 4 1-4ring5.dat
parts/778.dat:1 16 7 -52 -184 0 1 0 -4 0 0 0 0 -4 1-4ring5.dat
parts/778.dat:1 16 -7 -52 -156 0 -1 0 -4 0 0 0 0 4 1-4ring5.dat
parts/778.dat:1 16 -7 -52 -184 0 -1 0 -4 0 0 0 0 -4 1-4ring5.dat

All usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/6184.dat:1 16 20 96 10 0 0 16 -16 0 0 0 -1 0 48\1-4ring5.dat
parts/6184.dat:1 16 -20 96 10 -16 0 0 0 0 -16 0 -1 0 48\1-4ring5.dat
parts/6184.dat:1 16 -20 96 -10 0 0 -16 -16 0 0 0 1 0 48\1-4ring5.dat
parts/6184.dat:1 16 20 96 -10 16 0 0 0 0 -16 0 1 0 48\1-4ring5.dat

All usages hit primitive on the inside, and overlap with standard primitives on the outside. All OK, but the overlaps should be avoided.

----------------------------------------------------------------------------
parts/11949.dat:1 16 0 0 -30 1.9799 0 1.9799 -1.9799 0 1.9799 0 1 0 1-4ring5.dat
parts/11949.dat:1 16 0 0 -30 -1.9799 0 -1.9799 -1.9799 0 1.9799 0 1 0 1-4ring5.dat

Both usages hit standard primitives only. All OK.

----------------------------------------------------------------------------
parts/48168.dat:1 16 0 -26 0 5.65685 0 -5.65685 0 -1 0 5.65685 0 5.65685 48\1-4ring5.dat
parts/48168.dat:1 16 0 -26 0 -5.65685 0 5.65685 0 -1 0 -5.65685 0 -5.65685 48\1-4ring5.dat

Both usages hit standard primitives only. All OK.


Attached Files
.dat   1-4ring5.dat (Size: 805 bytes / Downloads: 1)
Reply
RE: Fix of 1-4ring5.dat
#3
The attached file contains at least one set of incorrect rounding.

0.9239 * 6 = 5.5434. Both the current version of the primitive and your proposed fix use 5.5433. I have not checked every single point in the new file to see if it is correct, but the presence of one error means that every single point in the file needs to be re-checked. I don't know how you generated the new file, but if you plan to do this with other primitives, whatever is being done needs to be fixed.
Reply
RE: Fix of 1-4ring5.dat
#4
Oh no. It is worse. 2.2961 etc. also have to be updated.
I will update the post and go through the files again.

Thanks for noticing. I had clearly stared myself blind on the other point.
Reply
RE: Fix of 1-4ring5.dat
#5
(2021-10-15, 18:20)Travis Cobbs Wrote: The attached file contains at least one set of incorrect rounding.

0.9239 * 6 = 5.5434. Both the current version of the primitive and your proposed fix use 5.5433. I have not checked every single point in the new file to see if it is correct, but the presence of one error means that every single point in the file needs to be re-checked. I don't know how you generated the new file, but if you plan to do this with other primitives, whatever is being done needs to be fixed.

Thanks. The file and related files have been updated accordingly. It took much less time this time around, since I knew where to look. Another positive change: Not as many of the related files have to be updated, compared to what I initially though.

I will continue onto 1-4ring7.dat.
Reply
RE: Fixing rounding errors in primitives
#6
I fixed cylj4x8.dat to four decimals and removed the t-junctions. It's sent to Chris for loading it to the PT again.

All parts (official and unofficial) using this subpart have a cyli or stud3 attached to this primitive, so no further action is required.

/Max
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)