How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers)
2012-12-17, 3:59 (This post was last modified: 2015-03-04, 8:53 by Paul Griffin.)
2012-12-17, 3:59 (This post was last modified: 2015-03-04, 8:53 by Paul Griffin.)
I hope this is in the "right" section; if not, mods, give the noob a thousand e-lashes.
I'm working on a 3D app right now, and have had way too much "fun" in working with the Ldraw file format. I would not call my work anywhere close to compliant with the Ldraw spec, but suffice to say, I've made some progress...and along the way, rediscovered linear algebra, projections, angles, and more.
Here's a pic of what I've got working so far.
Now, for my questions:
-How do you approach non-certified BFC files? Do you check for bowtied parts? Do you treat it as uncertified even if it only contains subparts/primitives? Unfortunately, due to resource limitations, I cannot simply duplicate every noncertified polygon I come across, so I've had to learn to process said polygons as if they are two-sided (which has NOT been fun). I cannot recall, but somewhere between 2997/2998 and 6581/6582, I encountered flipped polygons, bowtied polygons, and more...enough that I have a headache from all that checking.
-Do you have any recommendations on how to perfect normal smoothing? If I find two triangles meet at an angle 180 += 30, I consider them to be part of a curve and I smooth them proportionally to the triangle corner angles. I seem to get a little too much smoothing out of that, but I need to be able to catch at least 180+=22.5 to smooth the stubs (plus using the 48 versions isn't an option).
-How accurate are the ldraw parts? This may be a very bold statement to make, but I do plan to perform intelligent part snapping based solely on the polygons I extract from a ldr file.
-Legally: Can "The Lego Group" prevent me from selling an app I make (provided that I do not use their trademark)? If I want to use the ldraw parts library, what's the recommended way to share it? It seems that, aside from parts/756.dat parts/s/2336s35.dat, I could distribute the zip myself. (Edit: nevermind per #2. I see there's a link for CCAL-compliant parts).
-is there anything you wish you had known when you started working on your program?
Thanks in advance
I'm working on a 3D app right now, and have had way too much "fun" in working with the Ldraw file format. I would not call my work anywhere close to compliant with the Ldraw spec, but suffice to say, I've made some progress...and along the way, rediscovered linear algebra, projections, angles, and more.
Here's a pic of what I've got working so far.
Now, for my questions:
-How do you approach non-certified BFC files? Do you check for bowtied parts? Do you treat it as uncertified even if it only contains subparts/primitives? Unfortunately, due to resource limitations, I cannot simply duplicate every noncertified polygon I come across, so I've had to learn to process said polygons as if they are two-sided (which has NOT been fun). I cannot recall, but somewhere between 2997/2998 and 6581/6582, I encountered flipped polygons, bowtied polygons, and more...enough that I have a headache from all that checking.
-Do you have any recommendations on how to perfect normal smoothing? If I find two triangles meet at an angle 180 += 30, I consider them to be part of a curve and I smooth them proportionally to the triangle corner angles. I seem to get a little too much smoothing out of that, but I need to be able to catch at least 180+=22.5 to smooth the stubs (plus using the 48 versions isn't an option).
-How accurate are the ldraw parts? This may be a very bold statement to make, but I do plan to perform intelligent part snapping based solely on the polygons I extract from a ldr file.
-Legally: Can "The Lego Group" prevent me from selling an app I make (provided that I do not use their trademark)? If I want to use the ldraw parts library, what's the recommended way to share it? It seems that, aside from parts/756.dat parts/s/2336s35.dat, I could distribute the zip myself. (Edit: nevermind per #2. I see there's a link for CCAL-compliant parts).
-is there anything you wish you had known when you started working on your program?
Thanks in advance