in3dca-freegrid icon indicating copy to clipboard operation
in3dca-freegrid copied to clipboard

Officially release WB on FreeCAD

Open hasecilu opened this issue 9 months ago • 11 comments

Hi, @instancezero, @johnsonm, it's been a while since last change.

I'm planning to officially add this WB to the FreCAD addon manager so I would like to see if some of you have some reviews or some ideas for things to add.

I think I'll let the WorkBench branch to be the "main" branch for the WB and let real main for the macro.

  • [X] Fixed the bug from https://github.com/instancezero/in3dca-freegrid/issues/1#issuecomment-1913689032, now you can set the height to 0 (values from 0 to 2.6[mm] result in same geometry) to have a flush floor without breaking the geometry. Screenshot_2024-05-08_20-23-14
  • [ ] Add submodule to FreeCAD-addons: https://github.com/hasecilu/FreeCAD-addons/tree/add_freegrid
  • [ ] Need icons: https://forum.freecad.org/viewtopic.php?t=87507 image
  • [ ] Add floor to bit cartridge holder, other ideas? image

Just something more: in in3dca/h.py file there was planned something for to_origin var? It just creates a 0 vector that is added to all points, it adds 0. In other parts of the code there is the same operation so I think there is no need to have it there, I'm missing something?

    if to_origin == 0:
        to_origin_v = xyz()
    moved = []
    for point in vec:
        moved.append(xyz(point.x + to_origin_v.x, point.y + to_origin_v.y, point.z + to_origin_v.z))
  • [X] Preferences page to set custom default values image
  • [X] About page image

  • [ ] Update CHANGELOG
## 2.0.0 Workbench release

Changes:
* Migrate from macro to workbench.
* Created objects are fully parametric, properties can be changed on Properties View panel.
* Add docstrings to methods.
* Add translation support.
* Add possibility to assign a random color at creation time.
* Add transaction at creation time.
* Add dockable UI to set sketch size.
* Add pre-commit hooks.
* Add preferences page and command to open preferences page.
* Add command to open about page.

Bugs:
* Fixed issue when trying to create a storage box smaller than 10[mm]. Useful to get a "floor".

## 1.3.0

Bugs:
* Fixed issue when copying dividers, now built-in copy() method is used.

Changes:
* Add forms to let users enter magnet parameters to both boxes and grids.
* Use FreeCAD Quantity parser.

Fix #1

hasecilu avatar May 09 '24 03:05 hasecilu

I just got to looking at this on Monday. Added a percentage height option for the dividers, had to revert some return types to get it to run with the version of Python distributed with 0.21, and have a serialization error I haven't found a fix for. Maybe I will push that to a branch so you can take a look.

I'll take a look at h.py. Other stuff on my wishlist would be generating a base plate if the height is at or below the floor level, and a "lid" or "cap" object that's optionally either flat on top or stackable.

It will probably be the weekend before I can look at this again.

instancezero avatar May 09 '24 04:05 instancezero

Ah, I see the floor fix is in already!

instancezero avatar May 09 '24 04:05 instancezero

@instancezero what would you think about creating a branch off main called macro and merging the workbench to main after this merges, so that new contributors start with the workbench?

johnsonm avatar May 09 '24 11:05 johnsonm

@johnsonm that's a good idea.

instancezero avatar May 09 '24 11:05 instancezero

For the "bit cartridge holder" I have two thoughts.

  • I don't know what "bit cartridge" this works with — could you make a more descriptive, particular name? Is there some kind of standard "bit cartridge" that applies here?
  • This would, I guess, start a change in how the ecosystem is developed to having more objects in code. It's the kind of thing that I would have previously expected to be a simple parametric FCStd for the top, that unions with the appropriate base. If we do this, we should probably systematize how to add many, otherwise inasmuch as FreeGrid gains popularity we could end up with a UI mess, I would think.

johnsonm avatar May 09 '24 11:05 johnsonm

@johnsonm That's a tricky one. There's an image of it with bits here https://www.printables.com/model/493836-in3d-freegrid-bit-cartridge-holder It seems to be a fairly standard size for CNC bits (there are four separate vendors in that image) but even then I'm not sure it's "general" enough to be integrated into the workbench. A parametric version would be much more appropriate; I just found it easier to do the computations in code.

In the current state I'd be inclined to share the macro code for something like this. It's unfortunate that macros can't be embedded in a .FCstd file.

As an aside, this is an example of why I'd like a cap object. I did this print before I got those 1/4" bits and now it's not stackable. In an ideal world this thing wouldn't have that wall on three sides but instead have a cap, either drop in or hinged.

