SwiftLEGO | Cocoanetics


My subsequent passion venture – dare I say known as it a “vibe venture”? – will probably be a instrument to assist me break up color-assorted piles of LEGO components into their constituting units. Earlier than I get began there are some philosophical concerns to make.

First lets have a look at the issue. I purchased 2 used LEGO collections prior to now and loved the detective technique of discovering out which units these components got here from. I developed a technique to first wash the components after which break up them by shade. From stickers, minifigures or distinctive components you’ll be able to make a listing of units. I created a listing for every such assortment on BrickEconomy, as a result of this additionally offers me a present worth of the gathering. Granted it’s for brand spanking new and sealed units, however sometimes the used and full worth can be one thing like half of that.

The primary assortment is bought had 31 units, the second was supposed simply to be a Associates Lodge, however nonetheless contained 7 different units. Now this newest one I counted 76 units. For the final one I additionally acquired an enormous stack of authentic directions which made the identification course of a lot faster. Actually there are additionally just a few extra hidden units that I’d solely uncover in a while.

After washing and color-splitting essentially the most time-consuming set is to get a listing of components for every set from BrickLink and choose the constituent components in the proper quantities from the colour piles. The issue right here is that some colours have big quantities of components, particularly white, black and the grays. So that you see that you just would possibly want 4 of a sure half and it’s important to go dig round for these.

For those who can not discover all you must make a remark someplace to order the lacking half on BrickLink. Or possibly you’ll stumble accross them because the piles acquired smaller. It’s a really tedious and time consuming course of.

One factor that already confirmed nice promise is the BrickScan app which you’ll be able to level at particular person components or complete mini figures and it could discover them of their database. That will then let you know which units this half occurred in. If it’s a distinctive half (like a minifigure or a stickered/printed half) you’d discover the precise set that is presupposed to be from. With no subscription BrickScan limits you to a few scans per day, so I sprang for the subscription as quickly as I had verified that it’s fulfilling its promise admirably.

I’ve a separate field of stickered/printed components and minifigures and I may undergo them one after the other after which at all times drop them into the zip lock baggage for the units they belong to. The problem right here although is that this: I’d need to put up 76 baggage subsequent to one another – possibly sorted by LEGO set quantity – after which for each scanned half I’ve to go the the proper again for it.

And that is solely a small a part of the general drawback. What do I do with generic components which have dozens of units they could be from?

There ought to be an app for that

So I’ve been considering if I couldn’t construct an app for myself to assist me with this. So right here’s my ideas on what I would like:

I’d need an iPad App, the place I can add plenty of lists of units. Then for every set I’d get the checklist of components from BrickLink. The variety of components I’ve already within the set’s bag I’d rely and retailer.

In a approach that is the reverse of the wished checklist characteristic out there in BrickLink. There you may make lists of components for particular shade after which within the notes I’d write for which set I would want them. Prior to now I’d then order lacking components and as soon as I acquired the order I’d go to the wished checklist and discover my remark to know which set’s bag I ought to drop it into. A workable however lengthy winded course of to make certain.

As a substitute I think about having the ability to say pick all 2×4 plates from the white pile. Then I’d enter their BrickLink ID plus shade into my app and I’d get a listing of units the place these are lacking and what number of. And since I don’t have a component scanner to place into my app – boy that may be helpful – I’d have to make use of BrickScan for that.

So with the fundamental premise for this app described the following query now’s how would I make it? Construct it within the open – like an exhibitionist. Or construct it in non-public for under myself. In fact I may begin in non-public and if someone else is eager about it then share it. Or may it even be on the app retailer?

It could be pretty to seek out some buddies with related pursuits (LEGO, Swift, SwiftUI, AI) after which geek out with them collectively. However then once more, I could be the one one so loopy as to wish to commit some display time to constructing such an app. And since in all probability no one will take care of what I’m proposing right here anyway, I ought to possibly simply attempt to make myself comfortable. What do you assume?

Getting the Components

There are probably a number of methods how I can get the checklist of components for a set, right here’s the checklist of components of the LEGO Titanic for instance – in printing mode – from BrickLink. The issue is that BrickLink itself solely has an API for sellers. Different choice Rebrickable has an API however it’s only for hobbyists and has some charge limiting. Additionally it appears to make use of totally different IDs for components than BrickLink I see as hindrance down the highway.

This brings me to the scraping method. For AgentCorp I put collectively a strategy to parse the HTML DOM of an internet web page and convert it into markdown. I made just a few minor changes and now the above components checklist from BrickLink converts right into a markdown file which I may simply retailer right into a SwiftData DB.

The issue right here is that AgentCorp is presently not open supply as a result of there are fairly just a few issues in there that I don’t wish to “give away free of charge” so simply. So I can not have it as dependency in an open supply venture.

I may extract the scraping code into an open supply part after which reference that as an alternative. Or simply plain copy the code into the open supply venture. However such code duplication makes me cringe. However the path of least resistance can be to first simply vibe code an MVP.

Make it exist first. Make it good later.

Name to Motion

Usually I’d have written “Conclusion” right here, however we haven’t even began but. What do you assume? Or really feel about such a venture? Would it not be attention-grabbing to witness its progress? Would you’ve a use case for that as effectively?

I believe I’ll simply go forward with a public SwiftLEGO venture on GitHub and see the place this leads me.


Classes: Enjoyable

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles