Le0Michine / FusionGridfinityGenerator

Other
623 stars 40 forks source link

Where possible output values as expressions #49

Open matt-sorenson opened 9 months ago

matt-sorenson commented 9 months ago

I'd like to be able to create parameters like gridfinity_height in my projects, and then after generating the model and doing some sketches and starting to do my own extrusions realizing I need a different height being able to edit the parameter. Right now the plugin appears to calculate the value during generation time so instead of the extrusion being bin_height_unit * bin_heightmm its xmm

I'm not sure how viable it is for all parameters but for some like height I think they should be pretty workable.

Le0Michine commented 9 months ago

hi, thanks for submitting an issue. That's an interesting suggestion. I would need to look into that and see how hard it would be to surface at least some of the internal calculations. It seems like for that to be useful the plugin would need to create some user parameters automatically like those demonstrated below, otherwise the expressions would not be as useful because they will not be referencing particular parameters and would look like this (7 * 4) * 1mm. Example of user parameters below

image

I already did some experimentation with those parameters before and the problem I found that is that they are always global and cannot be scoped to a particular component. So once first component is created it would have a bunch of parameters pushed into user parameters list and subsequent components won't be able to do the same. Some of those parameters which are unlikely to change across multiple objects could be just reused. But things like width, length, height etc. are often unique for each bin/baseplate and that would require some tricks to make it possible. For example for each model there could be a unique prefix/suffix added to the name making them distinct, not sure how usable they would be in that case though. Also not sure if creating too many of those parameters would just clutter the list and impact user ability to work with them efficiently.

I can imagine workflow where one would want to create only a single model (eg bin) with some customizations so it could be controlled by those params, not sure if that's what you are referring to. That might be doable by adding a toggle (store config in user params) into the settings and only allowing it for a single model within the project or as long as there is no conflicting parameter names.

matt-sorenson commented 9 months ago

I hadn't thought of the use case of multiple bins in a single design, so at least for my use case having it optional and limited to single model design, or the 'namespacing' with a unique prefix before each would be fine.

My particular suggestion was a bit more limited in my head of not providing the parameters by default, just outputting the values as expressions based on what's put into the input by the user. Right now I can put bin_height into the gridfinity plugin and it will correctly grab the value of that and output the calculated value into the operation, where I'd prefer it to instead put the expression used to calculate it into the operations on the timeline. So if I just put in bin-height of 4 and a u-height of seven in the gridfinity plugin it would just have (7 * 4) * 1mm in the timeline, but if I put bin-height of bin_height the timeline would have (7 * bin_height) * 1mm which would mean you as the plugin author don't have to worry about polluting the parameters list, but I can do it to my hearts content, and then I also don't have to worry about things I'll never change like the 42mmx42mm unit size filling up my parameter list, but others who do care can have at it all they want.

Samywamy10 commented 8 months ago

+1 to this request. I've found I want to update the height a couple of times, and have to re-create the box (including any modifications I've made e.g. cutting) again. I've found the Extrude operation that updates the height, but then the lid/scoop part doesn't move up with it. Even just having subsequent commands respond to that would be amazing