Skip to content

Instantly share code, notes, and snippets.

@mario52a
mario52a / Macro_FCSpring_Helix_Variable.FCMacro
Last active April 17, 2024 11:19
This macro creates a spring with customizable, any turn may change the spring configuration can be saved in a file with the extension .FCSpring or in a coordonate file with the extension .FCSpringCoor
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
"""
***************************************************************************
* Copyright (c) 2014-2015-2016-2017 2018 2019 2020 2022 2023 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
@mario52a
mario52a / Macro_Line_Length.FCMacro
Created February 25, 2015 16:33
This small macro create a line giving as an argument the XYZ coordinates, length, and angle
# -*- coding: utf-8 -*-
# créer une ligne avec une coordonnée une longueur et un angle sur le plan X Y
# create line with coordinate length and angle to plane X Y
import FreeCAD, FreeCADGui, Draft
from math import cos, sin, radians
#from FreeCAD import Base
def line_length(x1 = 0.0, y1 = 0.0, z1 = 0.0, length = 10.0, angle = 0.0):
x2 = x1 + (length * cos(radians(angle)))
y2 = y1 + (length * sin(radians(angle)))
@mario52a
mario52a / FCInfo_en_Ver_1-28c-rmu_Docked.FCMacro
Last active April 17, 2024 12:47
Gives a series of informations about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, pourcent) shape, surface, volume and the weight of the form in the density selected in different units of quantities international and Anglo-Saxon. (English version)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) <mario52> 2014 2015 2016 2017 2018 2019 2020 2021 2022 *
* 2023 *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
@mario52a
mario52a / FCInfo_fr_Ver_1-28c-rmu_Docked.FCMacro
Last active October 30, 2023 12:34
Donne une série de renseignements sur la forme sélectionnée et peut afficher une conversion de la longueur, de l'inclinaison de la forme (degrés, radian, grade, pourcent), de la surface, du volume et du poids de la forme dans la densité sélectionnée dans différentes unités de grandeurs internationales et anglo-saxonnes. (Version Française)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) <mario52> 2014 2015 2016 2017 2018 2019 2020 2021 2022 *
* 2023 *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
@mario52a
mario52a / FCInfo_en_Ver_1-12_No_Docked_Ubuntu.FCMacro
Last active August 12, 2021 23:52
Gives a series of informations about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, pourcent) shape, surface, volume and the weight of the form in the density selected in different units of quantities international and Anglo-Saxon. (English version)
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2014 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
* as published by the Free Software Foundation; either version 2 of *
@mario52a
mario52a / FCInfo_fr_Ver_1-12_No_Docked_Ubuntu.FCMacro
Created February 25, 2015 16:49
Gives a series of informations about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, pourcent) shape, surface, volume and the weight of the form in the density selected in different units of quantities international and Anglo-Saxon. (Version Française)
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2014 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
* as published by the Free Software Foundation; either version 2 of *
@mario52a
mario52a / Macro_WireXYZ.FCMacro
Last active August 12, 2021 23:51
This macro creates a wire (or points) with the coordinates extracted from a file. The coordinates X Y Z are separated by a space.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# created a wire with coordinate x y z separated (in the file without coma)
__title__= "Macro_WireXYZ"
__author__= "Mario52"
__date__= "2020/10/16"
__version__= "00.03"
##
#EX:
#0 0 0
@mario52a
mario52a / Macro FCCamera.FCMacro
Last active August 12, 2021 23:51
This macro can rotate the screen in a defined angle and the defined axis and creates a plan to face the screen to create a form in the specified plan positions the selected face facing the screen, to detect the position of the camera, align view to face or to axis, align the object to view.
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2015 2016 2017 2018 2019 2020 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
* as published by the Free Software Foundation; either version 2 of *
@mario52a
mario52a / Macro FCTexture.FCMacro
Last active November 19, 2023 10:50
This small macro allows you to build a project 3D very easily from a bitmap image 256 levels of gray. I hope that this macro will revolutionize the way of thinking the CAD and CNC any image when what can be converted to object 3D without any intervention. Everything becomes possible regardless of the complexity of the image !
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) 2014 2015 2016 2017 2018 2019 2020 2021 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License (GPL) *
@mario52a
mario52a / Macro_FCInfoGlass.FCMacro
Last active December 18, 2021 19:23
Gives a series of informations about the selected shape and can display a directly in the 3D view
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) 2015 2016 <mario52> *
* *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *