Git Product home page Git Product logo

freecad-macros's Introduction

FreeCAD-macros

A repository of peer-reviewed FreeCAD macros.

This repository hosts FreeCAD macros that volunteers have vetted and added for use to the whole community in general available through the FreeCAD Addon Manager.

How to submit a macro

  • The best way to submit a macro is to post it to the FreeCAD Python Scripting and Macros subforum for review. After a green light is given then:

  • Fork this repository

  • Clone your fork locally git clone https://github.com/your-gh-username/FreeCAD-macros

  • Go to the newly-created local repository cd FreeCAD-macros

  • Setup the upstream git remote add upstream https://github.com/FreeCAD/FreeCAD-macros

  • Create a branch to work in git checkout -b your_branch

  • Follow our guidelines below on how to add a macro

  • When you're ready to push your changes: git push -u origin your_branch

  • Create a PR (pull request) against upstream

  • Achieve global fame once PR is merged

Guidelines for submitting a macro

Macro description

Please add a complete description how to use the macro near the top of your macro as normal Python comments. Ideally write a Wiki page explaining what your macro does and how to use it by following the instructions on the Wiki. It's a good habit to write a changelog, especially when bringing API breaking changes, from latest to oldest.

CamelCase macro name

Please follow the CamelCase.FCMacro convention for the macro name (other associated files except the macro icon don't need to follow this convention). Please don't start your macro name with Macro or FC or similar (we already know it's a macro for FreeCAD).

Macro name specifics

Also, if possible, start the macro name with the type of object it's working on, e.g. use ViewRotation instead of RotateView, so that all macros related to View will be together when sorting alphabetically.

Macro metadata

Please add the following metadata in your macro after the Macro description (mentioned above).

Macro metadata

    __Name__ = ''
    __Comment__ = ''
    __Author__ = ''
    __Date__ = ''
    __Version__ = ''
    __License__ = ''
    __Web__ = ''
    __Wiki__ = ''
    __Icon__ = ''
    __Xpm__ = ''
    __Help__ = ''
    __Status__ = ''
    __Requires__ = ''
    __Communication__ = ''
    __Files__ = ''

Explanation of metadata

NOTE: All metadata elements are simple strings, and may not contain code to evaluate. The FreeCAD Addon Manager parses these strings by searching for an equals sign followed by something inside quotes (single or double), all on a single line. Lines may not wrap. For example:

# Good, valid
__Comment__ = "When run, this macro reads your mind and creates the thing your are imagining."

# Bad, contains code:
__Author__ = ",".join(author_list)

# Bad, not a single string:
__Comment__ = "Some descriptive text" + " and more text"

# Bad, multiple lines:
__Files__ = "MyFirstFile.FCMacro \
MySecondFile.FCMacro"

# EXCEPTION: __Version__ may be set to __Date__ as long as __Date is defined first
__Date__ = 2022.05.19
__Version__ = __Date__

# EXCEPTION: XPM data must be a triple-quoted multi-line string
__Xpm__ = """
/* XPM */
static char * XFACE[] = {
"48 4 2 1",
"a c #ffffff",
"b c #000000",
"abaabaababaaabaabababaabaabaababaabaaababaabaaab",
"abaabaababaaabaabababaabaabaababaabaaababaabaaab",
"abaabaababaaabaabababaabaabaababaabaaababaabaaab",
"abaabaababaaabaabababaabaabaababaabaaababaabaaab"
};
"""
  • __Name__ - The name of the macro, for display by the Addon Manager. Generally the filename of the macro without extension, and with spaces between words. For example, the macro file "DxfToSketchLayers.FCMacro" becomes "DXF to Sketch Layers"
  • __Comment__ - A description of what the macro does. Displayed and searched by the Addon Manager.
  • __Author__ - Comma-separated list of authors (as a single string, e.g. "Jane Doe, John Smith, Bobbi Jones")
  • __Version__ - Use semantic versioning (1.2.3-beta), or CalVer (2022.05.19)
  • __Date__ - The date of the last update, YYYY-MM-DD
  • __License__ - 'License identifier from https://spdx.org/licenses/, e.g. LGPL-2.0-or-later as FreeCAD, MIT, CC0-1.0'
  • __Web__ - A URL to fetch the macro from
  • __Wiki__ - The wiki page (generally at https://wiki.freecad.org) describing the macro, and displayed as the "Details" page in the Addon Manager.
  • __Icon__ - Either a relative path to an icon file included in the FreeCAD macros repository, or a URL where the icon may be downloaded from. Must be a direct download of an image file.
  • __Xpm__ - (OPTIONAL) Instead of specifying an __Icon__, icon data may be set directly as a triple-quoted string containing XPM data.
  • __Help__ - A short explanation how to use the macro, e.g. what to select before launching
  • __Status__ - Stable|Alpha|Beta
  • __Requires__ - e.g. FreeCAD >= v0.17, there is no programmatic use of this for now
  • __Communication__ - e.g. https://github.com/FreeCAD/FreeCAD-macros/issues/ if on the github
  • __Files__ - comma-separated list of files that should be installed together with this file, use paths relative to this file, do not include this file, and do not wrap the line, all files must be listed in the same single-line quoted string.

freecad-macros's People

Contributors

0penbrain avatar 18turbo avatar chbergmann avatar chennes avatar christiangda avatar chupins avatar damianloz avatar deepsoic avatar dlozinski avatar edi271 avatar eoyilmaz avatar fablabbaramati avatar florian31415 avatar galou avatar goatchurchprime avatar iinjdpa avatar jolbas avatar leeholmes avatar luzpaz avatar melwyncarlo avatar mnnxp avatar mwganson avatar normandc avatar pysimone avatar s-quirin avatar spritkopf avatar studiopetrikas avatar syres916 avatar wandererfan avatar yorikvanhavre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freecad-macros's Issues

BoxCreator overhangTopBack is set to overhangTopRight

Create a box, with defaults, except set overhangTopRight to some value and box will ALSO have a top back overhang.

See BoxCreator.FCMacro lines: 59:62
overhangTop = [self.form.overhangTopLeft.value(),
self.form.overhangTopRight.value(),
self.form.overhangTopFront.value(),
self.form.overhangTopRight.value()]
last line should read
self.form.overhangTopBack.value()]

Please add circle support

Hello,
Thank you for creating this wonderful script.

there is a request, could you please add circle support.

I tried to modify the script of the previous version.
the your latest version is quite unstable and the results are unpredictable

I used the previous version where you could manually add values, and also tried to implement additional options for disabling binding and reverse. the creation of two directions at the same time was also added.
the script is still incomplete and has some bugs

However, the main disadvantage is the inability to create an offset from the circle.

Could you help add circle offsets or at least give me a hint
OffsetInSketcherPlus.zip

Discussion: the utility of the wiki macros

Discussion on why we have the wiki macros in gists.
Why? It seems there was an issue that was encountered which influenced moving to this 'gist' fix.

  • Examples:
  • Problems with gists:
    • not easily browesable
    • jumping through a lot of hoops to get to (go to wiki page, expand macro, copy gist url, no line numbers to reference)
    • gists have multiple versions (though the latest is shown, but could be confusing)
    • raw gists don't have line numbers that are linkable
    • gist URL is long and esoteric
    • how do users know who mario52 is if they look at the http logs (better for it to be under the FreeCAD org umbrella)
    • difficult to submit fixes and refinements to
    • difficult to organize

Addon manager forever loop reading wiki

Hello, this bug affect windows and Linux version of Freecad 0.18.

If you activate the addons manager, clicking on Marcos tab, it starts reading Wiki, but it never stops reading and you can't do anything except close the addons manager. So you can't install any addons.

Unit tests for macros (checking compatiblity with current build)

FreeCAD Macros (either within this repo or pulled from the wiki) can break as FreeCAD evolves. Does it make sense that with every macro that exists and added in the future - a test is attached to it in order to see that it's functionality still works correctly. If not then the script (something like the Test Workbench) notifies the tester and can recommend creating a ticket to address the issue?

screw maker1 2

hello, I loaded your library from the freecad addons but when I run it nothing happens. Freecad version 0.18

Indentation error

  • ObjectCreation/Draft_Circle_3_Points.FCMacro

Error in Py3Qt5 (stills works fine in Py2Qt4):

<unknown exception traceback><class 'TabError'>: ('inconsistent use of tabs and spaces in indentation', ('E:/Data/FreeCAD/Macro/Draft_Circle_3_Points.FCMacro', 58, 18, '\t\tx_point_1=ta[1]\n'))
  • unrollRuledSurface.py

Error in Py3Qt5 (stills works fine in Py2Qt4):

<unknown exception traceback><class 'TabError'>: ('inconsistent use of tabs and spaces in indentation', ('E:/Data/FreeCAD/Macro/Unroll_Ruled_Surface.FCMacro', 96, 25, '\tif faces.__len__() > 1:\n'))

Related to #8
Found by @Syres916 on the forum

ObjectCreation/ScrewMaker.FCMacro

When running the macro with "Real Thread" selected, the next error occurs:

File "/home/eddy/.FreeCAD/Macro/screw_maker1_2.FCMacro", line 4282, in makeShellthread
for i in range(rotations-2):
TypeError: 'float' object cannot be interpreted as an integer

(Probably a Python3 issue)

Proposed solution: convert rotations to int
in line 4223: change to --> rotations = int (halfrots_int / 2)-1

FCC Circular Text installation fails

Attempting to install the FCCCircularText macro reports an error:

Screen Shot 2022-04-28 at 10 42 48 AM

This may be related to issue #111 (regression?)

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.28765 (Git)
Build type: Release
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: C/Default (C)
Installed mods: 
  * kicadStepUpMod 10.10.4

FreeCAD macro to help move objects in the tree for long trees. TreeHelper

Hello,

I was developing a macro for help to move objects in FreeCAD's tree when this is very long.
The macro was posted on various local forums with good feedback and I think it will be useful for the community if this is accessible from Addon Manager.
I upload all the code in this path in github and include some youtube videos for explain the correct use.
I took some other macros for replicate good practices although perhaps it was not enough. If it is necesary change some questions or take some actions in order to publish the macro in Addon Manager please let me know.

Thank you,

Dani.

LasercutterSVGExport does not support arrays

Hi,
I am currently using LasercutterSVGExport in a project which uses the Array feature from the Draft WB. Unfortunately, this is not supported by this macro.
The macro works with the underlying part so I think using the part and the Object->Count information could do the trick. My freecad-scripting and python knowledge is rather basic/non-existent so I hope could by fixed in the future.

Making View Rotation Macro work with floats

I am really noob how to use git, so I couldn't manage to commit this myself. However in Puregui/viewRotation.FCMacro line 237, the entered value is changed into an integer. I couldn't see a reason to make this an integer. I have downloaded the macro and changed this line into

value = float(self.line_edits[i].text())

The code worked flawlessly and I was able to input float values as well. With this simple change the macro can be made much better.

Misc. Macro issues

  • CartoucheFC.FCMacro
<unknown exception traceback><class 'SyntaxError'>: ("(unicode error) 'utf-8' codec can't decode byte 0xe9 in position 0: unexpected end of data", ('E:/Data/FreeCAD/Macro/CartoucheFC.FCMacro', 853, 33, None))
  • ObjectCreation/ScrewMaker.FCMacro
Error on Py3Qt5 (85% funtionality in Py2Qt4):

<unknown exception traceback><class 'SyntaxError'>: ("(unicode error) 'utf-8' codec can't decode byte 0xb0 in position 87: invalid start byte", ('E:/Data/FreeCAD/Macro/screw_maker1_2.FCMacro', 4846, -1, '    """\n'))
  • ObjectCreation/MakeCircle3Points.FCMacro
Error:
<unknown exception traceback><class 'SyntaxError'>: ("(unicode error) 'utf-8' codec can't decode byte 0xe0 in position 29: invalid continuation byte", ('E:/Data/FreeCAD/Macro/Make_Circle_3_Points.FCMacro', 164, 60, None))
  • ObjectCreation/Ellipse-Center+2Points.FCMacro
Error in Py3Qt5, last worked correctly in 0.17 Release

<unknown exception traceback><class 'SyntaxError'>: ('invalid syntax', ('E:/Data/FreeCAD/Macro/Ellipse-Center+2Points.FCMacro', 15, 24, '\tprint "Wrong selection"\n'))
  • ObjectCreation/Airfoil_Import_and_Scale.FCMacro
Error on Py3Qt5 (still works on Py2Qt4):

<unknown exception traceback><class 'SyntaxError'>: ('invalid syntax', ('E:/Data/FreeCAD/Macro/Airfoil_Import_&_Scale.FCMacro', 40, 29, '            except Exception, e:\n'))

Related to #8
Found by syres on the forum

Camera.FCMacro - invalid line split at 1335-6

App.Console.PrintMessage("Refresh (3Dview = X " + str(ori_Horizont) + ",

NB: I'm a FreeCAD newbie, so I may be holding things wrong, but...

Lines 1335-6 have a bad string split:

            App.Console.PrintMessage("Refresh (3Dview = X " + str(ori_Horizont) + ",
                                                        Y " + str(ori_Vertical) + ") " + "\n")

the final double-quote on 1335 is not closed until the next line. Fixed in my copy by just making 1335-6 into one line:

            App.Console.PrintMessage("Refresh (3Dview = X " + str(ori_Horizont) + ", Y " + str(ori_Vertical) + ") " + "\n")

Could also be fixed by moving the ", to 1336 to produce:

            App.Console.PrintMessage("Refresh (3Dview = X " + str(ori_Horizont) + 
                                                        ", Y " + str(ori_Vertical) + ") " + "\n")

SketcherOffset.FCMacro fails in 0.20

When I execute this macro the following is shown in report view:

12:31:24  Traceback (most recent call last):
  File "/home/mac/SharedData/FC_common/SketcherOffset.FCMacro", line 440, in <module>
    ex = OffsetDialog() 
  File "/home/mac/SharedData/FC_common/SketcherOffset.FCMacro", line 35, in __init__
    self.tracker = DraftTrackers.lineTracker(scolor=(1,1,1),swidth=3,dotted=True) 
<class 'NameError'>: name 'DraftTrackers' is not defined

OS: Ubuntu 20.04.2 LTS (XFCE/ubuntustudio)
Word size of FreeCAD: 64-bit
Version: 0.20.24711 (Git)
Build type: Release
Branch: master
Hash: 47a41ae1c8a08fe47ce0e7b5b73df8f849adfe21
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)

Macros need __License__ strings

A quick look through the repo seems to indicate that there are many macros with licenses written at the top of their source code, but no __License__ variable set. The Addon Manager now processes the __License__ string, interpreting it as an SPDX ID, and optionally allows users to filter on the value. A missing string will be treated as an "All Rights Reserved" license, which is overly restrictive in many cases. Macros with more permissive licenses should have that variable set. I've fixed a few of them myself, but could use some help with the remainder.

Tracking: Macros not shown in the AddonManager

  • ObjectCreation/ParabolaCreater.FCMacro
  • FCRotateViewAbsolute.FCMacro
  • Foto.FCMacro (and it errors out, see below)
Error:
Traceback (most recent call last):
  File "E:/Data/FreeCAD/Macro/Foto.FCMacro", line 56, in <module>
    sel0 = sel[0]
<class 'IndexError'>: list index out of range

Related to #8
Found by @Syres916 on the forum

Addon Manager utf8 issues

  • Utility/HighlightDifference.FCMacro

Failed to install using Py3Qt5 AddOnManager with error :

Traceback (most recent call last):
  File "E:\Data\My Downloads\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\Mod\AddonManager\AddonManager.py", line 423, in install
    if install_macro(macro, self.macro_repo_dir):
  File "E:\Data\My Downloads\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\Mod\AddonManager\AddonManager.py", line 135, in install_macro
    macrofile.write(macro.code)
  File "E:\Data\My Downloads\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\bin\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2212' in position 2434: character maps to <undefined>
  • FCCamera.FCMacro
Failed to install using Py3Qt5 AddOnManager with error (looks like AddOnManager needs some more robustness handling externally stored macros) :

 File "E:\Data\My Downloads\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\Mod\AddonManager\AddonManager.py", line 423, in install
    if install_macro(macro, self.macro_repo_dir):
  File "E:\Data\My Downloads\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\Mod\AddonManager\AddonManager.py", line 135, in install_macro
    macrofile.write(macro.code)
  File "E:\Data\My Downloads\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\FreeCAD_0.18.15643_Conda_Py3QT5-WinVS2015_x64\bin\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 35753: character maps to <undefined>

Related to #8
Found by @Syres916 on the forum

Freecad launched with errors; addon manager doesn't work

Is there an existing issue for this?

  • I have searched the existing issues

Version

0.20 (Release)

Full version info

[code]
OS: Debian GNU/Linux bookworm/sid (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: French/France (fr_FR)
[/code]

Subproject(s) affected?

Addon Manager

Problem description

  1. When I launch Freecad, I got this error in the terminal:

/home/runner/work/FreeCAD-Bundle/FreeCAD-Bundle/conda/linux/AppDir/usr/share/libdrm/amdgpu.ids: Aucun fichier ou dossier de ce type

the French part means: no file or directory of this type

  1. the addon manager blocks when I try to add any addon.
    Capture d’écran du 2023-01-30 15-39-11

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Tracking: Py3/Qt5 + Uniformity

Reasons:

  • we can run unit tests on them to see if they work
  • they are readable and users can study them
  • inspect/test them for vulnerabilities
  • remove typos
  • have the ability to eventually run them in console mode only (depending on the viability of this)
  • easy to understand attribution to the author(s)
  • clear posting of what the licence is

Macros missing info

Macro Name License Metadata Py3 Qt5
CartoucheFC.py πŸ‘Ž πŸ‘Ž
ViewRotation.FCMacro πŸ‘ πŸ‘
FCRotateViewAbsolute.FCMacro πŸ‘Ž πŸ‘Ž
Foto.FCMacro πŸ‘Ž πŸ‘Ž
GenevaWheelGUI.py πŸ‘Ž πŸ‘Ž
ScrewMaker.FCMacro πŸ‘Ž πŸ‘Ž
SolidSweep.FCMacro πŸ‘Ž πŸ‘Ž
apothemBasedPrism.py πŸ‘Ž πŸ‘Ž
makecamera2dview.py πŸ‘Ž πŸ‘Ž
unfoldBox.py πŸ‘Ž πŸ‘Ž
unrollRuledSurface.py πŸ‘Ž πŸ‘Ž
ForceRecompute.FCMacro πŸ‘Ž πŸ‘Ž
HighlightCommon.FCMacro πŸ‘ πŸ‘ πŸ‘ πŸ‘
HighlightDifference.FCMacro πŸ‘ πŸ‘ πŸ‘ πŸ‘
MeasureCircle.FCMacro πŸ‘ πŸ‘
MessageBox.FCMacro πŸ‘Ž πŸ‘Ž
SelectVisible.FCMacro πŸ‘Ž πŸ‘Ž
Rectellipse.FCMacro πŸ‘Ž πŸ‘Ž
Airfoil_Import_and_Scale.FCMacro πŸ‘Ž πŸ‘Ž
Draft_Circle_3_Points.FCMacro πŸ‘Ž πŸ‘Ž
Draft_Circle_3_Points_improved.FCMacro πŸ‘Ž πŸ‘Ž
Ellipse-Center πŸ‘Ž πŸ‘Ž
GeodesicDome.FCMacro πŸ‘Ž πŸ‘Ž
HalfHull.FCMacro πŸ‘Ž πŸ‘Ž
HyperbolaCreater.FCMacro πŸ‘Ž πŸ‘Ž
Macro_FCCircularText.FCMacro πŸ‘Ž πŸ‘
MakeCircle3Points.FCMacro πŸ‘Ž πŸ‘Ž
ParabolaCreater.FCMacro πŸ‘Ž πŸ‘Ž
ExportFem.FCMacro πŸ‘Ž πŸ‘Ž

Obsolete Macros

  • Utilitu/ForceRecompute.FCMacro (no longer actually required from >=0.17)

Cannot retrieve the list of addons

Hi,

In the addon manager, when I click on the Macros tab, it keeps showing "downloading list of macros". The report view shows:

Traceback (most recent call last):
  File "C:\Program Files\FreeCAD 0.18\Mod\AddonManager\AddonManager.py", line 701, in run
    self.retrieve_macros_from_wiki()
  File "C:\Program Files\FreeCAD 0.18\Mod\AddonManager\AddonManager.py", line 741, in retrieve_macros_from_wiki
    u = urlopen("https://www.freecadweb.org/wiki/Macros_recipes")
  File "C:\Program Files\FreeCAD 0.18\Mod\AddonManager\addonmanager_utilities.py", line 36, in urlopen
    u = urllib2.urlopen(url, context=ssl_ctx)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\urllib\request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

It seems you recently changed something to the wiki URLs, because most links found when googling are also invalid wiki URLs.

As a nice to have feature, this exception should be caught, in order to inform the user about server issues.

[GetGlobalPlacement] Issue with the scale computation

The macro return the wrong result for an object with rotation 0.45642222410108496, 0.49809724456331667, 0.5849212871934979, -0.4488262203714842. The returned scale factor is -1, -1, 1 but should be 1, 1, 1. According to this, the scale computation involves the eigenvalue decomposition.

I already fixed the issue for objects that are not scaled in 47dbb41. The issue subsists for scaled objects but a warning is printed.

I added a test for this.

@Jolbas do you have the capacity to have a look at this?

FC Circular Text macro generates inconsistent result

The basic "FreeCAD the Best" text example seems to generate a reasonably usable result when using the "Flat Mode". However, other text snippets can create results that are not usable. For example:

Screen Shot 2022-04-30 at 9 00 59 AM

There appears to be a problem with the character spacing.

Using pywikibot to auto-update macro pages

Recently I have gotten pywikibot to work and am updating the https://www.freecadweb.org/wiki/Template:Development-Version template that is used on the https://www.freecadweb.org/wiki/Appimage page.

So lets discuss a list of actions that we can automate with a bot that would be useful for the Macro maintainers.

Things like:

  • Version bumping - when a macro is updated in order to update the specific macro page
  • Updating a Macro's changelog on the wiki
  • Translations (not sure what but may be useful)
  • Searching through macros

Several macros reporting error: cannot import name 'app'

Related to #8
Found by @Syres916 on the forum

  • Conversion/DeepCopy.FCMacro
Same Error Message in Py2Qt4 and Py3Qt5, author Galou
Traceback (most recent call last):
  File "E:/Data/FreeCAD/Macro/DeepCopy.FCMacro", line 14, in <module>
    from freecad import app
<class 'ImportError'>: cannot import name 'app'

Edit:
FYI, this is the same error given in:

  • Utility/HighlightDifference.FCMacro
Same Error Message in Py2Qt4 and Py3Qt5, author GaΓ«l Ecorchard

Traceback (most recent call last):
  File "E:/Data/FreeCAD/Macro/HighlightDifference.FCMacro", line 23, in <module>
    from freecad import app
<class 'ImportError'>: cannot import name 'app'
  • Utility/HighlightCommon.FCMacro
Same Error Message in Py2Qt4 and Py3Qt5, author JMG
	
Traceback (most recent call last):
  File "E:/Data/FreeCAD/Macro/HighlightCommon.FCMacro", line 23, in <module>
    from freecad import app
<class 'ImportError'>: cannot import name 'app'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.