boxcreator on Freecad 0.18

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Syres
Posts: 660
Joined: Thu Aug 09, 2018 11:14 am

Re: boxcreator on Freecad 0.18

Postby Syres » Mon Jul 01, 2019 10:34 am

chrisb wrote:
Sun Jun 30, 2019 12:53 pm
Syres wrote:
Sun Jun 30, 2019 10:53 am
I believe the reason for new users (or those of us who never had the macro) not seeing macros such as this one is that they must have an entry in the Wiki
There must be another reason, because I do see it in the Addonmanager's list.
I've read the code more thoroughly and the first step, it tries to use GitPython which I would guess at least 75% of Windows users wouldn't have installed and then it uses the Wiki so I'm guessing you are running GitPython. The code section in addonmanager_workers.py I'm referring to is:

Code: Select all

    def run(self):

        """Populates the list of macros"""

        self.retrieve_macros_from_git()
        self.retrieve_macros_from_wiki()
        [self.add_macro_signal.emit(m) for m in sorted(self.macros, key=lambda m: m.name.lower())]
        if self.macros:
            self.info_label_signal.emit(translate('AddonsInstaller', 'List of macros successfully retrieved.'))
        self.progressbar_show.emit(False)
        self.stop = True

    def retrieve_macros_from_git(self):

        """Retrieve macros from FreeCAD-macros.git

        Emits a signal for each macro in
        https://github.com/FreeCAD/FreeCAD-macros.git
        """

        try:
            import git
        except ImportError:
            self.info_label_signal.emit("GitPython not installed! Cannot retrieve macros from Git")
            FreeCAD.Console.PrintWarning(translate('AddonsInstaller', 'GitPython not installed! Cannot retrieve macros from git')+"\n")
            return
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17171 (Git)
Build type: Release
Branch: master
Hash: d19470a9711ea604f3ca6c93e46afadf64d5bb87
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
chrisb
Posts: 24399
Joined: Tue Mar 17, 2015 9:14 am

Re: boxcreator on Freecad 0.18

Postby chrisb » Mon Jul 01, 2019 11:08 am

I'm on a Mac and have indeed Git installed. So I think you are right with your assumption.
UR_
Posts: 1184
Joined: Tue Jan 03, 2017 8:42 pm

Re: boxcreator on Freecad 0.18

Postby UR_ » Mon Jul 01, 2019 11:28 am

windows conda builds and LP 12.1.2 builds have gitpython in their package

.
jmaustpc
Posts: 9639
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: boxcreator on Freecad 0.18

Postby jmaustpc » Mon Jul 01, 2019 3:24 pm

Syres wrote:
Mon Jul 01, 2019 10:34 am
it tries to use GitPython
Now that you mention it, Yorik did say something about python-git, I had forgotten.
Package name in Ubuntu is python-git for Python2 and python3-git for Python 3.
User avatar
christi
Posts: 76
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: boxcreator on Freecad 0.18

Postby christi » Mon Jul 01, 2019 4:07 pm

TheMarkster wrote:
Mon Jul 01, 2019 7:10 am
That's a neat macro. Only one problem -- those box joints are going to be mighty tight come assembly time. Of course, if you print with ABS and use acetone it will probably still be able to go together as the acetone dissolves some of the material.
You can use the 3D Offset tool from the Part workbench to shrink the sides of the box. Enter a negative value for offset parameter.
TheMarkster
Posts: 1392
Joined: Thu Apr 05, 2018 1:53 am

Re: boxcreator on Freecad 0.18

Postby TheMarkster » Mon Jul 01, 2019 5:56 pm

UR_ wrote:
Sun Jun 30, 2019 2:52 pm

Edit:
yorik wrote: *ping*
i had to add to ...\Mod\AddonManager\addonmanager_utilities.py, line 27

Code: Select all

import shutil
to make install of macro working
I already have another trivial addonmanager bugfix PR pending. I will add UR_'s fix for this bug to it, too.

https://github.com/FreeCAD/FreeCAD/pull/2304
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
TheMarkster
Posts: 1392
Joined: Thu Apr 05, 2018 1:53 am

Re: boxcreator on Freecad 0.18

Postby TheMarkster » Mon Jul 01, 2019 7:56 pm

christi wrote:
Mon Jul 01, 2019 4:07 pm
You can use the 3D Offset tool from the Part workbench to shrink the sides of the box. Enter a negative value for offset parameter.
Thank you. Yes, that is a good tool for this. I have another way that has more work involved, but has the advantage of allowing us better control over which faces get cut into.

This macro makes extrude compatible face objects from all selected faces. To use is very simple (though somewhat tedious with many faces). Just select your faces, then run the macro.

Code: Select all

"""
CopyFaces Macro, by TheMarkster
Creates a simple non-parametric face object from each selected face.  This face object can be extruded.
Can even extrude all of them in one go via Part -> Extrude.  It is suggested to
make the Extrude symmetric for more predictable results.

"""

import FreeCAD
import Draft

selobj = FreeCAD.Gui.Selection.getSelectionEx()
if len(selobj)>=1:
    faces=FreeCAD.Gui.Selection.getSelectionEx()[0].SubObjects
else:
    FreeCAD.Console.PrintError("Select some faces and try again.")

for f in faces:
    w = Draft.makeWire(f)
    App.ActiveDocument.recompute()
    face = Draft.downgrade(App.ActiveDocument.ActiveObject)

App.ActiveDocument.recompute()
You will find in the tree view now some new objects Face, Face001, Face002, etc. Select them in the tree and run the Part -> Extrude on them. Set symmetric checkbox so you don't get some of the faces extruded in the wrong direction from what you intend. Fuse the Extrude objects, then cut the Fuse from the object to trim away some of each face (or Fuse to the object if you want to pad the faces instead of cut them).

In the video notice I only select the interior faces on the side because I don't want to cut deeper that other face. I just want to more easily be able to assemble the box.

Also note that I have my settings to have refine turned off, so where the cut is made there are some tiny extra faces showing. These won't be there if you refine set to true.

phpBB [video]
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
harlekin
Posts: 19
Joined: Wed May 13, 2015 8:52 pm

Re: boxcreator on Freecad 0.18

Postby harlekin » Tue Jul 02, 2019 9:44 am

This is the versione i work with:

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)

thank you again