Hacker News new | past | comments | ask | show | jobs | submit login
LeoCAD – A CAD program for creating virtual Lego models (github.com/leozide)
281 points by app4soft on July 19, 2017 | hide | past | favorite | 79 comments



Starting from 2017 developers changed numbering of LeoCAD, so now (after 0.83.x version) it look like YY.MM - 17.07.

This is second release in 2017, and must say that LeoCAD grow up - "Parts" toolbar has so many modes for preview LDraw parts (starting from 17.02). And for now models in main window could be displayed with shadows and blinks (starting from 17.07) - just go to menu "View -> Preferences... -> Rendering" and switch on "Enable lightning".

If you has any issues post them in tracker[0].

LeoCAD has very simple to understand & use UI, so kids could use it after one hour learning using Basic Tutorial[1].

Don't forget read the docs about Texture Mapping[2] and Meta Commands[3] tags (could be stored inside .mpd/.ldr/*.dat), that give you additional features on customizing your LEGO model.

Fresh 'nightly' builds of LeoCAD for many Linux-based distros placed on OBS[4]. Also on this OBS you could find builds for Lpub3D, Lpub, LDglite, LDView and LDraw library.

Call for Developers: if You know C/C++ & Qt, please, help make this program better! Help us solve unclosed issues or propose any ideas on how to improve LeoCAD! ;-)

[0] https://github.com/leozide/leocad/issues [1] http://www.leocad.org/docs/tutorial1.html [2] http://www.leocad.org/docs/texmap.html [3] http://www.leocad.org/docs/meta.html [4] http://download.opensuse.org/repositories/home:/pbartfai/


Also in LeoCAD 17.07 added option "Import LEGO Digital Designer", so now you could import LXF-files ;-)


Lego had its own digital designer, I remember playing around with it a really long time ago, seems its still around. http://ldd.lego.com/en-us/


Interesting. I wonder why it hasn't been more popular. Also, it would be nice if you could order the bricks for a design by a simple order process.


You used to be able to, it even came in a custom box, but it looks like they discontinued it.

http://ldd.lego.com/en-us/subpages/designbyme


LeoCAD seems to have a Linux version (whereas Lego's own designer does not). For me, that'd be a compelling reason to use the former instead of the latter.


It's terrible.


It's actually all but terrible. The constraint engine is better than all of LeoCAD, stud.io or mecabricks.

The only issue is that the database of parts is starting to be outdated, and the database of parts that actually exist even more so.


Honest question: why do they need a constraint engine? Can't everything be done in exact integer multiples of the smallest brick size?


You can build sideways whenever pieces have studs on the side, for example (the first brick with studs on the side was created in 1979 for headlights!). And also put sticks into hollow studs, "click" Technic pegs into holes, rotate Technic pegs and gears. And even place bricks and plates at an angle, using Pythagorean triples or careful rotations, and much more---this is what makes Lego fun for adults too!

Despite relying on basically one size (1.6 mm) and its multiples, the Lego system is really complex. To an untrained eye it seems like parts are very specialized, but actually they are just carefully designed.


> And even place bricks and plates at an angle, using Pythagorean triples or careful rotations

Can you explain this a bit more? I'm having trouble visualizing what you mean.


Pythagorean triples: for example, 3^2+4^2=5^2. For a length-6 plate the distance from the first to the last stud is 5, so you can place it at an angle of approximately 25 degrees, i.e. arctan 4/3, as long as there are no studs in the way (which you can achieve easily using tiles). On LDD you can place it horizontally, choose the rotate tool, and the constraint engine will automatically forbid invalid angles around arctan 4/3, where the plate would overlap with the stud, and "snap" to the right one.

An example of a rotation is to build two rectangles of the same size, and then place the topleft-bottomright diagonal of one rectangle on top of the topright-bottomleft diagonal of the other. The diagonals don't have an integral length, but the lengths are the same so it just works.


Ah, I thought you meant arranging them vertically, not diagonally across the horizontal directions. This makes a lot more sense.


Oh yeah gearing. I guess this really does deserve the title of CAD software at that point.


Even without gearing, and staying within the studs-based construction system, the possibilities are really endless. Search YouTube for "creator expert" Lego timelapse videos ("speed build").

Even kids-oriented sets sometimes enjoy using advanced build techniques. You can start with "Lego 31036 speed build" as the search query to enter the rabbit hole from.


There are a lot of lego pieces with irregular shapes.


How does this compare to Mecabricks online? https://www.mecabricks.com/

And the new tool from Stud.io from Bricklink? https://studio.bricklink.com/v2/build/studio.page


LeoCAD is fully free & open-source crossplatformed standalone software that could run on older PC too. Now availiable for Linux/Mac/iOS/Windows; port for Android also in plans:

https://github.com/leozide/leocad/issues/65

Mecabricks is cloud-based online, so it require Internet connection and, I think, modern PC with WebGL support. License is EULA-like(?) and its track user (users are kids). Not good for security reasons, and not availiable in offline.

Stud.io is only for Mac/Windows, and its licensed as EULA-like(?). Not good for Linux users.

Here is comparsion of LeoCAD with some other LEGO CAD's (November 2015)

http://jasonmcreynolds.com/?p=507

Think, need create comparsion on Wikipedia

https://en.wikipedia.org/wiki/Comparison_of_LEGO_CAD_softwar...


Stud.io and LDD both run well under Wine. However it's good to have an alternative tool that is open source. Stud.io uses the LDraw part database, the same as LeoCAD.

There's also blueprint, a tool to design LEGO instructions. It's not open source due to the author's legal concerns about publishing an open source library to read LEGO's own part database. It's a pity because it is a great tool, with a very good UI. LDraw files (.ldr) support instructions, but the user interface is a bit harder to use compared to the more specialized one in blueprint.


Nice feature of stud.io is that it shows prices of all bricks, so you can cost-optimize your model in case you decide to build it.


I think, add this feature in LeoCAD could be simple, but ask for that on issue tracker

https://github.com/leozide/leocad/issues


Hello,

I am involved in the Mecarbricks development concerning the rendering features. I started a research in 2014 how to render LDRAW and LDD data in a 3d software. At present time it was not easy to get good working and looking 3D models out from LDRAW.

After the first success I started to import bigger models and got to the limits fast: complexity.

http://render.virtualrepublic.org/7130_Snowspeeder_001.jpg http://lego.virtualrepublic.org/render/10179_Millennium_Falc...

The Millennium Falcon with over 5.192 bricks took 16 hours to import to Blender and exporting to Modo. Finally the scene was 2.5GB and hard to deal with.

The solution for that is instancing but the Blender importer did not support this. Also the actual version is not working properly.

End of 2014 I found Mecabricks, contacted the developer and I shared my research knowledge with him and gave a list of features. While I was still working with Modo Nicolas Jarraud was developing a Blender Template based on my Modo setup.

Actually Mecabricks is very powerful because the editor is great, the database is constantly growing due to the help of users. Actually MB has around 10K users growing. Nicolas is working also on a Instruction Generator. The tool supports also import of LDD data depending on the database match. Compared to LDD MB is still not complete. MB supports textures and Blender. You can plan and render your MOCs in photoreal quality out of the box. With Blender it opens a lot of possibilities for animation and game design.

https://www.youtube.com/channel/UC93DRZP1IjyyaWXb6PKiSbg/vid...

It's just online only. The community is a mix of kids, teenager and AFOLs. Also the designer saabfan of the Saturn V rocket is part of the community.

Here's a great example for the power of MB. Gabriele Zannotti is a young graphic designer who started with Blender and 3D in 2014 inspired by my first renderings. He's a great talent and used MB to promote this LEGO Ideas project:

https://ideas.lego.com/projects/ca5c345e-bdae-4c3c-bc4b-05fb...

IMO Mecabicks has a huge potential for a complete new comfortable way to play, build with and visualize digital LEGO.

Feel free to check Renderbricks: https://www.facebook.com/renderbricks/ https://www.flickr.com/photos/136836821@N04/

Cheers Michael


Your comment look like promo material of commercial proprietary product in thread about free & open-source software... Its look like ads...

Anyway, what you use for import LDraw models in Blender?

Currently there is free & open-source add-on "ImportLDraw"[1] for Blender 2.7x that work well, but need few volunteers for little improve it. Could you help with it?

[1] https://github.com/TobyLobster/ImportLDraw


This is fantastic, I remember using Ldraw to create a 3D model from the LEGO blueprint when I was younger. It's great for testing out designs if you don't have the parts, and I remember that the software could print whole step-by-step blueprint books for you.


> and I remember that the software could print whole step-by-step blueprint books for you.

Here it is - LDPub3D (fork of LDPub)

https://github.com/trevorsandy/lpub3d

Some libs and binaries

https://github.com/trevorsandy/lpub3d_linux_3rdparty

https://github.com/trevorsandy/lpub3d_macos_3rdparty

https://github.com/trevorsandy/lpub3d_windows_3rdparty

Also here is upcoming new release

https://github.com/trevorsandy/lpub3dnext

'Nightly' builds are here for many Linux distros

http://download.opensuse.org/repositories/home:/pbartfai/


Wow super cool! They should have a hot swappable rendering backend so we can get globally illuminated PBR renders out. Given the limited materials that Lego bricks are made out of, getting sensible default materials and automated lighting would be hella easy.


> Given the limited materials that Lego bricks are made out of, getting sensible default materials and automated lighting would be hella easy.

So, don't wast time and give us your pull request! ;-)

https://github.com/leozide/leocad/pulls

Other option is use Blender with "ImportLDraw" addon for import and render models produced with LeoCAD

https://github.com/TobyLobster/ImportLDraw

Combination of LeoCAD for modelling & Blender (Cycles Render) for rendering - really COOL thing!


There are tools to convert LDraw models to povray source.


Yeah, LeoCAD could export to PovRay scene format ;-)


