Honeycomb macro

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Honeycomb macro

Post by TheMarkster »

Update: Now in addon manager. I didn't know there was already a feature python honeycomb macro (honeycomb solid), but this one is a little bit different. It works as a native Part Design solid feature and has options for borders and for oval shapes.

**********

This thing is sweet.

The Honeycomb macro is a revision of the old FCHoneycombMaker macro. I will probably be removing that one from the wiki / addon manager and replacing it with this one, but the older might remain for a while since it works with older versions.

This new macro is a feature python object that works in and out of Part Design. If you have an active Body it puts itself into that Body, otherwise it is in the document as a document object, but not inside the Body. You can drag it into a Body and it will go in, not as a BaseFeature, but as a native Part Design object. It can be used in pattern features, such as linear pattern, but I doubt that will be a common usage.
honeycomb_scr2.png
honeycomb_scr2.png (97.72 KiB) Viewed 16292 times
honeycomb_scr1.png
honeycomb_scr1.png (115.11 KiB) Viewed 16292 times
It is attachable, so you can easily place it where you want it in the model. It can be made with a border or without a border, and the border can be elliptical or rectangular.

Full documentation on github:

https://github.com/mwganson/honeycomb

Installation: Not available yet in the addon manager. Get the Honeycomb.FCMacro file and put it in your macro folder. On first run it offers to create a new file: honeycomb.py. You do not have to create the file to use the macro, but without it when you open a document containing a Honeycomb object after restarting FreeCAD the object will be broken.

I am attaching the toolbar icon and the current version of the .FCMacro file, but you should check periodically for updates on github.
Attachments
Honeycomb.FCMacro
(27.3 KiB) Downloaded 109 times
Honeycomb.svg
(24.76 KiB) Downloaded 96 times
LHC
Posts: 321
Joined: Thu Sep 17, 2020 4:21 pm
Location: Canadian Coffee Shop

Re: Honeycomb macro

Post by LHC »

This looks really nice - thanks Mark ! I have yet to download this, but am wondering - is there a feature, or is it possible to easily "center" the honeycomb on the border, without eyeballing it with offsets? Not a showstopper, but just something that popped into my mind as I was reading your posting.
Thanks again,
Lewis
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Honeycomb macro

Post by TheMarkster »

The grid centers itself in the border, or at least is supposed to unless there is a bug. There are a couple offset properties you can use to adjust the placement of the grid relative to the border, mostly for aesthetics.

For example, this grid before positioning with YAdjust property:
Snip macro screenshot-2b7032.png
Snip macro screenshot-2b7032.png (60.32 KiB) Viewed 16076 times
and then after:
Snip macro screenshot-b27278.png
Snip macro screenshot-b27278.png (62.26 KiB) Viewed 16076 times
LHC
Posts: 321
Joined: Thu Sep 17, 2020 4:21 pm
Location: Canadian Coffee Shop

Re: Honeycomb macro

Post by LHC »

Thanks for the clarification. I just loaded it up and had a play. Seems to work like a charm.
LHC
Posts: 321
Joined: Thu Sep 17, 2020 4:21 pm
Location: Canadian Coffee Shop

Re: Honeycomb macro

Post by LHC »

Mark - I just noticed something and I am not sure if it's me or a quirk in the way the object is created. When I run the macro, then take the default honeycomb that's created, then move it off to the side and run the macro again, I get 2 honeycombs in the 3d space, but deleting one yields a blank 3d space with both gone. However, the other one is still in the tree and highlighting it and pressing the space bar brings it back into view. Seems the delete operation turns off the visibility of the original honeycomb ?

Also - here's a pic of the default when the macro is run. As you can see the honeycomb section is centered on the y axis but not the x. Is this a bug ? Seems to be able to be eyeballed into place with the adjustment you have in the properties, but would be nice if it was centered.

I can see using this for 3d printed fan grills and other decorative stuff. Thanks again.
Capture.JPG
Capture.JPG (69.67 KiB) Viewed 15991 times
EDIT - I just noticed that the example you posted in your last post is the same offset on the y axis so I guess this is the way it works...
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Honeycomb macro

Post by TheMarkster »

From what I can see this is expected behavior. I could add code to make the previous feature visible when the Honeycomb is deleted if the deleted Honeycomb was the Body's Tip object.
LHC
Posts: 321
Joined: Thu Sep 17, 2020 4:21 pm
Location: Canadian Coffee Shop

Re: Honeycomb macro

Post by LHC »

If it's expected behavior I would not change it. After a few times it will be expected by me too :D
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Honeycomb macro

Post by TheMarkster »

@chennes

I'd like to install this macro (and some others) with a .py extension instead of a .FCMacro extension. The reason for this is I won't have to create an additional .py file for the class definition for the feature python class or for the view provider class if the macro has a .py extension. I have stored it in a gist as a .py file and changed all the .FCMacro extensions to .py, but the addon manager must still be assuming the .FCMacro extension for all macros rather than respecting the extension given for the file on the wiki and on gist.github.com.

If it has a .py extension, then FreeCAD can find the module within the macro itself and import the class definitions, but not so with a .FCMacro extension. As it currently stands I either need to create the file in the macro or tell the user to manually rename to a .py extension after installing. The toolbar icon would then fail as it would be looking for the .FCMacro file.
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Honeycomb macro

Post by chennes »

That seems reasonable -- please post an Issue on GitHub.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Honeycomb macro

Post by TheMarkster »

chennes wrote: Fri Oct 27, 2023 2:18 pm That seems reasonable -- please post an Issue on GitHub.
https://github.com/FreeCAD/FreeCAD/issues/11213
Post Reply