I built a website to generate LDraw code using AI!


I built a website to generate LDraw code using AI!
#1
Hey All,

Over the last two weeks I have been working on a website to generate LDraw code and render it on the web using AI. I wanted to thank this community for all the resources and documentation that I needed to get it working!

The website it called https://brickgenerator.com/

It is still a total work in progress and gives less than ideal results, but sometimes is pretty clever!

How to use:
1. Enter text of what you want to generate
2. Wait a really long time lol (Working to make it faster but takes around a minute)
3. See Ldraw code and a rendered model (Unless you get an error.... oh the errors Sick )
4. Share your designs with others! Examples: Poop emoji & Donald Trump?! 

Please let me know your feedback and share your designs so I can see the issues or the cool things you can generate!

Also, if you feel so inclined to upvote me on product hunt, it would be greatly appreciated! 



Thanks,

Shane
Reply
RE: I built a website to generate LDraw code using AI!
#2
I've been expecting you.  Smile 

I work with AI in my non-LEGO related work and have been thinking about this.  I figured it would be hard to have enough LDraw models with associated labeling for what they are to get good results. But it seems like you're making progress. Good luck, and I'll be watching this keenly. 

Upvoted on ProductHunt!


Reply
RE: I built a website to generate LDraw code using AI!
#3
At my first attempt I got an error about a comment. This is the second (note the overlap):

0 Name: Asteroid_Field_of_Trees.ldr
0 Author: AI Assistant

0 First Layer: Ground level base plates representing the uneven asteroid surface
0 STEP
1 71 20 0 0 1 0 0 0 1 0 0 0 1 3022.dat
1 71 -20 0 0 1 0 0 0 1 0 0 0 1 3022.dat
1 71 60 0 0 1 0 0 0 1 0 0 0 1 3022.dat
1 71 -60 0 0 1 0 0 0 1 0 0 0 1 3022.dat

0 Second Layer: Additional uneven plates to add depth
0 Height y = -8 due to the plate height = 8 LDU
0 STEP
1 70 30 -8 0 1 0 0 0 1 0 0 0 1 3020.dat
1 70 -30 -8 0 1 0 0 0 1 0 0 0 1 3020.dat
1 70 50 -8 0 1 0 0 0 1 0 0 0 1 3020.dat
1 70 -50 -8 0 1 0 0 0 1 0 0 0 1 3020.dat

0 Small Tree Trunks
0 Height y = -16 due to the height of the last plates = 8 LDU (stacked)
0 STEP
1 12 10 -16 10 1 0 0 0 1 0 0 0 1 3005.dat
1 12 -10 -16 10 1 0 0 0 1 0 0 0 1 3005.dat
1 12 40 -16 10 1 0 0 0 1 0 0 0 1 3005.dat
1 12 -40 -16 10 1 0 0 0 1 0 0 0 1 3005.dat

0 Tree Canopies
0 Height y = -40 due to the height of the trunks = 24 LDU and y set at -16
0 STEP
1 2 -10 -40 10 1 0 0 0 1 0 0 0 1 3037.dat
1 2 10 -40 10 1 0 0 0 1 0 0 0 1 3037.dat
1 2 40 -40 10 1 0 0 0 1 0 0 0 1 3037.dat
1 2 -40 -40 10 1 0 0 0 1 0 0 0 1 3037.dat

0 Comment about the symbolic approach
0 In this LDraw file, trees are represented by basic brick trunks and slope canopies.
0 The uneven placement of ground plates represents the irregular asteroid surface.
0 The sparse distribution of trees across blocks symbolizes life within the asteroid field.
LEGO ergo sum
Reply
RE: I built a website to generate LDraw code using AI!
#4
Generated Code

LDraw Code is used to create lego models. The output by our AI is shown below.

0 Name: Trees_on_Asteroid.ldr
0 Author: AI Assistant

0 First Layer: Base of the asteroid with grey plates
0 STEP
1 71 0 0 0 1 0 0 0 1 0 0 0 1 3020.dat
1 71 20 0 0 1 0 0 0 1 0 0 0 1 3020.dat
1 71 40 0 0 1 0 0 0 1 0 0 0 1 3020.dat
1 71 60 0 0 1 0 0 0 1 0 0 0 1 3020.dat
1 71 80 0 0 1 0 0 0 1 0 0 0 1 3020.dat

0 Building up the asteroid with slopes and bricks
0 Height y = -24 due to the grey plate's height (8 LDU * 3 plates = 24 LDU)
0 STEP
1 71 0 -24 0 1 0 0 0 1 0 0 0 1 3298.dat
1 71 20 -24 0 1 0 0 0 1 0 0 0 1 3298.dat
1 71 60 -24 0 1 0 0 0 1 0 0 0 1 3298.dat
1 71 80 -24 0 1 0 0 0 1 0 0 0 1 3298.dat
1 71 40 -24 0 -1 0 0 0 1 0 0 0 -1 3003.dat

0 Tree trunks created with brown bricks
0 Height y = -48 because slope is 24 LDU in height
0 STEP
1 70 10 -48 10 1 0 0 0 1 0 0 0 1 3001.dat
1 70 50 -48 50 1 0 0 0 1 0 0 0 1 3001.dat

0 Adding the greenery with green plates
0 Height y = -72 due to the last brown brick's height (24 LDU)
0 STEP
1 2 10 -72 10 1 0 0 0 1 0 0 0 1 3022.dat
1 2 50 -72 50 1 0 0 0 1 0 0 0 1 3022.dat
1 2 10 -80 10 1 0 0 0 1 0 0 0 1 3023.dat
1 2 50 -80 50 1 0 0 0 1 0 0 0 1 3023.dat
1 2 -10 -88 10 1 0 0 0 1 0 0 0 1 3022.dat
1 2 30 -88 50 1 0 0 0 1 0 0 0 1 3022.dat

0 Additional details with green slopes for treetops
0 Height y = -96 due to the last green plate's height (16 LDU)
0 STEP
1 2 10 -96 10 0 0 1 0 1 0 -1 0 0 3039.dat
1 2 50 -96 50 0 0 1 0 1 0 -1 0 0 3039.dat
1 2 -10 -96 10 0 0 -1 0 1 0 1 0 0 3039.dat
1 2 30 -96 50 0 0 -1 0 1 0 1 0 0 3039.dat
LEGO ergo sum
Reply
RE: I built a website to generate LDraw code using AI!
#5
I'm afraid I got similar funny results...
Reply
RE: I built a website to generate LDraw code using AI!
#6
Hey, Thanks for all the feedback and sharing the Ldraw code!
The AI is struggling with format and it can be a coin flip right now when it comes to sending back good code! I have logic that is trying to parse and format it correctly when I receive it, but it still is not perfect. I think I need to train a model from scratch to get it right. Use the OMR files with tags of what they are and train it to generate results.
Something you can do which I think would be awesome is generate a share link on the site and share that here. It gives me the visual and Ldraw code without having to paste it here so I can see your results.

https://brickgenerator.com/share/v9k3EffKgp
Reply
RE: I built a website to generate LDraw code using AI!
#7
Awesome work, I'm looking forward to seeing where this goes!

Are you able to share how it works?

Here is my Carrot  Smile
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 3 Guest(s)