Tutorial: joining studs to a non-planar surface - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html) +--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html) +--- Thread: Tutorial: joining studs to a non-planar surface (/thread-3065.html) |
Tutorial: joining studs to a non-planar surface - Philippe Hurbain - 2012-01-15 This decribes method to create the junction between stud primitives and a non-planar surface. It is not perfect (there are some T-junctions created in the process), but it's pretty efficient. It is also the opportunity to see an example of usage of many tools... We start with the partial part, stud4a are in position and we need to join them to dome shaped surface above. Starting file: stb0.dat an Extract stud4a primitives -> stb1.dat Inline (using LDDP) stb1 contents (one level), and remove everything but 4-4edges. Inline the result -> stb2.dat Using MLCad, extract bottom surface from stb0.dat -> stb3.dat Use Slicerpro on stb2.dat as pattern, stb3.dat as former -> stb4.dat Generate the tubes using Ytruder. Stud4a top is at Y=44, so we use Ytruder with projection on plane Y=44 -> stb5.dat Problem is that the orientation of the generated surface depends only on the orientation of lines in stb4.dat. If you look at the file in BFC mode, orientation is not correct. Windz should be able to do clean up, but stb5.dat has no clear interior/exterior, so Windz doesn't perform well on it. We will add the stud4a primitives (from file stb1.dat) to it to make things clear, we also remove the edge lines inserted by Ytruder on the edges of non circular paths -> stb6.dat Windz can now find correct bfc orientation -> stb7.dat We can now reintegrate all these elements (edge lines from stb4.dat, cylinders from stb7.dat) in stb0.dat -> stb8.dat Now we go on with generation of walls between studs. First step, using MLCad we create top of walls as rectangles that enter in cylinder tubes -> stb9.dat Adjust Y value of stb1.dat so that height of stud4a be in the middle of quads in stb9 (we could have used cylinders of stb7, but since there are more cuts the result would not be as clean). Inline multilevel down to quad and lines -> stb10.dat Now cut stb9.dat with the studs (stb10.dat) using Intersector -> stb11.dat stb11.dat Create intersection lines with Isecalc ->stb12.dat Remove the unwanted (yellow) surfaces from stb11.dat, and add edge lines from stb12.dat then restore proper colors -> stb13.dat Generate remaining edge lines with Edger2, options "Create only unmatched edges" and "write only new lines". The result contains only side edge lines, those where we want to grow side surfaces. Change edge color to 24 -> stb14.dat We will now use the same process as the one used for stud cylinders. Use Slicerpro on stb14.dat as pattern, stb3.dat as former -> stb15.dat Generate the side walls using Ytruder. Top is at Y=35, so we use Ytruder with projection on plane Y=35 -> stb16.dat Merge stb13, stb14, stb15 and stb16 -> stb17.dat Run Windz on stb17 to improve BFC. Unfortunately stb17 has no clear inside/outside, so Windz result is not perfect, and you still have to flip a few quads manually. It can be done relatively easily using LDView tree view with highlight to find line number of inverted elements, and change winding in LDDP. -> stb18.dat Add it to stb8 ->stb19.dat Re: Tutorial: joining studs to a non-planar surface - Jean-Philippe Ouellet - 2012-01-15 Wow. Very impressive tutorial. One question though, it appears that the final product does not use any primitives that were in the stud because you fully inlined it, is this the case? Does this mean that when trying to render the shape with POVRay using a primitive substitution library, that the studs would be polygonal instead of circular? As in instead of Re: Tutorial: joining studs to a non-planar surface - Philippe Hurbain - 2012-01-15 Yes, bottom of cylinder will remain polygonal (the stud itself will be substituted, so the most visible part will be smoothed.) Unfortunately there is no really good solution to that problem. One possibility is to pack cylinder/cyls/cyls2 to form the tube, but since match with the surface can't be perfect, these cylinders must poke inside shape. Not so nice for transparent parts... And it is especially tedious to do for the part author (I know, I've done several parts this way...) Re: Tutorial: joining studs to a non-planar surface - Tim Gould - 2012-01-15 Great work on this crazy part, Philo. And thanks for showing how you did it. I made the under studs in 95188 in a similar way but your use of ytruder was much cleverer than what I did (used intersector and hand editing). If I'd seen this first I could have saved some time and I might get a chance to use it if I add more underdetails. To make things work in POVray you could extend the quad section only down to 8LDU (or whatever) above the ground plane and use primitives to make the final 8LDU. You'll end up with a weird intersection in POVray but I think the result would look better in POVray than just having polygons since the join will usually be in shadow. eg. http://www.ldraw.org/cgi-bin/ptdetail.cgi?s=95188 Tim Re: Tutorial: joining studs to a non-planar surface - Philippe Hurbain - 2012-01-16 Yes, maybe in the final part I'll probably scale up the stud4a... This was written more to document an idea I had than to show the real part design. Re: Tutorial: joining studs to a non-planar surface - Tim Gould - 2012-01-16 I figured. But since the question was asked I felt it should be answered Tim Re: Tutorial: joining studs to a non-planar surface - Travis Cobbs - 2012-01-16 It's worth noting that if you use LDView to do the export to POV, and have curve smoothing turned on for the POV export, then the result will look a lot better. It will still be polygonal, but the sides of the cylindrical section will be smooth shaded at least. Like so (please view the original, since the JPEG quality setting on the preview is really low): |