![]() |
Unit Conversion Ratios - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html) +--- Thread: Unit Conversion Ratios (/thread-29111.html) |
Unit Conversion Ratios - Hageta - 2025-10-11 I am currently working on this issue that involves unit conversion to LDraw (currently all units are first converted to mm and then to ldu). And I came up with the following conversion ratios: [Micron/Micrometer(μm): 400μm * 0.0025ldu/μm = 1ldu] Millimeter(mm): 0.4m * 2.5ldu/mm = 1ldu Centimeter(dm): 0.04m * 25ldu/cm = 1ldu [Decimeter(dm): 0.004m * 250ldu/dm = 1ldu] Meter(m): 0.0004m * 2500ldu/m = 1ldu Inch(in, ″): 1/64in * 64ldu/in = 1ldu Foot(ft, ′): 0.001312336ft * 762ldu/ft ~ 1ldu Please take a look if I got everthing right. * everthing in [] is just here for completness, allthough micron is actually a valid unit in 3mf files. RE: Unit Conversion Ratios - Hageta - 2025-10-11 I am not quite sure if the feet conversion is correct. RE: Unit Conversion Ratios - Peter Blomberg - 2025-10-11 (2025-10-11, 18:10)Hageta Wrote: ...(currently all units are first convert to mm and then to ldu). This is the preferred programmatic practice. Easier to detect errors and to troubleshoot. Your equations contained a few typos. The conversion factors seem to be mostly ok. The LDU is defined as 2.5 LDU/mm. 1 mm = 2.5 LDU 1 cm = 10 mm = 25 LDU 1 dm = 100 mm = 250 LDU 1 m = 1000 mm = 2500 LDU 100 µm = 0.1 mm = 0.25 LDU 10 µm = 0.01 mm = 0.025 LDU 1 µm = 0.001 mm = 0.0025 LDU One international inch is defined as 25.4 mm. 1 in = 25.4 mm = 63.5 LDU Assuming one foot is twelve inches: 1 ft = 12 in = 304.8 mm = 762 LDU RE: Unit Conversion Ratios - Hageta - 2025-10-12 (2025-10-11, 23:25)Peter Blomberg Wrote: This is the preferred programmatic practice. Easier to detect errors and to troubleshoot. The current documentation says 1 LDU is approximated with 1/64 in. I guess using 63.5 as a conversion factor is more accurate. An explanation of this difference should probably be in the documentation overhaul if it is not already there. |