HomeiOS DevelopmentSwiftLEGO | Cocoanetics

SwiftLEGO | Cocoanetics


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

First lets have a look at the issue. I purchased 2 used LEGO collections up to now and loved the detective strategy 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 coloration. 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 provides me a present worth of the gathering. Granted it’s for brand new and sealed units, however usually the used and full worth could 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 bought a giant stack of unique directions which made the identification course of a lot faster. Definitely there are additionally just a few extra hidden units that I might 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 decide the constituent components in the fitting quantities from the colour piles. The issue right here is that some colours have big quantities of components, specifically white, black and the grays. So that you see that you just may want 4 of a sure half and it’s important to go dig round for these.

When you can’t discover all it’s best to make an observation someplace to order the lacking half on BrickLink. Or perhaps you’ll stumble accross them because the piles bought 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 entire mini figures and it will discover them of their database. That might then inform you which units this half occurred in. If it’s a distinctive half (like a minifigure or a stickered/printed half) you’ll discover the precise set that is imagined to be from. With out a 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 might undergo them one after the other after which at all times drop them into the zip lock luggage for the units they belong to. The problem right here although is that this: I’d should put up 76 luggage subsequent to one another – perhaps sorted by LEGO set quantity – after which for each scanned half I’ve to go the the fitting again for it.

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

There needs 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 want:

I might need an iPad App, the place I can add a lot of lists of units. Then for every set I might get the record of components from BrickLink. The variety of components I’ve already within the set’s bag I might depend and retailer.

In a method that is the reverse of the needed record characteristic out there in BrickLink. There you can also make lists of components for particular coloration after which within the notes I might write for which set I would want them. Prior to now I might then order lacking components and as soon as I acquired the order I might go to the needed record 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 sure.

As an alternative I think about with the ability to say pick all 2×4 plates from the white pile. Then I might enter their BrickLink ID plus coloration into my app and I might 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 could be how would I make it? Construct it within the open – like an exhibitionist. Or construct it in non-public for less than myself. After all I might begin in non-public and if any person else is all for it then share it. Or might it even be on the app retailer?

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

Getting the Elements

There are doubtlessly a number of methods how I can get the record of components for a set, right here’s the record 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 possibility Rebrickable has an API however it is just for hobbyists and has some fee 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 strategy. For AgentCorp I put collectively a option to parse the HTML DOM of an online web page and convert it into markdown. I made just a few minor changes and now the above components record from BrickLink converts right into a markdown file which I might 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 need to “give away without cost” so simply. So I can’t have it as dependency in an open supply undertaking.

I might extract the scraping code into an open supply element after which reference that as a substitute. Or simply plain copy the code into the open supply undertaking. However such code duplication makes me cringe. However the path of least resistance could be to first simply vibe code an MVP.

Make it exist first. Make it good later.

Name to Motion

Usually I might have written “Conclusion” right here, however we haven’t even began but. What do you assume? Or really feel about such a undertaking? Wouldn’t it be fascinating to witness its progress? Would you could have a use case for that as effectively?

I feel I’ll simply go forward with a public SwiftLEGO undertaking 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

- Advertisment -
Google search engine

Most Popular

Recent Comments