-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presets for specific products #486
Comments
Yeah, I have been wondering about that, too. Question is how to do that easily and without cluttering the UI too much. I could imagine an optional drop box and "Load defaults" button on the right aligned on the "Generate" button row. As we can pass parameter in the URL this should actually not be too complicated to implement. May be a bit infrastructure is needed to make this convenient API wise. |
I was thinking about creating a bunch of classes define default shapes like cylinders, extend on those to create a category for batteries and create a list of common types, AA/AAA/18650. For hooking these up to the models I thought about creating a mapping, so for example the diameter of the battery links to some field of the model thus knowing what field to set. So I was thinking about playing around with it but looking at the boxesserver I got a headache and went a little overkill. I rewrote the web server in Flask (not complete overkill, I could have gone with Django). This with the goal of creating an interface that is more manageable than the boxesserver. I'm planning on seeing if I can define the defaults in json and expanding the forms to generate the models. Was thinking about using a modal where the model can be selected and optionally a margin. Tell me if I'm going overboard (or when I did...) |
It would definitely be usefull for a lot of things ❤️ Some other ideas:
|
I love it! now to figure out the best way to get there. The backend part shouldn't be that difficult, the frontend might be a bitch... https://github.com/patvdleer/boxes/tree/flask , code is in the folder called web, might be horribly overkill but it seems to be a lot easier to update/change than the current script (or at least for me it is) |
The back end part is the thing to get right. May be just adding a presets property to the Boxes class is enough. It could be a dict "Description" -> settingsdict. With the settingsdict just being "settingsname" -> value. The front end would need to turn that into a dropbox that invokes a link to the generator with the preset values in the URL. If this is too complicated it can just give the name of the presets and the Boxes class has to load them in (probably) |
Maybe add to the list:
There are so many possibilities. I think getting the form of the database right is key, then people could add whatever kind of items they want. These wouldn't necessarily be tied to specific generators. But could be referenced in other generators, like the new FrontPanel generator. |
@ccrome the reason I was thinking about a (more elaborate) class based system is specifically screws and such. The step after default simple products would be to have dynamic or combined/compound product like screws with different heads or more complex objects were there are a lot of sizes of. It would allow us to extend on other types and use property functions rather than a "hard-coded" dict of measurements. So rather than just a dropdown in the interface you would also be able to select a type of object and enter your own base measurement. In stead of writing out all types of screw heads and generate 1M up to 20M a user could select the head type from the dropdown and enter the metric value letting the model calculate the correct dimensions. I hope Im getting making any sense |
A quick attempt: https://github.com/patvdleer/boxes/tree/product_measurements |
i see it like this Something like file `
}` |
@HaSHsss how do most users use Boxes? Via webinterface no? As much as I love the terminal it seems like a pain to do this on a bare terminal (as in, without TUI) |
I meant developers under the word |
bare terminal (as in, without TUI) - what are you talking about. I didn't suggest it |
I also lean towards simple preset of settings which are just default values, but I'm not sold on the JSON way. Every boxes have different settings, and it would be tedious to add another item of a standard kind to multiple boxes compatible with it. If the exact same presets are directly in Python , you could just declare preset the same way as in JSON for simple cases, but it also makes it possible to concatenate mapping from multiple collection. For example, the NotesHolder could iterate from the PostItNotesStandardsSize [{name, width,height}] to generate some presets, concatenated with presets generated iterating from PlayingCardDeckStandardSize [{name, width, height, depth}], and as soon as a new size is added in a collection source it will impact the presets of every boxes using it. |
I don't need a lot of fancy presets... but could we add a diameter input on the Coffee Capsule Holder? I was able to re-size it for K-cups finally, but it was quite a pain. |
I think @florianfesti suggested the same thing when I contributed this "box". @PhoenyxAshe Do you have the hard-coded settings values you changed for K-cups ? I can add the input, with the settings value in the "box" description until preset exists. |
I don't. The first one I made was a number of... eventful... months ago. I think I set the values in the generator at 3 rows... 4 or 5 capsules by row, and when I cut the pieces, they were too small. So in Inkscape I duplicated the top panel, then chopped it down to just part of one of the rows - basically the opening plus enough for a bit more than one capsule past so I could make sure that the capsule would both fit into the opening and into the rest of the holder. Then I started scaling up, cutting just that test piece, and scaling again until I got the right size. Looking at my files, it looks like it took four tries. (Original file was 01, followed by 01a-01d.) Again, memory is spotty on the details, but I'm pretty sure I measured the cups around that time as well, both the upper diameter of the cup itself and the lip, and measured in Inkscape as well, so it was mostly a matter of fine tuning. For the generator itself, the only presets are "columns" and "capsules by column". Therefore, the only way to change it for different capsules is after the file has been generated. Adding the additional inputs of "opening diameter" and "capsule diameter" would make the generator a lot more flexible, enabling it to do more than just coffee capsules. I'm not sure why my brain went in that direction, but with the right thickness of wood or extra layers, wine glasses could even be done, like in the image I just grabbed: Given a bit more caffeine and time, I could probably come up with a number of studio/garage/workshop options as well. Which is why, while presets for specific items might be nice, I'm more interested in greater flexibility as a whole. As another example, when I first saw the Angled Cut Jig, my first thought was that it would be great for a bookbinding punch cradle... and still would - if there was an option to even out the angled sides. (The shorter side makes it harder to keep signatures in place.) I could probably still make it work with a lot of tweaking in Inkscape... but it's time consuming and my project list keeps growing by the day. |
@patvdleer I'd love to see flask rolled in to boxes! I don't see an issue or PR for it. I'd be happy to help if there are any gaps left. |
@Ranthalion I didn't create one, I've started work on https://github.com/patvdleer/boxes/tree/flask_presets but due to personal life I haven't found the time to continue working on it. Check the |
@HaSHsss I like the idea of presets being represented by json files. I think this could open up a larger presets ecosystem if we support loading presets from a url. Users could publish their own presets to any github account (or anywhere web accessible, I guess). Boxes could have an official presets repo, but users could copy/paste the url for repos with a collection of presets, or the url for a single preset. |
How about adding presets of settings for specific boxes? Take CanStorage for example, a preset for AA, AAA, 18350 or 18650 batteries would be really helpful.
The text was updated successfully, but these errors were encountered: