24 C
Canberra
Tuesday, October 21, 2025

SwiftLEGO | Cocoanetics


My subsequent pastime venture – dare I say referred to as it a “vibe venture”? – will probably be a device to assist me cut 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 previously and loved the detective means of discovering out which units these components got here from. I developed a technique to first wash the components after which cut up them by colour. From stickers, minifigures or distinctive components you’ll be able to make an inventory of units. I created an inventory 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 new and sealed units, however sometimes 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 Pals Lodge, however nonetheless contained 7 different units. Now this newest one I counted 76 units. For the final one I additionally received a giant stack of unique directions which made the identification course of a lot faster. Actually there are additionally a couple of 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 an inventory of components for every set from BrickLink and choose the constituent components in the precise quantities from the colour piles. The issue right here is that some colours have enormous quantities of components, particularly white, black and the grays. So that you see that you simply may want 4 of a sure half and it’s important to go dig round for these.

For those who can’t 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 received 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 level at particular person components or entire mini figures and it might 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 purported to be from. And not using 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 must put up 76 luggage subsequent to one another – possibly sorted by LEGO set quantity – after which for each scanned half I’ve to go the the precise 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 is likely to be from?

There must be an app for that

So I’ve been pondering 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 might need an iPad App, the place I can add quite 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 rely and retailer.

In a manner that is the reverse of the needed record characteristic obtainable in BrickLink. There you can also make lists of components for particular colour after which within the notes I might write for which set I would want them. Up to now I might then order lacking components and as soon as I obtained 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 certain.

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 colour into my app and I might get an inventory 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 useful – 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 personal for under myself. After all I might begin in personal and if any person else is involved in it then share it. Or might it even be on the app retailer?

It could be pretty to search out some pals with related pursuits (LEGO, Swift, SwiftUI, AI) after which geek out with them collectively. However then once more, I is likely to 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 person will take care of what I’m proposing right here anyway, I ought to possibly simply attempt to make myself pleased. What do you suppose?

Getting the Elements

There are probably 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. Various choice Rebrickable has an API however it is just for hobbyists and has some price limiting. Additionally it appears to make use of completely different IDs for components than BrickLink I see as hindrance down the street.

This brings me to the scraping method. For AgentCorp I put collectively a approach to parse the HTML DOM of an internet web page and convert it into markdown. I made a couple of 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 a couple of issues in there that I don’t wish to “give away without spending a dime” so simply. So I can’t have it as dependency in an open supply venture.

I might extract the scraping code into an open supply part after which reference that as a substitute. Or simply plain copy the code into the open supply venture. 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 suppose? Or really feel about such a venture? Wouldn’t it be fascinating to witness its progress? Would you will have a use case for that as properly?

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

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles