pennyforge Posted December 5, 2019 Posted December 5, 2019 Hi there, I've put my latest python code which can convert letters, text and font data into Lego builds on github - you can find it here...https://github.com/pennyforge/Leg-o-letters Enjoy Oh..Merry Christmas! Quote
kokkie20 Posted December 8, 2019 Posted December 8, 2019 Awesome tool! Only a shame a lot of colors are not available at certain bricks but the tool still uses them. As example on 1x2 bricks in red-trans doesn't exist. Any way to make a fix for this? I am importing the LDR into stud.io and it gives that error :( Quote
Philo Posted December 9, 2019 Posted December 9, 2019 On 12/8/2019 at 7:35 PM, kokkie20 said: As example on 1x2 bricks in red-trans doesn't exist. ??? https://www.bricklink.com/v2/catalog/catalogitem.page?P=3065#T=S&C=17&O={"color":17,"iconly":0} (Granted, that's the version without bottom tube). Quote
SylvainLS Posted December 9, 2019 Posted December 9, 2019 36 minutes ago, Philo said: (Granted, that's the version without bottom tube) I believe that was the point Nevertheless, I’m sure there are other examples. Quote
pennyforge Posted December 9, 2019 Author Posted December 9, 2019 Yes, you are right - and there will be others - I choose colours that look nice digitally but they may not exist physically (but there should be something similar(ish)!) Limiting the colours and bricks and to exact physical brick and colour combinations is on my to-do list! Quote
pennyforge Posted December 9, 2019 Author Posted December 9, 2019 (edited) The colours are defined in the function "selectColourAndHues" , where a dictionary "colourAndHues" in that function sets the variety of hues for each of the named colours and the first number in the list of values for each named colour is always trans (so 36 is trans red, 38 is trans orange etc). Adding "transparency = False" at the very start of the function will exclude all transparent bricks and manipulating the dictionary "colourAndHues" will allow you limit the colour options but even then you would ideally need to cross check any selected colour with the actual brick part which subsequently has that colour applied to it against bricklink's physical parts and colours - this would take me some time to figure out but I am thinking about it! Edited December 10, 2019 by pennyforge Quote
kokkie20 Posted December 12, 2019 Posted December 12, 2019 (edited) On 12/9/2019 at 9:04 PM, Philo said: ??? https://www.bricklink.com/v2/catalog/catalogitem.page?P=3065#T=S&C=17&O={"color":17,"iconly":0} (Granted, that's the version without bottom tube). That i didnt know, i imported the created file into stud.io @pennyforge Thanks, it has no hurry for me, but was wondering if it was possible :) Thanks anyway for the awesome tool! :) Edited December 12, 2019 by kokkie20 Quote
Philo Posted December 31, 2019 Posted December 31, 2019 Any tips for a Python noob to run this on Windows? Requirements? Quote
pennyforge Posted January 1, 2020 Author Posted January 1, 2020 Hi @Philo So you'll need to install a version of python 3 - I'm using 3.7.1 but any version after 3.7 should be OK https://www.python.org/downloads/ then you'll need to install numpy (a python library for dealing with big numbers and matrices) and pillow (a python library for manipulating images). Once you've installed python you can type the following commands into a cmd window to install numpy and pillow. pip install numpy pip install pillow Sometimes though pip does not automatically get added into your path variable (after installing python) so you need to specify the full path to the pip.exe file in the cmd window which is usually C:\[Directory for Python37]\Scripts\pip install numpy C:\[Directory for Python37]\Scripts\pip install pillow Once numpy and pillow have been installed you should be able to run the leg-o-letters.py python file which will ask you if you want to add your own text/font size/colours etc Hope that helps - if not let me know N Quote
Calabar Posted January 5, 2020 Posted January 5, 2020 Hi @pennyforge, very interesting tool. If you edit the first post to create a comprehensive presentation page, including the detailed instruction you wrote in the following posts, I will add it to the Section Index. Quote
pennyforge Posted January 6, 2020 Author Posted January 6, 2020 Thanks @Calabar that's very kind of you - I will try and tidy up the original post this week - I'll let you know when its done. N Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.