If I had side project time I'd really like to make a good VR lego CAD program. I have seen a couple of demos and prototypes and lego has a daydream app, but all of it seems limited and unpolished compared to LDD, LeoCAD etc.


Hm, you give me an idea: what if add "Fly Navigation" and "Walk Navigation" to LeoCAD main window, similar how it's work in Blender?...

https://docs.blender.org/manual/de/dev/editors/3dview/naviga...

This feature request must be on isues tracker!


I just got a VR and I'd pay for this!


Does LeoCAD implement flexible items that can be bent, such as the Space Needle stems (https://shop.lego.com/en-US/Seattle-Space-Needle-21003)?



Is there a software to "manage" a library of LEGO parts, which would then tell me what I can build?

And is there a software to easily feed/initiate this library? Maybe with something as simple as taking a photo of spread parts on the ground.

Am I dreaming?


https://rebrickable.com/

It seems to be mostly geared towards sets, so if you don't know the sets you have it may be more difficult (impossible?) to use.



I remember reading a mulitplayer Lego game dev talk about how her team spent most of their time creating algorithms to detect penis shaped block sets for censorship reasons.


That was Megan Fox (https://mobile.twitter.com/glassbottommeg/status/60440706138...), she had a good series of tweets about lego universe.


Sounds difficult to achieve. I attended University of Texas at Austin, and the campus has a central tower that my psychology professor used as an example of something phallic. The dividing line would have to be rather precise not to exclude too much.


If I remember the original article correctly, it WAS too hard. It proved impossible to prevent offensive shapes from sneaking in. It actually killed the game.

When Minecraft came along a few years later, they avoided the problem by making users host the servers. This shifted liability away from the central developer and put the onus on the player community to sort themselves out.


>This shifted liability //

If I user makes a suggestive shape out of lego blocks inside a 3D game, what liability is there? Much less surely than any of the text chat you get on virtually any online game??

Does/had Minecraft ever had a major problem with what one might term "phallo-philes"?


LDCad[1] is the only one that won't lag with big models. The UI is a bit weird, but it works very well.

I tried LeoCAD, but it was either lagging or crashing with 1000+ pieces.

[1] http://www.melkert.net/LDCad


LDCad is proprietary freeware program and require modern PC with good GPU.

Tried it on 10 year laptop with integrated ATI RS600 - its has many issues and lag during modelling. Also UI not very simple.

In same time LeoCAD work on this laptop very well.

Think, for those who want more features than LeoCAD has must try LDCad. LDCad is mostly for advanced users, for learninig and creating not too big models LeoCAD is the choice.


Yeah, LeoCAD has much nicer UI. I should have added that on my Geforce 1080 GPU it was smoother with big models.

I hope LeoCAD will become more robust with bigger models, having an open source solution is really a big plus.


Very cool, I've actally thought at making something like this using the OpenCASCADE CAD kernel at some point (I'm familiar with that because we are using it at work).

Does LeoCAD itself have built-in capabilities to create the Lego's, using a CAD kernel? Or are they pre-modeled in an external tool? Typical Lego bricks are simple enough to build using basic Boolean geometric operations, so with just a few simple rules the application could define a vast library of bricks to use for building.

I tried to figure this out by looking at the source code, but couldn't find it, so maybe one of the authors can comment on this? Where is the brick data coming from?


OpenCASCAD is too complex for such tasks.


The one I've been familiar with (since the early 2000s, really) is LDraw:

http://www.ldraw.org/

These guys take Lego SERIOUSLY.


Yeah! LeoCAD use LDraw library compiled in binary form ("library.bin") for faster interaction with it, but also could use LDraw in original 'textual' form directly.

Also, LeoCAD always included in "All-In-One-Installer" (aka AIOI) for Windows, produced by LDraw team.

http://www.ldraw.org/news/37/15/LDraw-All-In-One-Installer-2...

AIOI include one more CAD - LDCad (also availiable for Linux), that could be in some way powerfull (allow scripting, etc.), but LDCad is only freware proprietary software.

I tried both (LDCad & LeoCAD.) on xUbuntu 16.04LTS (64bit) on 10-year old notebook (Samsung R58P - RAM 2Gb, CPU 1.7 GHz, intagrated GPU ATI 1250 Express 256Mb).

For me (from point for teaching kids 6-14 year olf), LeoCAD much easier and faster.. LDCad has much harder to understand UI and settings dialogs, that not all kids could undetstand.


I recall that one of the LeoCAD-style brick based editors had an option to remove all the top and bottom connection features for export to .OBJ or similar, simplifying the shapes to boxes but reducing the poly count enormously.

Was that something LeoCAD could do or would I need to use a different tool for that? (This wasn't a general purpose hidden surface removal, it was just removing all of the parts of the bricks associated with ensuring physical connections)


To answer my own question: the program was LdrDat2Obj[0] and it had an option to ignore stud.dat references inside brick definitions when exporting designs to .obj (you'll still be carrying all the weight of the unseen internal connection shapes but it still represents a pretty huge poly savings to exclude the top studs on export)

[0]http://www.pearse.co.uk/lego/links/ldrdat2dxf/


Well, that's my productivity done for the rest of the day


So, if you has some free time, then create model of some LEGO® MINDSTORMS® EV3 Core sets robots in LeoCAD

http://robotsquare.com/2013/10/01/education-ev3-45544-instru...

For example, try make "Educator Vehicle"

http://robotsquare.com/wp-content/uploads/2013/10/45544_educ...

Here is videotutorial for making it in LeoCAD (only modeling, not programming or emulating)

https://www.youtube.com/watch?v=t81g9hbKG5A

;-)


I'm wondering about the legal side of this. Is it OK from LEGO side to have stuff like this and other similar tools?

And what if when you start printing stuff like that?


LEGO’s patents expired a while ago, and competitors such as KREO have replicated the shapes and some of the models already.

That said, no one is going to print LEGO – actual LEGO is a lot more robust and stable than anything you could print yourself.


Oh, I see. But replicating the existing plastic cube was not what I actually thought. I thought: what if I print/manufacture lego mega blocks from whatever material.


You can't make "Lego bricks" as Lego is the trademark giving the origin of specific bricks but you can make near identical (missing the wording "Lego") bricks if you wish. If you do it at home and completely without any commercial aspect [giving them away can be commercial, so you have to take great pains to avoid being commercial] then you can make identical ones AFAICT.

This isn't legal advice of course.


Don't they have design-patents on the newer bricks?


While you can print LEGO there are several reasons not to: * you cannot print as precisely as LEGO bricks- so the quality is not the same * there are ugly layer bumps on the stones * the effort required * LEGo bricks are relatively cheap


As other people have mentioned it is generally not worth it, however I have seen some people print blocks that don't exist in traditional Lego sets. An example is a block consisting of three 2x8 flats joined in an equilateral triangle on the short edge.

Presumably you need to set your printer to its slowest and most precise mode to get a usable block.


The LEGO Group has some rules under Play Fair on their website:

https://www.lego.com/en-us/legal/legal-notice/fair-play

The patent for the bricks ended in 1988. But the Minifigures have a copyright. As long as you don't use all this for commercial purposes and profit they are very relaxed. Because their fans and community are a very important part of the LEGO brand.


I believe the tolerances on Lego for it to be "just right" are fairly narrow, and most 3D printers aren't precise enough (but I could be mistaken).

It is likely that Lego has patents on parts of their brick design, so you could be in a fairly bad legal minefield if Lego decides to sue you. Also I'm not sure that describing your project as "a tool for designing Lego" is a good idea.


> I believe the tolerances on Lego for it to be "just right" are fairly narrow, and most 3D printers aren't precise enough (but I could be mistaken).

Yup, the Lego tolerances are ridiculously tight, even for injection molding. 3D printing will generally give you results far worse than even the sloppiest injection molding process.

> It is likely that Lego has patents on parts of their brick design, so you could be in a fairly bad legal minefield if Lego decides to sue you. Also I'm not sure that describing your project as "a tool for designing Lego" is a good idea.

Lego's patents expired in 1989, that's why we now have stuff like MegaBloks. Lego did try to trademark their studded bricks, but that was shut down by the ECJ and others.


>believe the tolerances on Lego for it to be "just right" are fairly narrow

As far as I'm aware this is quite an understatement. The tolerances and consistency of lego pieces is impressive, to say the least.


I wonder is it possible to create something here and drop it in an AR environment.


by here i mean in LeoCAD


Sure, why not you just need to translate the format into something your AR set understands. Would be a neat project!

If your post is <1hr old you can edit it for little clarifications like this :-)


Thanks for the pointer :)


