Lasse D

Eurobricks Fellows
  • Content Count

  • Joined

  • Last visited


About Lasse D

  • Rank
    Sallad thief!
  • Birthday 09/24/1984

Spam Prevention

  • What is favorite LEGO theme? (we need this info to prevent spam)
    <p> Jack Stone and 5580 </p>

Contact Methods

  • Website URL
  • Yahoo

Profile Information

  • Gender
  • Location
  • Interests
    Building LEGO creations and programming.


  • Country
  • Special Tags 1
  • Special Tags 3
  • Country flag

Recent Profile Visitors

3735 profile views
  1. OK. Then the tool in this thread is unrelated to what you are looking for. What happened when you tried to convert your SVG file to LDraw using SVG 2 LDraw?
  2. Hi @supertruper1988. If you want to create a sticker that is placed after the parts that it sticks to, then you should not use parts with textures, as that will leave big gaps in your parts until the stickers are placed. Instead, I recommend making the sticker as a part based on box5.dat, and a quad with the texture on the quad. This will give you stickers similarly to what you see in this model. I have not tried it yet, but I think Part Creator can make parts like this. If not, then there are LDraw tools that are up for the task. And if not, then we will have to create some.
  3. OK. This took a lot longer than expected, but using some google foo for vector algebra and solving equations for placing planes that tangent spheres, the projections are finally computed correctly: You can try for yourself on This tool now also extracts the image with the texture, so that you can store it in the textures folder. Alternatively, it can inline the texture as well. Next steps will be to improve performance of the converter, see if cylindrical projection can be used on the head, and make the reverse converter than @Philo mentioned.
  4. Lasse D

    Car Talk

    2019 turned out to be an expensive year. Hopefully 2020 will be accident-free!
  5. I have set up transformations for U/V values from Studio 2.0 files. It works well on all parts with flat textures (bricks, plates, tiles, etc.). However. On discs and minifigs it fails spectacularly: I have set up a converter here if you want to try it out yourself: It is hosted on brickhub in order to use the LDraw library lying there, so that you get a preview before exporting.
  6. Do'h. I can't believe I missed this. The triangles lines have the UV's provided as suffixes! Take one of the lines from my first post: 3 16 -80.000 -24.000 -10.000 -80.000 0.000 -10.000 80.000 0.000 -10.000 0.045 0.955 0.045 0.045 0.955 0.045 It is encoded as follows: 3 color x1 y1 z1 x2 y2 z2 x3 y3 z3 u1 v1 u2 v2 u3 v3 where the LDraw specification ends at z3. With this I can try out some heuristics for mapping correctly to minifigs - it is the arms in particular which have currently been giving me some issues. @Philo It just didn't look right when I made the projections. I will try to compare it to the inlined UV coordinates and see how far off I am with these.
  7. The LDraw file format specifies neither normals, UV's (apart from for texture mapping) nor actual meshes, so you will find a lot of functionality missing if you are used to work with Blender and similar tools. Most of my work has been in constructing this efficiently so that you can get short loading times when viewing from the browser. Unfortunately I have stumbled into a rather significant issue regarding mapping for the minifig head. The three types of LDraw projections do not cover the type of projection that Studio 2.0 applies!
  8. The end goal is to be able to convert between LDraw files as exported by Part Designer and official LDraw files. There are a lot of members in my LUG who make trains using Studio 2.0 and they are perplexed by their models not working in LDView, and other LDraw-compatible software. These are typically people who do not want to deal with vector graphics, but still want logos on their models. As for svg2ldraw, I have added non-rectangular bounding boxes by computing Convex hulls using Floyd-Steinberg's algorithm. You can try it out with SVG files, such as: <svg width="40" height="40" viewBox="0 0 400 400" xmlns=""> <circle cx="200" cy="200" r="200" fill="red"/> <circle cx="100" cy="200" r="50" fill="blue"/> </svg> and the tool is hosted here. They do proper UV mapping in the LDraw spec and support 3 types of mapping (planar, cylindrical and spherical) which seems to satisfy the existing need for textures on LEGO models.
  9. Studio 2.0 (or rather, "Part Designer") is able to export to LDraw. Unfortunately Bricklink has chosen to roll out their own standard for texture mapping, rather than following the official spec. I do not care for the reason for Bricklink to go this way. It personally took me almost a month to implement it, so I fully understand if they wanted to choose something less complex. Instead I would like to dedicate this thread to converting between the two formats. In order to do this, we have to understand the format that Studio exports to. If you want to jump directly to a live demo, then please click "3D" on the page I have set up here. When creating a new part in Part Designer, you can choose either "Minifig", "Decorated Part" or "Create Part From Scratch". I will start with "Decorated Parts" and take the two other options later. Using the checker.png by Nils from the LDraw forum and some basic gradient picture, I have created test files for most of the decorated parts currently available from Part Designer: The Studio "LDraw" File Format - Findings Exporting to LDraw from the Part Designer will result in .dat files containing something along the lines of: 0 FILE studio_test_1_8_checker.dat 0 Brick 1 x 8 checker 0 Name: studio_test_1_8_checker.dat 0 Author: 0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt 0 BFC CERTIFY CCW 0 PE_TEX_PATH -1 0 PE_TEX_INFO iVBORw0KGgoAAAAN(...)uQmCC 1 16 0.0000 -24.0000 0.0000 1.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 1.0000 s/3008s01.dat 3 16 -80.000 -24.000 -10.000 -80.000 0.000 -10.000 80.000 0.000 -10.000 0.045 0.955 0.045 0.045 0.955 0.045 3 16 -80.000 -24.000 -10.000 80.000 0.000 -10.000 80.000 -24.000 -10.000 0.045 0.955 0.955 0.045 0.955 0.955 Please note that I have inserted the "!LICENSE" line in order to ensure that the files may be shared and used. The commands "PE_TEX_PATH" and "PE_TEX_INFO" are proprietary from Studio. I have not yet found a "PE_TEX_PATH" command that does not say "-1", so let's ignore it for now. The other command has a base64 encoded picture as the argument. The geometry lines have one sub part (in this case "s/3008s01.dat") and 2 or more triangle lines. I have yet to see any file being generated with quads, lines or any other content after the encoded picture. The Encoded Picture The base64-encoded picture is not simply the picture you upload to Part Designer. It will be processed. I have found that the encoded picture is scaled up and has been given a transparent border. I do not know why the border is added - perhaps someone can give me some insight here. Computing Projections In the LDraw specification you have to specify how to project a texture onto underlying geometry. Unfortunately the exported LDraw files from Studio do not contain any other information than what I have stated above. You thus have to take each part one-by-one and compute your own LDraw TEXMAP projections. I have found the following heuristic works for most of the supported parts (see exceptions in the section below): 1) Take the minimal axis-aligned 3D bounding box of all the points of the triangles. Call this box B. Let Bx, By, and Bz be its length along the X, Y and Z-axes, respectively. 2) Expand B by 10% in each direction to account for the border introduced to the picture. 3) If 2*By < Bx and 2*By < Bz, then assume the projection should be performed on an XZ plane. Otherwise, project onto an XY plane. 4) No matter the projection, choose the points for the planar projection defined in the LDraw specification to be corners from B. Exceptions: 2x4 Brick and 2x2x2 Slope For the parts "Brick 2 x 4" and "Slope 2 x 2 x 2" you can choose two pictures for decorating the front and back of the part. For the 2x4 brick, the two pictures get merged into a single picture - the front picture on top and the back picture below. There will be 4 triangles in the LDraw file - the two first for the front side, and the other for the back side. For the 2x2x2 slope, the two pictures also get merged into a single picture, however, this time they are side-by-side: Front picture on the left and rear picture on the right. For both exceptions, I have had to introduce "magical numbers" in order to get a proper alignment of projections. Please see the source code here for how to compute projections in JavaScript for the buildinginstructions.js project. Non-Standard Alignment of Sub-Part and Geometries Please take a look at the line for the sub part: 1 16 0.0000 -24.0000 0.0000 1.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 1.0000 s/3008s01.dat The positioning is off: Normally you would place the sub part at (0, 0, 0), but here it is at (0, 24, 0). This position has to be translated so that the sub part is at (0, 0, 0) in order for the custom part to appear correctly. You have to subtract the position of the sub part from all the positions of the triangles as well. By following the observations above, I have been able to create the converter from Studio LDraw to standard LDraw as seen in the source code here for. This is what powers the 3D viewer here. As you can see, there are still some precision issues - most noticeably on the 1 x 8 tile where the "10% rule" doesn't seem to work perfectly. Another issue is that I cull textured surfaces on transparent parts, while Studio does not. Please tell me if you have other observations. My plan for now is to continue with Minifigs.
  10. Ray tracing is as far as I know not efficient enough to de done real-time. I am looking into shaders that can show transparent elements realistically. Right now I have not found anything from Blender that can help with this - the nearest I can come is volumetric rendering, but that requires pre-computation of textures for volumes, which is not something I have by hand. Once (if ever) I have found a good solution, I can publish the results, but right now I am hitting a wall with this.
  11. We are some who are working on real time renders that are open source, but it will take a massive amount of effort to make something that looks as good as those ray tracing algorithms from Blender et. al. that studio uses.
  12. I would like to join. As this is the week of Le Mans, I am not sure about staying there Wednesday, but the days before then should be alright.
  13. Lasse D

    Creator Expert 10270 Modular

    While I'm a bit disturbed by the severed head in the terrarium, it seems quite nicely balanced with colors. The part selection, however, does not bring out the same awe as the Diner and many other modulars before it.
  14. Yeah 5571 Black Cat´╗┐ is much larger than 1:25. However. I believe others on Rebrickable have made trailers for it with instructions.
  15. Lasse D

    COPPA and Technic Youtube creators

    As I see it, I have to place all of my videos as private and ask users to use some kind of overlay platform if they want to add comments (I saw GAB made such a platform some time ago, but apparently it is being used mainly for political extremism. I hope to find a more children-friendly platform) It is a shame that they wanted to profit on illegally mining information from minors. And again they seem to do everything in their power to take the "you" out of "youtube".