While I'm at it, what I think is missing from a "systems" level is more storage options. A wall mountable rack, for example. Rails, which would be a grid with a low profile in Y and no magnets so that boxes can be slid in and out. Ideally with some way of affixing them to a bench/shelf.

Lots of ideas, not much time...

instancezero avatar May 09 '24 13:05 instancezero

@hasecilu h.py was copied form an early project I did where that argument to poly_close() was used almost all the time. It was also the first code I wrote for FreeCAD and the first time I'd touched Python in years and years. Clearly that code isn't optimal. I'd be inclined to drop the argument. I might even go back to the old code and take it out, then add a poly_move() function!

Typed lists on a return value, as in -> list[Base.Vector] require Python 3.9+ so this won't run with the 3.8 embedded in FC 0.21. I'm assuming 0.22 will run 3.9, so are we planning to wait for that? If not I'd annotate the return types in comments and just return list for now.

instancezero avatar May 09 '24 13:05 instancezero

I just got to looking at this on Monday. Added a percentage height option for the dividers, had to revert some return types to get it to run with the version of Python distributed with 0.21, and have a serialization error I haven't found a fix for. Maybe I will push that to a branch so you can take a look.

Sure, upload it and I'll take a look

Ah, I see the floor fix is in already!

Making a small box we can get a "floor" piece but should be offer floors and lids as extra commands?

@instancezero what would you think about creating a branch off main called macro and merging the workbench to main after this merges, so that new contributors start with the workbench?

Good idea!

@hasecilu h.py was copied form an early project I did where that argument to poly_close() was used almost all the time. It was also the first code I wrote for FreeCAD and the first time I'd touched Python in years and years. Clearly that code isn't optimal. I'd be inclined to drop the argument. I might even go back to the old code and take it out, then add a poly_move() function!

Nice, I'll try to make the changes.

Typed lists on a return value, as in -> list[Base.Vector] require Python 3.9+ so this won't run with the 3.8 embedded in FC 0.21. I'm assuming 0.22 will run 3.9, so are we planning to wait for that? If not I'd annotate the return types in comments and just return list for now.

Did you tried a latest version? I tested on latest AppImage and it seems the version of Python used is 3.10.

All tests I have done are on latest weekly AppImage because FreeCAD 0.21 got broken because upgrade to Qt6 on Arch Linux.

hasecilu avatar May 09 '24 16:05 hasecilu

I have the same problem with my update to Fedora 40 breaking the stable release of FreeCAD so that I'm only on the weekly...

johnsonm avatar May 09 '24 18:05 johnsonm

There's an image of it with bits here https://www.printables.com/model/493836-in3d-freegrid-bit-cartridge-holder It seems to be a fairly standard size for CNC bits (there are four separate vendors in that image) but even then I'm not sure it's "general" enough to be integrated into the workbench.

Oh I have those in lots of different sizes, even for the small ones that fit in my ER11 collet, and a far larger variety as soon as I add the ones that fit into my R8 collets.

And as soon as you are making rectangular holes, they are for anything that fits in those holes, which could be far more kinds of things...

A parametric version would be much more appropriate; I just found it easier to do the computations in code.

I might be able to help make that work out. Share a FCStd with me and talk through what was difficult?

johnsonm avatar May 09 '24 18:05 johnsonm

I might even go back to the old code and take it out, then add a poly_move() function!

I think that would be the equivalent to poly_translate() function. I removed the unused var.

I tested the divider height change and seems to play nicely.

hasecilu avatar May 10 '24 02:05 hasecilu

Hi, @instancezero @johnsonm, it's been a while since last change but it's done!

Except for the ugly icons, I think all functionality is OK, the cartridge holder is generated with floor and walls. There was a small refactor in the code to inherit methods and variables from StorageBox.

So I would like to know if you think there is something to change. I would like to release before FreeCAD 1.0 release.

image

hasecilu avatar Sep 23 '24 19:09 hasecilu

I'm all for getting it out there pre-FC 1.0!

instancezero avatar Sep 23 '24 20:09 instancezero

I agree, a release for 1.0 is a great idea! ☺ Thank you for doing all this work!

johnsonm avatar Sep 23 '24 22:09 johnsonm

Cool! I'm merging this to Workbench, then moving the macro from main to macro and finally moving Workbench to main.

@instancezero could you:

Tag (AKA 'label') your Github repo with the following: freecad, addons, and workbench

followup: #17

hasecilu avatar Sep 23 '24 22:09 hasecilu

Repo terms are now workshop, storage, organization, addons, freecad, workbench, 3d-models, and freecad-workbench

instancezero avatar Sep 24 '24 03:09 instancezero