What is the output? Could you build 3D models with "virtual legos" and 3D print them easily?


In principle, yes, in practice, no. The tolerances and surface quality achievable are far below what you require and expect when connecting or even just holding or looking at Legos. As ubiquitous as Legos are, they're among the highest tolerance, highest quality rigid plastic parts you're likely to encounter.


What about printing an entire model and not the pieces?

In other words, could I "build" models with that software without any knowledge of 3D modeling and use those models to 3D print?


Print model consisted from many parts (bricks) directly is little complex task. Think, you need export model from LeoCAD in some 3D mesh (obj, stl or 3ds) and then need make some optimization (remove hidden faces, etc.)

But there is "ImportLDraw" addon for Blender, so its better create feature request to its developers

https://github.com/TobyLobster/ImportLDraw


Cool concept! Sent over a couple pull requests for the docs intended to be helpful, but okay to ignore.


About LICENSE issue - here it is

https://github.com/leozide/leocad/blob/master/docs/COPYING.t...

P.S.: I'm not an owner of LeoCAD, so little wait before owner will review your isuues & pull requests (think in one-two days he will reply on Github)


Wow, that brings some memories. I spent quite a while playing with it in the early 2000's.


For some reason github shows me a 404 when I try to see the full README.


> For some reason github shows me a 404 when I try to see the full README.

README.txt placed in /docs/, not in root folder, so USE THIS LINK

https://github.com/leozide/leocad/blob/master/docs/README.tx...


FWIW version 0.83.1 (October 2016) is available in Ubuntu repos.


Yeah, this issue on repositary[0] system for distributing apps.

[0] https://repology.org/metapackage/leocad/versions

Anyway, you could get latest builds from OBS[1]

[1] https://software.opensuse.org/package/leocad




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: