Honeycomb macro
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Honeycomb macro
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.
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.
**********
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.
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 128 times
-
- Honeycomb.svg
- (24.76 KiB) Downloaded 113 times
Re: Honeycomb macro
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
Thanks again,
Lewis
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Honeycomb macro
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:
and then after:
For example, this grid before positioning with YAdjust property:
and then after:
Re: Honeycomb macro
Thanks for the clarification. I just loaded it up and had a play. Seems to work like a charm.
Re: Honeycomb macro
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. 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...
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. 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...
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Honeycomb macro
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.
Re: Honeycomb macro
If it's expected behavior I would not change it. After a few times it will be expected by me too
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Honeycomb macro
@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.
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.
Re: Honeycomb macro
That seems reasonable -- please post an Issue on GitHub.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am